abdc82d930
This allows commands like `ya /etc/nixos` and `ya --help` to be used.
28 lines
526 B
Nix
28 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}'
|
|
'';
|
|
}
|