1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-15 07:39:46 +01:00
home-manager/tests/modules/programs/yazi/fish-integration-enabled.nix
Ryan beb1e57d60
yazi: pass additional args to ya alias
This allows commands like `ya /etc/nixos` and `ya --help` to be used.
2024-04-10 21:26:55 +02:00

27 lines
526 B
Nix

{ ... }:
let
shellIntegration = ''
function ya
set tmp (mktemp -t "yazi-cwd.XXXXX")
yazi $argv --cwd-file="$tmp"
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
cd -- "$cwd"
end
rm -f -- "$tmp"
end
'';
in {
programs.fish.enable = true;
programs.yazi = {
enable = true;
enableFishIntegration = true;
};
test.stubs.yazi = { };
nmt.script = ''
assertFileContains home-files/.config/fish/config.fish '${shellIntegration}'
'';
}