1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-01 00:39:45 +01:00

zsh: Add dirHashes option

This commit is contained in:
Ashish SHUKLA 2020-10-27 17:16:26 +05:30 committed by Robert Helgesson
parent 9fe15dc83b
commit 9e01441c5c
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -22,6 +22,10 @@ let
mapAttrsToList (k: v: "alias -g ${k}=${lib.escapeShellArg v}") cfg.shellGlobalAliases mapAttrsToList (k: v: "alias -g ${k}=${lib.escapeShellArg v}") cfg.shellGlobalAliases
); );
dirHashesStr = concatStringsSep "\n" (
mapAttrsToList (k: v: ''hash -d ${k}="${v}"'') cfg.dirHashes
);
zdotdir = "$HOME/" + cfg.dotDir; zdotdir = "$HOME/" + cfg.dotDir;
bindkeyCommands = { bindkeyCommands = {
@ -234,6 +238,21 @@ in
type = types.attrsOf types.str; type = types.attrsOf types.str;
}; };
dirHashes = mkOption {
default = {};
example = literalExample ''
{
docs = "$HOME/Documents";
vids = "$HOME/Videos";
dl = "$HOME/Downloads";
}
'';
description = ''
An attribute set that adds to named directory hash table.
'';
type = types.attrsOf types.str;
};
enableCompletion = mkOption { enableCompletion = mkOption {
default = true; default = true;
description = '' description = ''
@ -488,6 +507,9 @@ in
# Global Aliases # Global Aliases
${globalAliasesStr} ${globalAliasesStr}
# Named Directory Hashes
${dirHashesStr}
''; '';
} }