1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-01 16:59:43 +01:00
home-manager/tests/modules/programs/yazi/bash-integration-enabled.nix

28 lines
523 B
Nix
Raw Normal View History

{ ... }:
let
shellIntegration = ''
function yy() {
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
builtin cd -- "$cwd"
fi
rm -f -- "$tmp"
}
'';
in {
programs.bash.enable = true;
programs.yazi = {
enable = true;
enableBashIntegration = true;
};
test.stubs.yazi = { };
nmt.script = ''
assertFileContains home-files/.bashrc '${shellIntegration}'
'';
}