mirror of
https://github.com/nix-community/home-manager
synced 2024-12-22 11:03:13 +00:00
e8482a798f
cd conflicts with aliases that dont support -- syntax
27 lines
521 B
Nix
27 lines
521 B
Nix
{ ... }:
|
|
|
|
let
|
|
shellIntegration = ''
|
|
function ya() {
|
|
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}'
|
|
'';
|
|
}
|