zsh/prezto: add package option (#5938)

Allow setting a custom package for `programs.zsh.prezto`.
This commit is contained in:
Shay Eclipse K. Stage 2025-01-09 12:04:34 +01:00 committed by GitHub
parent 7e00856596
commit 01f40d52d6
Failed to generate hash of commit
2 changed files with 8 additions and 6 deletions

View file

@ -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

View file

@ -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>.
@ -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) ''