zsh: add shellGlobalAliases (#1381)
This commit is contained in:
parent
4bd0ca2cd7
commit
e2e8b7371d
|
@ -18,6 +18,10 @@ let
|
||||||
mapAttrsToList (k: v: "alias ${k}=${lib.escapeShellArg v}") cfg.shellAliases
|
mapAttrsToList (k: v: "alias ${k}=${lib.escapeShellArg v}") cfg.shellAliases
|
||||||
);
|
);
|
||||||
|
|
||||||
|
globalAliasesStr = concatStringsSep "\n" (
|
||||||
|
mapAttrsToList (k: v: "alias -g ${k}=${lib.escapeShellArg v}") cfg.shellGlobalAliases
|
||||||
|
);
|
||||||
|
|
||||||
zdotdir = "$HOME/" + cfg.dotDir;
|
zdotdir = "$HOME/" + cfg.dotDir;
|
||||||
|
|
||||||
bindkeyCommands = {
|
bindkeyCommands = {
|
||||||
|
@ -207,6 +211,21 @@ in
|
||||||
type = types.attrsOf types.str;
|
type = types.attrsOf types.str;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
shellGlobalAliases = mkOption {
|
||||||
|
default = {};
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
UUID = "$(uuidgen | tr -d \\n)";
|
||||||
|
G = "| grep";
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Similar to <varname><link linkend="opt-programs.zsh.shellAliases">opt-programs.zsh.shellAliases</link></varname>,
|
||||||
|
but are substituted anywhere on a line.
|
||||||
|
'';
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
};
|
||||||
|
|
||||||
enableCompletion = mkOption {
|
enableCompletion = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -451,6 +470,9 @@ in
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
${aliasesStr}
|
${aliasesStr}
|
||||||
|
|
||||||
|
# Global Aliases
|
||||||
|
${globalAliasesStr}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue