mirror of
https://github.com/nix-community/home-manager
synced 2024-11-06 03:09:45 +01:00
28 lines
502 B
Nix
28 lines
502 B
Nix
|
{ ... }:
|
||
|
|
||
|
let
|
||
|
shellIntegration = ''
|
||
|
function ya() {
|
||
|
tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||
|
yazi --cwd-file="$tmp"
|
||
|
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||
|
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}'
|
||
|
'';
|
||
|
}
|