mirror of
https://github.com/nix-community/home-manager
synced 2024-11-14 15:19:45 +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
521 B
Nix
27 lines
521 B
Nix
{ ... }:
|
|
|
|
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.zsh.enable = true;
|
|
|
|
programs.yazi = {
|
|
enable = true;
|
|
enableBashIntegration = true;
|
|
};
|
|
|
|
test.stubs.yazi = { };
|
|
|
|
nmt.script = ''
|
|
assertFileContains home-files/.zshrc '${shellIntegration}'
|
|
'';
|
|
}
|