1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 13:39:46 +01:00

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 committed by Nikita Uvarov
parent fa4f9197ee
commit b4f5b5556f
No known key found for this signature in database
GPG key ID: F7A5FB3A7C10EF96

View file

@ -186,6 +186,24 @@ in
description = "Extra commands that should be added to <filename>.zshrc</filename>."; 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 { plugins = mkOption {
type = types.listOf pluginModule; type = types.listOf pluginModule;
default = []; 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) { (mkIf (cfg.dotDir != null) {
programs.zsh.sessionVariables.ZDOTDIR = zdotdir; programs.zsh.sessionVariables.ZDOTDIR = zdotdir;