summaryrefslogtreecommitdiff
path: root/user-profiles/zsh/default.nix
blob: 88873c1ac20467bf2e7f368b0a630aa05dde60b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ userName, pkgs, customUtils, lib, config, ... }:
let
  dotDir = ".config/zsh";
  p10kZsh = "${dotDir}/.p10k.zsh";
  cfg = config.home-manager.users.${userName};
in {
  home-manager.users.${userName} = {
    programs.zsh = {
      inherit dotDir;
      enable = true;
      autocd = true;
      enableCompletion = true;
      
      plugins = [
        { name = "powerlevel10k";
          file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
          src = pkgs.zsh-powerlevel10k;
        }
      ];
      initExtraBeforeCompInit = ''
        source "${cfg.home.homeDirectory}/${p10kZsh}"
      '';
      initExtra = lib.mkAfter ''
        source ${./zshrc}
        source "${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
      '';
    };

    home.file.${p10kZsh}.source = ./p10k.zsh;
  };
}