diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index d945012c0..a088b332a 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -186,6 +186,24 @@ in description = "Extra commands that should be added to .zshrc."; }; + profileExtra = mkOption { + default = ""; + type = types.lines; + description = "Extra commands that should be added to .zprofile."; + }; + + loginExtra = mkOption { + default = ""; + type = types.lines; + description = "Extra commands that should be added to .zlogin."; + }; + + logoutExtra = mkOption { + default = ""; + type = types.lines; + description = "Extra commands that should be added to .zlogout."; + }; + plugins = mkOption { type = types.listOf pluginModule; default = []; @@ -291,6 +309,18 @@ in }; }) + (mkIf (cfg.profileExtra != "") { + home.file."${relToDotDir ".zprofile"}".text = cfg.profileExtra; + }) + + (mkIf (cfg.loginExtra != "") { + home.file."${relToDotDir ".zlogin"}".text = cfg.loginExtra; + }) + + (mkIf (cfg.logoutExtra != "") { + home.file."${relToDotDir ".zlogout"}".text = cfg.logoutExtra; + }) + (mkIf (cfg.dotDir != null) { programs.zsh.sessionVariables.ZDOTDIR = zdotdir;