@@ -9,7 +9,8 @@ let
99 cfg = config.programs.fish;
1010
1111 fishAliases = concatStringsSep "\n" (
12− mapAttrsFlatten (k: v: "alias ${k} ${escapeShellArg v}") cfg.shellAliases
12+ mapAttrsFlatten (k: v: "alias ${k} ${escapeShellArg v}")
13+ (filterAttrs (k: v: !isNull v) cfg.shellAliases)
1314 );
1415
1516in
@@ -53,12 +54,12 @@ in
5354 };
5455
5556 shellAliases = mkOption {
56− default = config.environment.shellAliases;
57+ default = {};
5758 description = ''
58− Set of aliases for fish shell. See <option>environment.shellAliases</option>
59− for an option format description.
59+ Set of aliases for fish shell, which overrides <option>environment.shellAliases</option>.
60+ See <option>environment.shellAliases</option> for an option format description.
6061 '';
61− type = types.attrs;
62+ type = with types; attrsOf (nullOr (either str path));
6263 };
6364
6465 shellInit = mkOption {
@@ -99,6 +100,8 @@ in
99100
100101 config = mkIf cfg.enable {
101102
103+ programs.fish.shellAliases = mapAttrs (name: mkDefault) cfge.shellAliases;
104+
102105 environment.etc."fish/foreign-env/shellInit".text = cfge.shellInit;
103106 environment.etc."fish/foreign-env/loginShellInit".text = cfge.loginShellInit;
104107 environment.etc."fish/foreign-env/interactiveShellInit".text = cfge.interactiveShellInit;