diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 9e3c517d2..9b554c491 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -452,7 +452,7 @@ in '') cfg.plugins)} # Oh-My-Zsh/Prezto calls compinit during initialization, - # calling it twice causes sight start up slowdown + # calling it twice causes slight start up slowdown # as all $fpath entries will be traversed again. ${optionalString (cfg.enableCompletion && !cfg.oh-my-zsh.enable && !cfg.prezto.enable) "autoload -U compinit && compinit" @@ -483,7 +483,7 @@ in ''} ${optionalString cfg.prezto.enable - (builtins.readFile "${pkgs.zsh-prezto}/runcoms/zshrc")} + (builtins.readFile "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zshrc")} ${concatStrings (map (plugin: '' if [ -f "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}" ]; then diff --git a/modules/programs/zsh/prezto.nix b/modules/programs/zsh/prezto.nix index 1bd1be584..89a14746c 100644 --- a/modules/programs/zsh/prezto.nix +++ b/modules/programs/zsh/prezto.nix @@ -351,16 +351,16 @@ in { }; }; config = mkIf cfg.enable (mkMerge [{ - home.file."${relToDotDir ".zprofile"}".text = - builtins.readFile "${pkgs.zsh-prezto}/runcoms/zprofile"; - home.file."${relToDotDir ".zlogin"}".text = - builtins.readFile "${pkgs.zsh-prezto}/runcoms/zlogin"; - home.file."${relToDotDir ".zlogout"}".text = - builtins.readFile "${pkgs.zsh-prezto}/runcoms/zlogout"; + home.file."${relToDotDir ".zprofile"}".source = + "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zprofile"; + home.file."${relToDotDir ".zlogin"}".source = + "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zlogin"; + home.file."${relToDotDir ".zlogout"}".source = + "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zlogout"; home.packages = with pkgs; [ zsh-prezto ]; - home.file."${relToDotDir ".zshenv"}".text = - (builtins.readFile "${pkgs.zsh-prezto}/runcoms/zshenv"); + home.file."${relToDotDir ".zshenv"}".source = + "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zshenv"; home.file."${relToDotDir ".zpreztorc"}".text = '' # Generated by Nix ${optionalString (cfg.caseSensitive != null) '' diff --git a/tests/modules/programs/zsh/prezto.nix b/tests/modules/programs/zsh/prezto.nix index cc173bab8..5bc95510d 100644 --- a/tests/modules/programs/zsh/prezto.nix +++ b/tests/modules/programs/zsh/prezto.nix @@ -9,11 +9,11 @@ with lib; nixpkgs.overlays = [ (self: super: { zsh-prezto = super.runCommandLocal "dummy-zsh-prezto" { } '' - mkdir -p $out/runcoms - echo '# zprofile' > $out/runcoms/zprofile - echo '# zlogin' > $out/runcoms/zlogin - echo '# zlogout' > $out/runcoms/zlogout - echo '# zshenv' > $out/runcoms/zshenv + mkdir -p $out/share/zsh-prezto/runcoms + echo '# zprofile' > $out/share/zsh-prezto/runcoms/zprofile + echo '# zlogin' > $out/share/zsh-prezto/runcoms/zlogin + echo '# zlogout' > $out/share/zsh-prezto/runcoms/zlogout + echo '# zshenv' > $out/share/zsh-prezto/runcoms/zshenv ''; }) ];