zsh: Add options for remaining config files

`profileExtra`, `loginExtra` and `logoutExtra` for `zprofile`,
`zlogin`, and `zlogout` respectively
This commit is contained in:
Anton Strömkvist 2017-10-31 18:12:46 +01:00
parent 467b774d13
commit a74fe5d7d2
No known key found for this signature in database
GPG key ID: 50A3573EFBFA9867

View file

@ -186,6 +186,24 @@ in
description = "Extra commands that should be added to <filename>.zshrc</filename>.";
};
profileExtra = mkOption {
default = "";
type = types.lines;
description = "Extra commands that should be added to <filename>.zprofile</filename>.";
};
loginExtra = mkOption {
default = "";
type = types.lines;
description = "Extra commands that should be added to <filename>.zlogin</filename>.";
};
logoutExtra = mkOption {
default = "";
type = types.lines;
description = "Extra commands that should be added to <filename>.zlogout</filename>.";
};
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;