{ pkgs, ... }: let locale = "en_US.UTF-8"; gpgid = "D09299626FA78AF8"; homedir = builtins.getEnv "HOME"; in { home = { packages = import ./packages.nix { inherit pkgs; }; sessionVariables = { GPGID = gpgid; EDITOR = "${pkgs.vim}/bin/vim"; LANG = locale; LANGUAGE = locale; PATH = "${homedir}/bin:${homedir}/.local/bin:$PATH"; PAGER = "${pkgs.bat}/bin/bat"; LEDGER_FILE = "${homedir}/.hledger.journal"; XTERM_LOCALE = locale; PYTHONSTARTUP = "${homedir}/.pythonrc"; }; # From the command line: # setxkbmap -option caps:ctrl_modifier keyboard.options = [ "caps:ctrl_modifier" ]; file = { editorconfig = { source = ./editorconfig; target = ".editorconfig"; }; hledger = { source = builtins.toFile "hledger.journal" '' !include ${homedir}/org/fund/accounts.journal !include ${homedir}/org/fund/2019.10.journal !include ${homedir}/org/fund/prices.journal ''; target = ".hledger.journal"; }; pythonrc = { source = ./pythonrc; target = ".pythonrc"; }; pdbrc = { source = ./pythonrc; target = ".pdbrc"; }; }; }; programs = { home-manager = { enable = true; path = "${homedir}/cfg/home-manager"; }; fzf = { enable = true; enableBashIntegration = true; defaultCommand = "rg --files"; }; tmux = { enable = true; extraConfig = builtins.readFile ./tmux; baseIndex = 0; clock24 = true; customPaneNavigationAndResize = true; keyMode = "emacs"; shortcut = "'C-\\'"; terminal = "xterm-256color"; sensibleOnTop = true; secureSocket = false; }; ssh = { enable = true; forwardAgent = true; matchBlocks = { "github.com" = { hostname = "github.com"; user = "git"; identityFile = [ "${homedir}/.ssh/id_rsa" ]; identitiesOnly = true; }; # groq "groq" = { hostname = "bsima"; # must be on vpn user = "bsima"; identityFile = [ "${homedir}/.ssh/groq" ]; identitiesOnly = true; }; # simatime "sabten" = { hostname = "142.93.81.26"; user = "root"; identityFile = [ "${homedir}/.ssh/id_rsa" ]; identitiesOnly = true; }; "serval.simatime.com" = { hostname = "serval.simatime.com"; user = "ben"; identityFile = [ "${homedir}/.ssh/id_rsa" ]; identitiesOnly = true; }; "simatime.com" = { hostname = "simatime.com"; user = "git"; identityFile = [ "${homedir}/.ssh/id_rsa" ]; identitiesOnly = true; }; "lithium" = { hostname = "192.168.1.9"; user = "ben"; identityFile = [ "${homedir}/.ssh/id_rsa" ]; identitiesOnly = true; }; "dev.simatime.com" = { user = "ben"; identityFile = [ "${homedir}/.ssh/id_rsa" ]; identitiesOnly = true; }; "git.platonic.systems" = { hostname = "git.platonic.systems"; user = "git"; identityFile = [ "${homedir}/.ssh/platonic.systems" ]; identitiesOnly = true; }; }; }; direnv = { enable = true; }; neovim = { enable = true; vimAlias = true; viAlias = true; vimdiffAlias = true; plugins = with pkgs.vimPlugins; [ editorconfig-vim vim-sensible vim-colorschemes ]; extraConfig = builtins.readFile ./vimrc; }; bash = { enable = true; initExtra = '' DIR=~/.nix-profile/etc/profile.d [[ -f "$DIR/nix.sh" ]] && . "$DIR/nix.sh" [[ -f "$DIR/hm-session-vars.sh" ]] && . "$DIR/hm-session-vars.sh" [[ -f "${homedir}/.bashrc.local" ]] && . "${homedir}/.bashrc.local" function cd() { builtin cd "$@" && ls } function up() { N=$1 P=$PWD for (( i=1; i<=$N; i++ )) do P+="/.." done cd "$P" } function ff() { find . -iname "*$@*" -not -path "*.git*" } function regex { gawk 'match($0,/'$1'/, ary) {print ary['\$\{2:-'0'}']}'; } # my prompt, after much chagrin export PS1="\n\[\e[34m\][\u@\h:\w]\[\e[m\] \$(date +%Y.%m.%d..%H.%M) \$(if [ \$? == 0 ]; then true; else echo \(\$?\); fi) \n$ " ''; shellAliases = { add = "git add --ignore-removal"; day = "date +%a"; ddate = "date +%Y.%m.%d"; dday = "date +%A"; e = "emacsclient -nw"; # emacs in a terminal f = "fossil"; fetch = "git fetch"; g = "git"; ga = "git add -A"; gb = "git branch"; gc = "git commit"; gca = "git commit -a"; gco = "git checkout"; gd = "git diff"; gl = "git pull --prune"; glog = ''git log --decorate --all --graph --pretty=format:"%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative''; gp = "git push origin HEAD"; gs = "git status -sb"; hs = "home-manager switch"; ll = "ls -lah"; rm = "rm -i"; showpath = "echo $PATH | sed 's/:/\n/g'"; tdate = "date +%Y.%m.%d..%H.%M"; ttime = "date +%H.%M"; typeless = "history | tail -n 20000 | sed 's/.* //' | sort | uniq -c | sort -g | tail -n 100"; "v." = "vim ."; vk = "vim $(sk -m)"; vs = "vim $(sk -m)"; }; }; emacs = { enable = true; # Disabling for spacemacs #extraPackages = epkgs: import ./emacs-packages.nix { inherit epkgs; }; }; }; }