about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMitsuhiro Nakamura <m.nacamura@gmail.com>2018-08-04 17:35:05 +0900
committerMitsuhiro Nakamura <m.nacamura@gmail.com>2018-10-14 00:13:13 +0900
commite4e160cc3990584bf3472d8df76d6cb3deb38b47 (patch)
tree846b125668d3f70ce1646609e58b87e0cb6824f7 /nixos
parent60ae563293ec956d683e3b9a62dbdef46f71437e (diff)
downloadnixlib-e4e160cc3990584bf3472d8df76d6cb3deb38b47.tar
nixlib-e4e160cc3990584bf3472d8df76d6cb3deb38b47.tar.gz
nixlib-e4e160cc3990584bf3472d8df76d6cb3deb38b47.tar.bz2
nixlib-e4e160cc3990584bf3472d8df76d6cb3deb38b47.tar.lz
nixlib-e4e160cc3990584bf3472d8df76d6cb3deb38b47.tar.xz
nixlib-e4e160cc3990584bf3472d8df76d6cb3deb38b47.tar.zst
nixlib-e4e160cc3990584bf3472d8df76d6cb3deb38b47.zip
nixos/shells: do not override user-defined shell aliases
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/config/shells-environment.nix9
-rw-r--r--nixos/modules/programs/shell.nix6
2 files changed, 7 insertions, 8 deletions
diff --git a/nixos/modules/config/shells-environment.nix b/nixos/modules/config/shells-environment.nix
index 555db459f57a..a279120e125d 100644
--- a/nixos/modules/config/shells-environment.nix
+++ b/nixos/modules/config/shells-environment.nix
@@ -108,14 +108,13 @@ in
     };
 
     environment.shellAliases = mkOption {
-      default = {};
       example = { ll = "ls -l"; };
       description = ''
         An attribute set that maps aliases (the top level attribute names in
         this option) to command strings or directly to build outputs. The
         aliases are added to all users' shells.
       '';
-      type = types.attrs; # types.attrsOf types.stringOrPath;
+      type = with types; attrsOf (either str path);
     };
 
     environment.binsh = mkOption {
@@ -157,6 +156,12 @@ in
     # terminal instead of logging out of X11).
     environment.variables = config.environment.sessionVariables;
 
+    environment.shellAliases = mapAttrs (name: mkDefault) {
+      ls = "ls --color=tty";
+      ll = "ls -l";
+      l  = "ls -alh";
+    };
+
     environment.etc."shells".text =
       ''
         ${concatStringsSep "\n" (map utils.toShellPath cfg.shells)}
diff --git a/nixos/modules/programs/shell.nix b/nixos/modules/programs/shell.nix
index 944a8bdf16fc..6aa0262e3a4c 100644
--- a/nixos/modules/programs/shell.nix
+++ b/nixos/modules/programs/shell.nix
@@ -8,12 +8,6 @@ with lib;
 
   config = {
 
-    environment.shellAliases =
-      { ls = "ls --color=tty";
-        ll = "ls -l";
-        l  = "ls -alh";
-      };
-
     environment.shellInit =
       ''
         # Set up the per-user profile.