diff options
Diffstat (limited to 'home/home.nix')
-rw-r--r-- | home/home.nix | 265 |
1 files changed, 265 insertions, 0 deletions
diff --git a/home/home.nix b/home/home.nix new file mode 100644 index 0000000..f2a0f7e --- /dev/null +++ b/home/home.nix @@ -0,0 +1,265 @@ +{ config, pkgs, inputs, ... }: + +{ + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + + imports = [ + ./packages.nix + ./unstable.nix + ]; + + home.keyboard.options = [ "caps:escape" ]; + + programs.msmtp.enable = true; + programs.mbsync.enable = true; + programs.mu.enable = true; + + accounts.email = { + accounts.hacc = { + address = "stuebinm@hacc.space"; + imap.host = "mail.hacc.space"; + mbsync = { + enable = true; + create = "maildir"; + }; + msmtp.enable = true; + mu.enable = true; + primary = true; + realName = "stuebinm"; + smtp.host = "mail.hacc.space"; + userName = "stuebinm@hacc.space"; + passwordCommand = "cat ~/mailpasswd"; + }; + }; + + programs.bash = { + enable = true; + historyControl = [ "ignoredups" "ignorespace" ]; + historyFileSize = 10000; + + # set shell prompt & tty for the gnu pinentry (otherwise gnupg will crash) + initExtra = '' + export GPG_TTY=`tty` + # this shouldn't be necessary, but apparently nix is broken ... + NIX_PATH=$HOME/.nix-defexpr/channels''${NIX_PATH:+:}$NIX_PATH + PS1='\[\033[1;36m\] >>> [\j|\u@\w]\$: \[\033[00m\]' + ''; + + shellAliases = { + "lrz-vpn" = "sudo openconnect https://asa-cluster.lrz.de -g AnyConnect"; + ll = "ls -slF"; + news = "newsboat"; + pj = "pijul"; + }; + }; + + programs.starship = { + enable = true; + enableBashIntegration = true; + enableFishIntegration = true; + settings = { + directory.truncation_length = 10; + }; + }; + + programs.nushell = { + enable = true; + settings = { + startup = [ + "mkdir ~/.cache/starship" + "starship init nu | save ~/.cache/starship/init.nu" + "source ~/.cache/starship/init.nu" + ]; + prompt = "starship_prompt"; + }; + }; + + programs.fish = { + enable = true; + shellAliases = { + "lrz-vpn" = "sudo openconnect https://asa-cluster.lrz.de"; + news = "newsboat"; + pj = "pijul"; + nix-shell = "nix-shell --command fish"; + le = "exa"; + ll = "exa -lh --grid --icons"; + llt = "exa -lh --tree --icons"; + lt = "exa --tree --icons"; + }; + functions = { + fish_greeting = { + body = ""; + }; + }; + }; + + programs.newsboat = { + enable = true; + urls = (import ./newsboat-public.nix) ++ (import inputs.feeds); + browser = pkgs.lynx.outPath + "/bin/lynx"; + reloadThreads = 100; + queries = { + unread = ''unread="yes"''; + security = ''tags # "security"''; + ao3 = ''tags # "ao3"''; + blogs = ''unread="yes" and tags # "blog"''; + video = ''tags # "video"''; + podcasts = ''tags # "podcast"''; + news = ''tags # "news"''; + }; + extraConfig = '' + color background white default + color listnormal white default + color listnormal_unread magenta default bold + color listfocus black white bold + color listfocus_unread magenta white bold + color info green color0 + color article white default + + ssl-verifypeer no + + macro v set browser "mpv %u >/dev/null 2>&1 &" ; open-in-browser ; set browser "${config.programs.newsboat.browser} %u" + macro f set browser "${pkgs.xdg_utils}/bin/xdg-open %u >/dev/null 2>&1 &" ; open-in-browser ; set browser "${config.programs.newsboat.browser} %u" + + bind-key j down + bind-key k up + ''; + }; + + + programs.bat = { + enable = true; + config.wrap = "never"; + }; + + + programs.obs-studio = { + enable = true; + plugins = let + move-transition = import obs/move-transition.nix; + obs-websocket = import obs/obs-websocket.nix; + in + with pkgs; [ + ]; + }; + + programs.git = { + enable = true; + package = pkgs.gitAndTools.gitFull; + userEmail = "stuebinm@disroot.org"; + userName = "stuebinm"; + + signing = { + # signByDefault = true; + key = "0x8FBE8AAD32FA12B7"; + }; + + extraConfig = { + log.showSignature = true; + init.defaultBranch = "main"; + }; + + delta = { + enable = true; + options = { + decorations = { + commit-decoration-style = "bold yellow"; + file-decoration-style = "bold blue"; + file-style = "bold yellow"; + }; + features = "decorations line-numbers navigate"; + whitespace-error-style = "22 reverse"; + }; + }; + }; + + programs.gpg = { + enable = true; + settings = { + auto-key-locate = "keyserver"; + with-fingerprint = ""; + }; + }; + services.gpg-agent = { + enable = true; + pinentryFlavor = "gtk2"; + maxCacheTtl = 1800; + }; + + + programs.htop = { + enable = true; + settings = { + fields = "0 48 17 18 38 46 47 49 1"; + sort_key = 46; + sort_direction = -1; + hide_kernel_threads = 1; + hide_userland_threads = 0; + shadow_other_users = 1; + show_program_path = 0; + highlight_base_name = 1; + find_comm_in_cmdline = 1; + header_margin = 1; + show_cpu_usage = 1; + color_scheme = 5; + enable_mouse = 1; + delay = 15; + header_layout = "two_67_33"; + column_meters_0 = "AllCPUs Memory Swap"; + column_meter_modes_0 = "1 1 1"; + column_meters_1 = "Tasks LoadAverage Uptime NetworkIO"; + column_meter_modes_1 = "2 2 2 2"; + }; + }; + + programs.ssh = { + forwardAgent = true; + enable = true; + matchBlocks = let + keydir = config.home.homeDirectory + "/.ssh"; + hetznerlogin = match: {user = "root"; identityFile = keydir + "/hetzner"; forwardAgent = true;} // match; + vpslogin = hostname: hetznerlogin {inherit hostname;}; + lmulogin = hostname: {identityFile = keydir + "/key_lmu"; user = "lmu-user"; } // { inherit hostname;}; + in { + "parsons" = hetznerlogin { + hostname = "parsons.hacc.space"; + port = 62954; + user = "stuebinm"; + identityFile = keydir + "/id_rsa"; + }; + "discuss" = hetznerlogin { + user = "root"; + hostname = "23.88.58.86"; + port = 62954; + identityFile = keydir + "/id_rsa"; + }; + "flora" = vpslogin "nix.stuebinm.eu"; + "chaski" = vpslogin "chaski.stuebinm.eu"; + "cgit" = vpslogin "flora.stuebinm.eu" // {user = "git";}; + "mate" = { + hostname = "192.168.69.174"; + user = "root"; + identityFile = keydir + "/hetzner"; + }; + "lmucast-test" = lmulogin "lmzveun-h5base.srv.mwn.de"; + "lmucast-prod" = lmulogin "lmzveun-pro-h5base.srv.mwn.de"; + "lmu-salsa" = { + hostname = "lmzveun-salsa.srv.mwn.de"; + user = "ra72koc"; + identityFile = keydir + "/key_lmu"; + }; + }; + }; + + programs.mpv = { + enable = true; + bindings = { + "up" = "add speed 0.1"; + "down" = "add speed -0.1"; + "n" = "add chapter 1"; + "p" = "add chapter -1"; + }; + }; + +} |