Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zsh: add support for prezto configuration framework #655

Merged
merged 1 commit into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,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 @@ -129,6 +129,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