mirror of
https://github.com/nix-community/home-manager
synced 2024-11-24 03:59:46 +01:00
92a26bf6df
The program shell wrappers have been renamed from `ya` to `yy` following the introduction of the new CLI tool named `ya`. With this in mind, the `shellWrapperName` option has been introduced to provide users with more flexibility in choosing the name they're most accustomed to (ra, lf, ...). Co-authored-by: XYenon <register@xyenon.bid> Co-authored-by: 三咲雅 · Misaki Masa <sxyazi@gmail.com>
27 lines
534 B
Nix
27 lines
534 B
Nix
{ ... }:
|
|
|
|
let
|
|
shellIntegration = ''
|
|
function yy
|
|
set tmp (mktemp -t "yazi-cwd.XXXXX")
|
|
yazi $argv --cwd-file="$tmp"
|
|
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
|
builtin 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}'
|
|
'';
|
|
}
|