git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/shells: programs.*sh.shellAliases override environment.shellAliases
commit3b5449b80c1840aeb07322fbd3c37f8a80d11958 authorMitsuhiro Nakamura <m.nacamura@gmail.com> dateSat 4 Aug 2018, 12:32 (8 years ago) parente4e160c
3 files changed+17−12
nixos/modules/programs/bash/bash.nix+6−4 nixos/modules/programs/fish.nix+6−4 nixos/modules/programs/zsh/zsh.nix+5−4
nixos/modules/programs/bash/bash.nix+6−4
@@ -59,12 +59,12 @@ in
5959 */
6060
6161 shellAliases = mkOption {
62− default = config.environment.shellAliases;
62+ default = {};
6363 description = ''
64− Set of aliases for bash shell. See <option>environment.shellAliases</option>
65− for an option format description.
64+ Set of aliases for bash shell, which overrides <option>environment.shellAliases</option>.
65+ See <option>environment.shellAliases</option> for an option format description.
6666 '';
67− type = types.attrs; # types.attrsOf types.stringOrPath;
67+ type = with types; attrsOf (either str path);
6868 };
6969
7070 shellInit = mkOption {
@@ -125,6 +125,8 @@ in
125125
126126 programs.bash = {
127127
128+ shellAliases = mapAttrs (name: mkDefault) cfge.shellAliases;
129+
128130 shellInit = ''
129131 if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then
130132 . ${config.system.build.setEnvironment}
nixos/modules/programs/fish.nix+6−4
@@ -53,12 +53,12 @@ in
5353 };
5454
5555 shellAliases = mkOption {
56− default = config.environment.shellAliases;
56+ default = {};
5757 description = ''
58− Set of aliases for fish shell. See <option>environment.shellAliases</option>
59− for an option format description.
58+ Set of aliases for fish shell, which overrides <option>environment.shellAliases</option>.
59+ See <option>environment.shellAliases</option> for an option format description.
6060 '';
61− type = types.attrs;
61+ type = with types; attrsOf (either str path);
6262 };
6363
6464 shellInit = mkOption {
@@ -99,6 +99,8 @@ in
9999
100100 config = mkIf cfg.enable {
101101
102+ programs.fish.shellAliases = mapAttrs (name: mkDefault) cfge.shellAliases;
103+
102104 environment.etc."fish/foreign-env/shellInit".text = cfge.shellInit;
103105 environment.etc."fish/foreign-env/loginShellInit".text = cfge.loginShellInit;
104106 environment.etc."fish/foreign-env/interactiveShellInit".text = cfge.interactiveShellInit;
nixos/modules/programs/zsh/zsh.nix+5−4
@@ -34,13 +34,12 @@ in
3434 };
3535
3636 shellAliases = mkOption {
37− default = config.environment.shellAliases;
37+ default = {};
3838 description = ''
39− Set of aliases for zsh shell. Overrides the default value taken from
40− <option>environment.shellAliases</option>.
39+ Set of aliases for zsh shell, which overrides <option>environment.shellAliases</option>.
4140 See <option>environment.shellAliases</option> for an option format description.
4241 '';
43− type = types.attrs; # types.attrsOf types.stringOrPath;
42+ type = with types; attrsOf (either str path);
4443 };
4544
4645 shellInit = mkOption {
@@ -106,6 +105,8 @@ in
106105
107106 config = mkIf cfg.enable {
108107
108+ programs.zsh.shellAliases = mapAttrs (name: mkDefault) cfge.shellAliases;
109+
109110 environment.etc."zshenv".text =
110111 ''
111112 # /etc/zshenv: DO NOT EDIT -- this file has been generated automatically.