summary refs log tree commit diff
path: root/nixos/modules/programs
diff options
context:
space:
mode:
authorMitsuhiro Nakamura <m.nacamura@gmail.com>2018-10-12 22:58:35 +0900
committerMitsuhiro Nakamura <m.nacamura@gmail.com>2018-10-14 00:14:49 +0900
commitc941577dcb68ad413853ae744a458555b3209c21 (patch)
treeb40c4d3991e2b9d36ac2c550b2cc410dd9505129 /nixos/modules/programs
parent3b5449b80c1840aeb07322fbd3c37f8a80d11958 (diff)
downloadnixlib-c941577dcb68ad413853ae744a458555b3209c21.tar
nixlib-c941577dcb68ad413853ae744a458555b3209c21.tar.gz
nixlib-c941577dcb68ad413853ae744a458555b3209c21.tar.bz2
nixlib-c941577dcb68ad413853ae744a458555b3209c21.tar.lz
nixlib-c941577dcb68ad413853ae744a458555b3209c21.tar.xz
nixlib-c941577dcb68ad413853ae744a458555b3209c21.tar.zst
nixlib-c941577dcb68ad413853ae744a458555b3209c21.zip
nixos/shells: enable to nullify already defined aliases
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r--nixos/modules/programs/bash/bash.nix5
-rw-r--r--nixos/modules/programs/fish.nix5
-rw-r--r--nixos/modules/programs/zsh/zsh.nix5
3 files changed, 9 insertions, 6 deletions
diff --git a/nixos/modules/programs/bash/bash.nix b/nixos/modules/programs/bash/bash.nix
index aa524a333ee6..0fbc77ea44cf 100644
--- a/nixos/modules/programs/bash/bash.nix
+++ b/nixos/modules/programs/bash/bash.nix
@@ -33,7 +33,8 @@ let
   '';
 
   bashAliases = concatStringsSep "\n" (
-    mapAttrsFlatten (k: v: "alias ${k}=${escapeShellArg v}") cfg.shellAliases
+    mapAttrsFlatten (k: v: "alias ${k}=${escapeShellArg v}")
+      (filterAttrs (k: v: !isNull v) cfg.shellAliases)
   );
 
 in
@@ -64,7 +65,7 @@ in
           Set of aliases for bash shell, which overrides <option>environment.shellAliases</option>.
           See <option>environment.shellAliases</option> for an option format description.
         '';
-        type = with types; attrsOf (either str path);
+        type = with types; attrsOf (nullOr (either str path));
       };
 
       shellInit = mkOption {
diff --git a/nixos/modules/programs/fish.nix b/nixos/modules/programs/fish.nix
index 82af9ecc5611..b38af07b92c3 100644
--- a/nixos/modules/programs/fish.nix
+++ b/nixos/modules/programs/fish.nix
@@ -9,7 +9,8 @@ let
   cfg = config.programs.fish;
 
   fishAliases = concatStringsSep "\n" (
-    mapAttrsFlatten (k: v: "alias ${k} ${escapeShellArg v}") cfg.shellAliases
+    mapAttrsFlatten (k: v: "alias ${k} ${escapeShellArg v}")
+      (filterAttrs (k: v: !isNull v) cfg.shellAliases)
   );
 
 in
@@ -58,7 +59,7 @@ in
           Set of aliases for fish shell, which overrides <option>environment.shellAliases</option>.
           See <option>environment.shellAliases</option> for an option format description.
         '';
-        type = with types; attrsOf (either str path);
+        type = with types; attrsOf (nullOr (either str path));
       };
 
       shellInit = mkOption {
diff --git a/nixos/modules/programs/zsh/zsh.nix b/nixos/modules/programs/zsh/zsh.nix
index 66ca5e5d4eb5..164d8db5859a 100644
--- a/nixos/modules/programs/zsh/zsh.nix
+++ b/nixos/modules/programs/zsh/zsh.nix
@@ -11,7 +11,8 @@ let
   cfg = config.programs.zsh;
 
   zshAliases = concatStringsSep "\n" (
-    mapAttrsFlatten (k: v: "alias ${k}=${escapeShellArg v}") cfg.shellAliases
+    mapAttrsFlatten (k: v: "alias ${k}=${escapeShellArg v}")
+      (filterAttrs (k: v: !isNull v) cfg.shellAliases)
   );
 
 in
@@ -39,7 +40,7 @@ in
           Set of aliases for zsh shell, which overrides <option>environment.shellAliases</option>.
           See <option>environment.shellAliases</option> for an option format description.
         '';
-        type = with types; attrsOf (either str path);
+        type = with types; attrsOf (nullOr (either str path));
       };
 
       shellInit = mkOption {