nix machine / user configurations
1{ 2 config, 3 tlib, 4 lib, 5 pkgs, 6 ... 7}: 8let 9 pkgBin = tlib.pkgBin; 10in 11{ 12 programs.zsh = { 13 enable = true; 14 autocd = true; 15 enableVteIntegration = true; 16 enableAutosuggestions = true; 17 enableCompletion = true; 18 plugins = [ 19 { 20 name = "per-directory-history"; 21 src = pkgs.fetchFromGitHub { 22 owner = "jimhester"; 23 repo = "per-directory-history"; 24 rev = "d2e291dd6434e340d9be0e15e1f5b94f32771c06"; 25 hash = "sha256-VHRgrVCqzILqOes8VXGjSgLek38BFs9eijmp0JHtD5Q="; 26 }; 27 } 28 ]; 29 # configure history 30 history = { 31 extended = true; 32 ignorePatterns = [ 33 "rm *" 34 "mv *" 35 "l" 36 "ls" 37 "ll" 38 "g s" 39 "git status" 40 ]; 41 save = 1000000; 42 size = 1000000; 43 }; 44 # xdg compliant 45 dotDir = ".config/zsh"; 46 history.path = "${config.home.homeDirectory}/.local/share/zsh/history"; 47 # extra stuff for fixing gpg-agent ssh and some random commands 48 initExtra = '' 49 ${lib.optionalString ( 50 config.programs.ssh.enable && config.services.gpg-agent.enable 51 ) "export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)"} 52 53 function tomp4 () { 54 ${pkgBin pkgs.ffmpeg} -i $1 -c:v libx264 -preset slow -crf 30 -c:a aac -b:a 128k "$1.mp4" 55 } 56 57 function topng () { 58 ${pkgBin pkgs.ffmpeg} -i $1 "$1.png" 59 } 60 61 # fix some key stuff 62 bindkey "$terminfo[kRIT5]" forward-word 63 bindkey "$terminfo[kLFT5]" backward-word 64 65 # makes completions pog 66 zstyle ':completion:*' menu select 67 68 # which env we are in 69 ${pkgBin pkgs.any-nix-shell} zsh --info-right | source /dev/stdin 70 ''; 71 }; 72}