Files
home-manager/tests/modules/programs/yazi/nushell-integration-enabled.nix
K900 0668fdbc15 treewide: stdenv.is* -> stdenv.hostPlatform.is*
Nixpkgs officialy deprecated the former.
2026-08-13 08:40:58 +02:00

36 lines
743 B
Nix

{ pkgs, config, ... }:
let
shellIntegration = ''
def --env yy [...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;
};
nmt.script =
let
configPath =
if pkgs.stdenv.hostPlatform.isDarwin && !config.xdg.enable then
"home-files/Library/Application Support/nushell/config.nu"
else
"home-files/.config/nushell/config.nu";
in
''
assertFileContains '${configPath}' '${shellIntegration}'
'';
}