1
0
Fork 0
nixos-config/home-manager/roles/default.nix

251 lines
6 KiB
Nix
Raw Normal View History

2022-03-08 01:42:46 +00:00
{
pkgs,
config,
lib,
...
}: {
2019-07-31 21:56:52 +00:00
imports = [
./zsh
2020-05-27 13:20:08 +00:00
./home-options.nix
2020-07-03 13:18:43 +00:00
../../common
2020-05-05 23:40:57 +00:00
./unlock.nix
./mpclient.nix
2020-05-12 16:39:18 +00:00
./neovim
2021-04-17 16:12:20 +00:00
./nvd.nix
2019-07-31 21:56:52 +00:00
];
2022-03-08 01:42:46 +00:00
nixpkgs.overlays = import ../../overlays {inherit lib;};
2018-05-31 10:34:48 +00:00
2021-07-05 18:52:56 +00:00
news.display = "silent";
2019-07-31 21:56:52 +00:00
programs = {
home-manager.enable = true;
2021-06-01 23:31:08 +00:00
exa = {
enable = true;
enableAliases = true;
};
lazygit = {
2021-06-07 22:36:11 +00:00
settings = {
customCommands = [
{
key = "s";
command = "git sync";
context = "global";
subprocess = true;
}
{
key = "s";
command = "git sync";
context = "files";
subprocess = true;
}
];
};
2021-06-01 23:31:08 +00:00
enable = true;
};
2019-07-31 21:56:52 +00:00
direnv = {
enable = true;
enableZshIntegration = true;
2022-03-07 16:13:18 +00:00
nix-direnv = {
enable = true;
enableFlakes = true;
};
2019-02-19 11:14:58 +00:00
};
2022-03-07 16:13:18 +00:00
2019-07-31 21:56:52 +00:00
tmux = {
enable = true;
2020-05-20 07:44:39 +00:00
escapeTime = 1;
historyLimit = 50000;
terminal = "screen-256color";
2019-07-31 21:56:52 +00:00
extraConfig = ''
set -g set-titles on
set -g status off
2021-03-08 15:43:18 +00:00
set -g set-titles-string '#T - #W - tmux @ #h'
set -g allow-rename on
2019-07-31 21:56:52 +00:00
'';
};
2020-05-22 01:32:14 +00:00
password-store = {
2022-03-08 01:42:46 +00:00
package = pkgs.pass-wayland.withExtensions (exts: [exts.pass-update pkgs.pass-clip exts.pass-otp]);
2020-05-22 01:32:14 +00:00
enable = true;
2021-04-17 16:12:29 +00:00
settings.PASSWORD_STORE_DIR = "${config.home.homeDirectory}/git/password-store";
2020-05-22 01:32:14 +00:00
};
2019-07-31 21:56:52 +00:00
git = {
2020-11-22 01:05:11 +00:00
aliases = {
sync = "!git pull -r && git push";
2021-04-17 16:12:29 +00:00
cpr = "!f() { git fetch origin refs/pull/$1/head && git checkout FETCH_HEAD; }; f";
};
2021-07-30 17:02:10 +00:00
2021-04-17 16:12:29 +00:00
extraConfig = {
2021-12-30 04:14:20 +00:00
merge.conflictStyle = "diff3";
2021-04-17 16:12:29 +00:00
pull.ff = "only";
2021-07-09 17:35:58 +00:00
core.editor = "vim";
2021-07-30 17:02:10 +00:00
init.defaultBranch = "main";
2020-11-22 01:05:11 +00:00
};
2019-07-31 21:56:52 +00:00
enable = true;
ignores = [
".syncthing*.tmp"
"*.swp"
"*.autosave~"
"*.aux"
"*.bbl"
"*.fls"
"*.idx"
"*.ilg"
"*.ind"
"*.log"
"*.out"
"*.toc"
"*.bcf"
"*.blg"
"*.fdb*"
"*.thm"
"*.run.xml"
"*.slnc"
"*.glade~"
"__pycache__"
".hledger-web_client_session_key.aes"
".nix-gc-roots"
2018-04-02 15:52:16 +00:00
];
2020-10-01 00:32:51 +00:00
userEmail = "malte.brandy@maralorn.de";
userName = "Malte Brandy";
2019-07-31 21:56:52 +00:00
};
htop = {
enable = true;
2021-06-01 23:35:16 +00:00
settings = {
hide_threads = true;
hide_userland_threads = true;
highlight_base_name = true;
shadow_other_users = true;
show_program_path = false;
tree_view = true;
sort_key = "USER";
};
2019-07-31 21:56:52 +00:00
};
ssh = {
controlMaster = "auto";
controlPersist = "120";
enable = true;
2022-03-08 01:42:46 +00:00
matchBlocks = let
agHost = "fb04217.mathematik.tu-darmstadt.de";
in {
athene.hostname = "192.168.178.22";
git-auto = {
hostname = "hera.m-0.eu";
user = "git";
identityFile = "~/.ssh/id_auto_ed25519";
};
git = {
hostname = "hera.m-0.eu";
user = "git";
};
hera = {
hostname = "hera.m-0.eu";
user = "maralorn";
};
ag-forward = {
hostname = agHost;
proxyJump = "gw";
user = "brandy";
};
ag = {
hostname = agHost;
user = "brandy";
};
gw = {
hostname = "gwres4.mathematik.tu-darmstadt.de";
user = "brandy";
2020-04-26 13:26:41 +00:00
};
2022-03-08 01:42:46 +00:00
shells = {
hostname = "shells.darmstadt.ccc.de";
user = "maralorn";
};
whisky = {
hostname = "whisky.w17.io";
user = "chaos";
};
kitchen = {
hostname = "kitchen.w17.io";
user = "chaos";
};
"door.w17.io".identityFile = "~/.ssh/door_rsa";
};
2019-07-31 21:56:52 +00:00
};
2018-04-02 15:52:16 +00:00
};
2019-07-31 21:56:52 +00:00
home = {
2022-03-08 01:42:46 +00:00
packages =
builtins.attrValues pkgs.home-pkgs
++ [
(
pkgs.writeShellScriptBin "unlock-ssh" ''
SSH_ASKPASS="print-ssh-pw" DISPLAY="a" ssh-add < /dev/null
''
)
(
pkgs.writeShellScriptBin "print-radicle-pw"
2021-04-17 16:12:29 +00:00
"pass show etc/radicle/${config.m-0.hostName}"
2022-03-08 01:42:46 +00:00
)
(
pkgs.writeShellScriptBin "print-ssh-pw"
2021-04-17 16:12:29 +00:00
"pass show eu/m-0/${config.m-0.hostName}.m-0.eu/ssh-key"
2022-03-08 01:42:46 +00:00
)
(
pkgs.writeShellScriptBin "dingdingding" (builtins.readFile ./signal.sh)
)
];
2019-07-31 21:56:52 +00:00
sessionVariables = {
2020-06-09 08:13:32 +00:00
PATH = "$HOME/.nix-profile/bin:$PATH";
2021-07-20 18:16:48 +00:00
BROWSER = "firefox";
2020-10-01 00:32:51 +00:00
EMAIL = "malte.brandy@maralorn.de";
2021-04-17 16:12:29 +00:00
SUDO_ASKPASS = toString (
pkgs.writeShellScript "print-sudo-pw"
2022-03-08 01:42:46 +00:00
"pass show eu/m-0/${config.m-0.hostName}.m-0.eu/${config.home.username}"
2021-04-17 16:12:29 +00:00
);
2019-07-31 21:56:52 +00:00
};
2019-09-14 12:00:41 +00:00
};
2018-04-02 15:52:16 +00:00
2021-07-20 18:17:06 +00:00
systemd.user = {
startServices = true;
2022-03-08 02:19:09 +00:00
inherit (config.home) sessionVariables;
2021-07-20 18:17:06 +00:00
};
2019-09-14 12:00:41 +00:00
2020-06-01 23:58:24 +00:00
services = {
gpg-agent = {
enable = true;
defaultCacheTtl = 31536000; # 1year
maxCacheTtl = 31536000; # 1year
};
};
2021-07-05 18:52:56 +00:00
xdg = {
2021-07-09 12:16:51 +00:00
configFile."mimeapps.list".force = true;
2021-07-05 18:52:56 +00:00
enable = true;
mime.enable = true;
mimeApps = {
enable = true;
defaultApplications = {
2022-03-08 01:42:46 +00:00
"application/pdf" = ["org.gnome.Evince.desktop"];
"x-scheme-handler/http" = ["firefox.desktop"];
"x-scheme-handler/https" = ["firefox.desktop"];
"x-scheme-handler/chrome" = ["firefox.desktop"];
"text/html" = ["firefox.desktop"];
"application/x-extension-htm" = ["firefox.desktop"];
"application/x-extension-html" = ["firefox.desktop"];
"application/x-extension-shtml" = ["firefox.desktop"];
"application/xhtml+xml" = ["firefox.desktop"];
"application/x-extension-xhtml" = ["firefox.desktop"];
"application/x-extension-xht" = ["firefox.desktop"];
2021-07-05 18:52:56 +00:00
};
};
userDirs = {
enable = true;
2021-12-03 16:27:11 +00:00
createDirectories = false;
2021-07-05 18:52:56 +00:00
desktop = "$HOME";
2021-12-03 16:27:11 +00:00
download = "$HOME";
2021-07-05 18:52:56 +00:00
documents = "$HOME/media/documents/aktuell/";
music = "$HOME/media/audio";
pictures = "$HOME/media/images";
videos = "$HOME/media/video";
};
};
2019-09-14 12:00:41 +00:00
}