{ config, pkgs, lib, nixosConfig, ... }: with builtins; let inherit (nixosConfig.networking) hostName; host-config = ./machines + "/${hostName}.nix"; h = config.home.homeDirectory; editor-script = pkgs.writeScriptBin "edit" '' #!${pkgs.zsh}/bin/zsh ${config.programs.emacs.package}/bin/emacsclient -t $* ''; in { programs.home-manager.enable = true; imports = [ ./modules ./profiles ] ++ lib.lists.optional (pathExists host-config) host-config; home.username = "jez"; home.stateVersion = "20.09"; home.packages = with pkgs; let python = (python3.withPackages (py: with py; [ ipython sh invoke cookiecutter pyflakes black isort arrow numpy pandas requests httpx furl jupyterlab ])).override (args: { ignoreCollisions = true; }); ghc = haskellPackages.ghcWithPackages (pkgs: [ pkgs.tidal ]); in [ httpie nmap avahi iftop s3cmd dnsutils gnutls inetutils nixfmt ncftp nix-prefetch-git nix-index mercurialFull pijul weechat borgbackup mblaze gnutar gzip bzip2 zstd zip xz p7zip xar yubikey-manager yubioath-desktop yubikey-personalization yubikey-personalization-gui lastpass-cli tor torsocks transmission-gtk unison (aspellWithDicts (dicts: with dicts; [ en en-computers en-science ])) (hunspellWithDicts (with hunspellDicts; [ en_GB-large en_US ])) btop ranger bat toot tut lynx w3m amfora rmapi gmni graphicsmagick qrencode mpc_cli python pipenv pew poetry pandoc graphviz zotero bibtool biber mdbook R gcc_latest sqlite gnumake cmake libtool libvterm rustup go gocode gore gotools gotests gomodifytags nodejs yarn ghc stack cabal-install hlint lazygit lazydocker virt-manager virt-viewer ]; home.sessionVariables = { WORKON_HOME = "${h}/.local/lib/languages/Python/virtualenvs"; RUSTUP_HOME = "${h}/.local/lib/languages/Rust/rustup"; CABAL_CONFIG = "${h}/.config/cabal/config"; CABAL_DIR = "${h}/.local/lib/languages/Haskell/cabal"; GOPATH = "${h}/.local/lib/languages/Go"; EDITOR = editor-script + /bin/edit; ALTERNATE_EDITOR = pkgs.vim + /bin/vim; }; home.file = { ".xprofile".source = ./dotfiles/xprofile; ".Rprofile".source = ./dotfiles/Rprofile; ".terminfo/x/xterm-kitty" = { source = pkgs.kitty + /lib/kitty/terminfo/x/xterm-kitty; recursive = true; }; }; xdg = { enable = true; configFile = { "ranger" = { source = ./dotfiles/ranger; recursive = true; }; "cabal".source = ./dotfiles/cabal; }; }; programs.info.enable = true; programs.man.generateCaches = true; programs.git = { enable = true; aliases = { st = "status"; ci = "commit"; co = "checkout"; h = "help"; a = "add"; d = "diff"; b = "branch"; m = "merge"; l = "log"; }; includes = [{ path = "~/.config/git/local"; }]; ignores = [ "*.pyc" "*.log" "*.aux" "*.lol" "*.out" "*.toc" "*.bcf" "*.bbl" "*.blg" "*.nav" "*.run.xml" "*.snm" "*.fdb_latexmk" "*.fls" "*.vrb" "doc/tags" ".sass-cache" ".sconsign.dblite" ".*.sw[op]" ".DS_Store" "._*" "~$*" ".*.un~" "*~" "\\#*" ".\\#*" "*.bak" ".~lock.*\\#" ".ipynb_checkpoints" ".stfolder" ".vscode" ".envrc" ]; extraConfig = { color.ui = "auto"; push.default = "simple"; pull.rebase = "false"; github.user = "jezcope"; fetch.recurseSubmodules = "true"; init.defaultBranch = "main"; pager.branch = "false"; }; }; programs.gpg = { enable = true; settings = { default-key = "0x9E42CE071C4559D1"; keyserver = "hkps://keys.openpgp.org"; keyserver-options = "no-honor-keyserver-url include-revoked"; }; }; services.gpg-agent = { enable = true; enableScDaemon = true; enableSshSupport = true; defaultCacheTtl = 3600; extraConfig = '' no-allow-external-cache ''; }; programs.gopass = { enable = true; jsonAPI.enable = true; password-store = "${h}/Reference/Passwords"; settings = { safecontent = true; }; }; programs.ssh = { enable = true; matchBlocks = { "remarkable" = { hostname = "10.11.99.1"; user = "root"; }; "git.emacsconf.org" = { port = 22; user = "anon"; identityFile = "~/.ssh/id_rsa_anon_git_emacsconf"; }; }; }; programs.tmux = { enable = true; prefix = "`"; }; services.keybase.enable = true; services.kbfs = { enable = true; mountPoint = "Keybase"; }; services.protonmail-bridge = { enable = true; }; programs.texlive = { enable = true; extraPackages = tpkgs: { inherit (tpkgs) scheme-medium collection-latexextra biblatex; }; }; }