1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00
home-manager/tests/modules/programs/yazi/zsh-integration-enabled.nix
Austin Horstman aa6936bb63 tests/yazi: fix bash/zsh integration tests
Didn't fail even with incorrect assertion. Multi line string for
assertFileContains didn't properly work. Don't want to manage an entire
zsh config file in assertFileContent so just multi step asserting the
generated file.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-11-03 21:54:12 -06:00

18 lines
624 B
Nix

{
programs.zsh.enable = true;
programs.yazi = {
enable = true;
enableZshIntegration = true;
};
nmt.script = ''
assertFileExists home-files/.zshrc
assertFileContains home-files/.zshrc 'function yy() {'
assertFileContains home-files/.zshrc 'local tmp="$(mktemp -t "yazi-cwd.XXXXX")"'
assertFileContains home-files/.zshrc 'yazi "$@" --cwd-file="$tmp"'
assertFileContains home-files/.zshrc 'if cwd="$(<"$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then'
assertFileContains home-files/.zshrc 'builtin cd -- "$cwd"'
assertFileContains home-files/.zshrc 'rm -f -- "$tmp"'
'';
}