From b4f5b5556ff7627a09b73b86a4d07147aead9f9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Str=C3=B6mkvist?= Date: Tue, 31 Oct 2017 18:12:46 +0100 Subject: [PATCH] zsh: Add options for remaining config files `profileExtra`, `loginExtra` and `logoutExtra` for `zprofile`, `zlogin`, and `zlogout` respectively --- modules/programs/zsh.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index d945012c..a088b332 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;