1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-30 06:59:45 +01:00

zsh/prezto: add package option

Allow setting a custom package for `programs.zsh.prezto`.
This commit is contained in:
Shay Eclipse Kirkegaard Stage 2024-10-07 16:04:29 +02:00
parent 3ac39b2a8b
commit 49d1113a98
No known key found for this signature in database
2 changed files with 8 additions and 6 deletions

View file

@ -665,7 +665,7 @@ in
'' ''
${optionalString cfg.prezto.enable ${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: '' ${concatStrings (map (plugin: ''
if [[ -f "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}" ]]; then if [[ -f "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}" ]]; then

View file

@ -14,6 +14,8 @@ let
options = { options = {
enable = mkEnableOption "prezto"; enable = mkEnableOption "prezto";
package = mkPackageOption pkgs "prezto" { default = "zsh-prezto"; };
caseSensitive = mkOption { caseSensitive = mkOption {
type = types.nullOr types.bool; type = types.nullOr types.bool;
# See <https://github.com/nix-community/home-manager/issues/2255>. # See <https://github.com/nix-community/home-manager/issues/2255>.
@ -379,15 +381,15 @@ in {
}; };
config = mkIf cfg.enable (mkMerge [{ config = mkIf cfg.enable (mkMerge [{
home.file."${relToDotDir ".zprofile"}".text = 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 = 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 = home.file."${relToDotDir ".zlogout"}".text =
builtins.readFile "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zlogout"; builtins.readFile "${cfg.package}/share/zsh-prezto/runcoms/zlogout";
home.packages = with pkgs; [ zsh-prezto ]; home.packages = [ cfg.package ];
home.file."${relToDotDir ".zshenv"}".text = 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 = '' home.file."${relToDotDir ".zpreztorc"}".text = ''
# Generated by Nix # Generated by Nix
${optionalString (cfg.caseSensitive != null) '' ${optionalString (cfg.caseSensitive != null) ''