1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-30 15:09:46 +01:00
home-manager/tests/modules/programs/yazi/nushell-integration-enabled.nix
2023-11-25 16:17:54 +08:00

33 lines
704 B
Nix

{ pkgs, ... }:
let
shellIntegration = ''
def --env ya [] {
let tmp = $"($env.TEMP)(char path_sep)yazi-cwd." + (random chars -l 5)
yazi --cwd-file $tmp
let cwd = (open $tmp)
if $cwd != "" and $cwd != $env.PWD {
cd $cwd
}
rm -f $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}'
'';
}