Skip to content

Commit

Permalink
zsh/prezto: add package option (#5938)
Browse files Browse the repository at this point in the history
Allow setting a custom package for `programs.zsh.prezto`.
  • Loading branch information
ShayKStage authored Jan 9, 2025
1 parent 7e00856 commit 01f40d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/programs/zsh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ in

''
${optionalString cfg.prezto.enable
(builtins.readFile "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zshrc")}
(builtins.readFile "${cfg.prezto.package}/share/zsh-prezto/runcoms/zshrc")}
${concatStrings (map (plugin: ''
if [[ -f "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}" ]]; then
Expand Down
12 changes: 7 additions & 5 deletions modules/programs/zsh/prezto.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ let
options = {
enable = mkEnableOption "prezto";

package = mkPackageOption pkgs "prezto" { default = "zsh-prezto"; };

caseSensitive = mkOption {
type = types.nullOr types.bool;
# See <https://github.com/nix-community/home-manager/issues/2255>.
Expand Down Expand Up @@ -379,15 +381,15 @@ in {
};
config = mkIf cfg.enable (mkMerge [{
home.file."${relToDotDir ".zprofile"}".text =
builtins.readFile "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zprofile";
builtins.readFile "${cfg.package}/share/zsh-prezto/runcoms/zprofile";
home.file."${relToDotDir ".zlogin"}".text =
builtins.readFile "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zlogin";
builtins.readFile "${cfg.package}/share/zsh-prezto/runcoms/zlogin";
home.file."${relToDotDir ".zlogout"}".text =
builtins.readFile "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zlogout";
home.packages = with pkgs; [ zsh-prezto ];
builtins.readFile "${cfg.package}/share/zsh-prezto/runcoms/zlogout";
home.packages = [ cfg.package ];

home.file."${relToDotDir ".zshenv"}".text =
builtins.readFile "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zshenv";
builtins.readFile "${cfg.package}/share/zsh-prezto/runcoms/zshenv";
home.file."${relToDotDir ".zpreztorc"}".text = ''
# Generated by Nix
${optionalString (cfg.caseSensitive != null) ''
Expand Down

0 comments on commit 01f40d5

Please sign in to comment.