mirror of
https://github.com/nix-community/home-manager
synced 2024-12-19 00:09:48 +01:00
27 lines
515 B
Nix
27 lines
515 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
|
|
cd -- "$cwd"
|
|
fi
|
|
rm -f -- "$tmp"
|
|
}
|
|
'';
|
|
in {
|
|
programs.bash.enable = true;
|
|
|
|
programs.yazi = {
|
|
enable = true;
|
|
enableBashIntegration = true;
|
|
};
|
|
|
|
test.stubs.yazi = { };
|
|
|
|
nmt.script = ''
|
|
assertFileContains home-files/.bashrc '${shellIntegration}'
|
|
'';
|
|
}
|