1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-03 15:41:02 +01:00
home-manager/tests/modules/programs/zsh/siteFunctions-mkcd.nix
Benedikt M. Rips 36ad7d25fb
zsh: option to define autoloadable site-functions (#7611)
Add an option to the Zsh module that allows defining autoloadable site functions.
2025-08-05 14:03:10 -05:00

17 lines
379 B
Nix

let
body = ''
mkdir --parents "$1" && cd "$1"
'';
in
{
programs.zsh = {
enable = true;
siteFunctions.mkcd = body;
};
nmt.script = ''
assertFileExists home-path/share/zsh/site-functions/mkcd
assertFileContent home-path/share/zsh/site-functions/mkcd ${builtins.toFile "mkcd" body}
assertFileContains home-files/.zshrc "autoload -Uz mkcd"
'';
}