mirror of
https://github.com/nix-community/home-manager
synced 2024-12-27 04:09:47 +01:00
33 lines
689 B
Nix
33 lines
689 B
Nix
{ pkgs, ... }:
|
|
|
|
let
|
|
shellIntegration = ''
|
|
def --env ya [...args] {
|
|
let tmp = (mktemp -t "yazi-cwd.XXXXX")
|
|
yazi ...$args --cwd-file $tmp
|
|
let cwd = (open $tmp)
|
|
if $cwd != "" and $cwd != $env.PWD {
|
|
cd $cwd
|
|
}
|
|
rm -fp $tmp
|
|
}
|
|
'';
|
|
in {
|
|
programs.nushell.enable = true;
|
|
|
|
programs.yazi = {
|
|
enable = true;
|
|
enableNushellIntegration = true;
|
|
};
|
|
|
|
test.stubs.yazi = { };
|
|
|
|
nmt.script = let
|
|
configPath = if pkgs.stdenv.isDarwin then
|
|
"home-files/Library/Application Support/nushell/config.nu"
|
|
else
|
|
"home-files/.config/nushell/config.nu";
|
|
in ''
|
|
assertFileContains '${configPath}' '${shellIntegration}'
|
|
'';
|
|
}
|