default.nix (1508B)
1 { 2 lib, 3 pkgs, 4 ... 5 }: 6 { 7 config = { 8 users = { 9 defaultUserShell = pkgs.zsh; 10 users.root.shell = pkgs.zsh; 11 }; 12 13 environment.systemPackages = [ pkgs.fzf ]; 14 15 programs = { 16 # Use this and remove other fzf-related config if this is made to work together with 17 # zsh-vi-mode (currently breaks ^r binding): 18 # fzf.keybindings = true; 19 # fzf.fuzzyCompletion = true; 20 git.enable = true; 21 direnv.enable = true; 22 }; 23 24 programs.zsh = { 25 enable = true; 26 27 shellInit = '' 28 # Silence new user configuration prompt 29 zsh-newuser-install() { :; } 30 ''; 31 32 interactiveShellInit = '' 33 zvm_after_init() { 34 source <(fzf --zsh) 35 } 36 source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh 37 ZSH_AUTOSUGGEST_STRATEGY=(history completion) 38 ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=200 39 ZSH_AUTOSUGGEST_HISTORY_IGNORE="?(#c200,)" 40 source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh 41 source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 42 ''; 43 44 promptInit = '' 45 source ${pkgs.liquidprompt}/bin/liquidprompt 46 ''; 47 48 shellAliases = { 49 ls = "ls --color=auto --group-directories-first"; 50 }; 51 }; 52 53 environment.etc."liquidpromptrc".source = ./liquidpromptrc; 54 55 home-manager.sharedModules = lib.singleton { 56 programs.zsh.enable = true; 57 }; 58 }; 59 }