mirror of
https://github.com/nix-community/home-manager
synced 2024-12-28 20:59:47 +01:00
zsh: add shellGlobalAliases (#1381)
This commit is contained in:
parent
4bd0ca2cd7
commit
e2e8b7371d
1 changed files with 22 additions and 0 deletions
|
@ -18,6 +18,10 @@ let
|
|||
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;
|
||||
|
||||
bindkeyCommands = {
|
||||
|
@ -207,6 +211,21 @@ in
|
|||
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 {
|
||||
default = true;
|
||||
description = ''
|
||||
|
@ -451,6 +470,9 @@ in
|
|||
|
||||
# Aliases
|
||||
${aliasesStr}
|
||||
|
||||
# Global Aliases
|
||||
${globalAliasesStr}
|
||||
'';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue