Skip to content

Commit

Permalink
zsh: add support for prezto configuration framework (nix-community#655)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickHu authored and Malte Voos committed Feb 24, 2021
1 parent b54955c commit c5313f6
Show file tree
Hide file tree
Showing 7 changed files with 573 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@

/modules/programs/zoxide.nix @marsam

/modules/programs/zsh/prezto.nix @NickHu

/modules/services/cbatticon.nix @pmiddend

/modules/services/clipmenu.nix @DamienCassou
Expand Down
8 changes: 8 additions & 0 deletions modules/misc/news.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,14 @@ in
module should be used instead.
'';
}

{
time = "2020-10-12T00:12:23+00:00";
condition = config.programs.zsh.enable;
message = ''
A new zsh submodule is available: 'programs.zsh.prezto'.
'';
}
];
};
}
1 change: 1 addition & 0 deletions modules/modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ let
(loadModule ./programs/zoxide.nix { })
(loadModule ./programs/zplug.nix { })
(loadModule ./programs/zsh.nix { })
(loadModule ./programs/zsh/prezto.nix { })
(loadModule ./services/blueman-applet.nix { })
(loadModule ./services/cbatticon.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/clipmenu.nix { condition = hostPlatform.isLinux; })
Expand Down
7 changes: 5 additions & 2 deletions modules/programs/zsh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,10 @@ in
fpath+="$HOME/${pluginsDir}/${plugin.name}"
'') cfg.plugins)}
# Oh-My-Zsh calls compinit during initialization,
# Oh-My-Zsh/Prezto calls compinit during initialization,
# calling it twice causes sight start up slowdown
# as all $fpath entries will be traversed again.
${optionalString (cfg.enableCompletion && !cfg.oh-my-zsh.enable)
${optionalString (cfg.enableCompletion && !cfg.oh-my-zsh.enable && !cfg.prezto.enable)
"autoload -U compinit && compinit"
}
Expand Down Expand Up @@ -455,6 +455,9 @@ in
source $ZSH/oh-my-zsh.sh
''}
${optionalString cfg.prezto.enable
(builtins.readFile "${pkgs.zsh-prezto}/runcoms/zshrc")}
${concatStrings (map (plugin: ''
if [ -f "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}" ]; then
source "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}"
Expand Down

0 comments on commit c5313f6

Please sign in to comment.