nixos/programs/fish: add shellAbbrs config
This commit is contained in:
parent
a64b9f2b10
commit
2f6a9bb297
1 changed files with 18 additions and 0 deletions
|
@ -8,6 +8,11 @@ let
|
|||
|
||||
cfg = config.programs.fish;
|
||||
|
||||
fishAbbrs = concatStringsSep "\n" (
|
||||
mapAttrsFlatten (k: v: "abbr -ag ${k} ${escapeShellArg v}")
|
||||
cfg.shellAbbrs
|
||||
);
|
||||
|
||||
fishAliases = concatStringsSep "\n" (
|
||||
mapAttrsFlatten (k: v: "alias ${k} ${escapeShellArg v}")
|
||||
(filterAttrs (k: v: v != null) cfg.shellAliases)
|
||||
|
@ -83,6 +88,18 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
shellAbbrs = mkOption {
|
||||
default = {};
|
||||
example = {
|
||||
gco = "git checkout";
|
||||
npu = "nix-prefetch-url";
|
||||
};
|
||||
description = ''
|
||||
Set of fish abbreviations.
|
||||
'';
|
||||
type = with types; attrsOf str;
|
||||
};
|
||||
|
||||
shellAliases = mkOption {
|
||||
default = {};
|
||||
description = ''
|
||||
|
@ -205,6 +222,7 @@ in
|
|||
# if we haven't sourced the interactive config, do it
|
||||
status --is-interactive; and not set -q __fish_nixos_interactive_config_sourced
|
||||
and begin
|
||||
${fishAbbrs}
|
||||
${fishAliases}
|
||||
|
||||
${sourceEnv "interactiveShellInit"}
|
||||
|
|
Loading…
Reference in a new issue