mirror of
https://github.com/nix-community/home-manager
synced 2024-11-24 12:09:46 +01:00
90e62f96c7
add module for yazi https://github.com/sxyazi/yazi a terminal rust file browser akin to ranger or joshuto
27 lines
504 B
Nix
27 lines
504 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.bash.enable = true;
|
|
|
|
programs.yazi = {
|
|
enable = true;
|
|
enableBashIntegration = true;
|
|
};
|
|
|
|
test.stubs.yazi = { };
|
|
|
|
nmt.script = ''
|
|
assertFileContains home-files/.bashrc '${shellIntegration}'
|
|
'';
|
|
}
|