diff --git a/nixos/modules/programs/bash/bash.nix b/nixos/modules/programs/bash/bash.nix
index f664e222555..aa524a333ee 100644
--- a/nixos/modules/programs/bash/bash.nix
+++ b/nixos/modules/programs/bash/bash.nix
@@ -59,12 +59,12 @@ in
*/
shellAliases = mkOption {
- default = config.environment.shellAliases;
+ default = {};
description = ''
- Set of aliases for bash shell. See
- for an option format description.
+ Set of aliases for bash shell, which overrides .
+ See for an option format description.
'';
- type = types.attrs; # types.attrsOf types.stringOrPath;
+ type = with types; attrsOf (either str path);
};
shellInit = mkOption {
@@ -125,6 +125,8 @@ in
programs.bash = {
+ shellAliases = mapAttrs (name: mkDefault) cfge.shellAliases;
+
shellInit = ''
if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then
. ${config.system.build.setEnvironment}
diff --git a/nixos/modules/programs/fish.nix b/nixos/modules/programs/fish.nix
index 5948fe11f92..82af9ecc561 100644
--- a/nixos/modules/programs/fish.nix
+++ b/nixos/modules/programs/fish.nix
@@ -53,12 +53,12 @@ in
};
shellAliases = mkOption {
- default = config.environment.shellAliases;
+ default = {};
description = ''
- Set of aliases for fish shell. See
- for an option format description.
+ Set of aliases for fish shell, which overrides .
+ See for an option format description.
'';
- type = types.attrs;
+ type = with types; attrsOf (either str path);
};
shellInit = mkOption {
@@ -99,6 +99,8 @@ in
config = mkIf cfg.enable {
+ programs.fish.shellAliases = mapAttrs (name: mkDefault) cfge.shellAliases;
+
environment.etc."fish/foreign-env/shellInit".text = cfge.shellInit;
environment.etc."fish/foreign-env/loginShellInit".text = cfge.loginShellInit;
environment.etc."fish/foreign-env/interactiveShellInit".text = cfge.interactiveShellInit;
diff --git a/nixos/modules/programs/zsh/zsh.nix b/nixos/modules/programs/zsh/zsh.nix
index 865d148c162..66ca5e5d4eb 100644
--- a/nixos/modules/programs/zsh/zsh.nix
+++ b/nixos/modules/programs/zsh/zsh.nix
@@ -34,13 +34,12 @@ in
};
shellAliases = mkOption {
- default = config.environment.shellAliases;
+ default = {};
description = ''
- Set of aliases for zsh shell. Overrides the default value taken from
- .
+ Set of aliases for zsh shell, which overrides .
See for an option format description.
'';
- type = types.attrs; # types.attrsOf types.stringOrPath;
+ type = with types; attrsOf (either str path);
};
shellInit = mkOption {
@@ -106,6 +105,8 @@ in
config = mkIf cfg.enable {
+ programs.zsh.shellAliases = mapAttrs (name: mkDefault) cfge.shellAliases;
+
environment.etc."zshenv".text =
''
# /etc/zshenv: DO NOT EDIT -- this file has been generated automatically.