git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/shells: do not override user-defined shell aliases
commite4e160cc3990584bf3472d8df76d6cb3deb38b47 authorMitsuhiro Nakamura <m.nacamura@gmail.com> dateSat 4 Aug 2018, 17:35 (8 years ago) parent60ae563
2 files changed+7−8
nixos/modules/config/shells-environment.nix+7−2 nixos/modules/programs/shell.nix−6
nixos/modules/config/shells-environment.nix+7−2
@@ -108,14 +108,13 @@ in
108108 };
109109
110110 environment.shellAliases = mkOption {
111− default = {};
112111 example = { ll = "ls -l"; };
113112 description = ''
114113 An attribute set that maps aliases (the top level attribute names in
115114 this option) to command strings or directly to build outputs. The
116115 aliases are added to all users' shells.
117116 '';
118− type = types.attrs; # types.attrsOf types.stringOrPath;
117+ type = with types; attrsOf (either str path);
119118 };
120119
121120 environment.binsh = mkOption {
@@ -157,6 +156,12 @@ in
157156 # terminal instead of logging out of X11).
158157 environment.variables = config.environment.sessionVariables;
159158
159+ environment.shellAliases = mapAttrs (name: mkDefault) {
160+ ls = "ls --color=tty";
161+ ll = "ls -l";
162+ l = "ls -alh";
163+ };
164+
160165 environment.etc."shells".text =
161166 ''
162167 ${concatStringsSep "\n" (map utils.toShellPath cfg.shells)}
nixos/modules/programs/shell.nix−6
@@ -8,12 +8,6 @@ with lib;
88
99 config = {
1010
11− environment.shellAliases =
12− { ls = "ls --color=tty";
13− ll = "ls -l";
14− l = "ls -alh";
15− };
16−
1711 environment.shellInit =
1812 ''
1913 # Set up the per-user profile.