1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-03 05:23:32 +02:00
home-manager/tests/modules/programs/yazi/bash-integration-enabled.nix
Ryan abdc82d930
yazi: pass additional args to ya alias
This allows commands like `ya /etc/nixos` and `ya --help` to be used.
2023-12-16 00:07:57 +01:00

28 lines
509 B
Nix

{ ... }:
let
shellIntegration = ''
function ya() {
tmp="$(mktemp -t "yazi-cwd.XXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
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}'
'';
}