@@ -8,6 +8,11 @@ let
88
99 cfg = config.programs.fish;
1010
11+ fishAbbrs = concatStringsSep "\n" (
12+ mapAttrsFlatten (k: v: "abbr -ag ${k} ${escapeShellArg v}")
13+ cfg.shellAbbrs
14+ );
15+
1116 fishAliases = concatStringsSep "\n" (
1217 mapAttrsFlatten (k: v: "alias ${k} ${escapeShellArg v}")
1318 (filterAttrs (k: v: v != null) cfg.shellAliases)
@@ -83,6 +88,18 @@ in
8388 '';
8489 };
8590
91+ shellAbbrs = mkOption {
92+ default = {};
93+ example = {
94+ gco = "git checkout";
95+ npu = "nix-prefetch-url";
96+ };
97+ description = ''
98+ Set of fish abbreviations.
99+ '';
100+ type = with types; attrsOf str;
101+ };
102+
86103 shellAliases = mkOption {
87104 default = {};
88105 description = ''
@@ -205,6 +222,7 @@ in
205222 # if we haven't sourced the interactive config, do it
206223 status --is-interactive; and not set -q __fish_nixos_interactive_config_sourced
207224 and begin
225+ ${fishAbbrs}
208226 ${fishAliases}
209227
210228 ${sourceEnv "interactiveShellInit"}