mirror of
https://github.com/nix-community/home-manager
synced 2024-11-08 20:29:43 +01:00
7413408b04
PR #4493
33 lines
672 B
Nix
33 lines
672 B
Nix
{ pkgs, ... }:
|
|
|
|
let
|
|
shellIntegration = ''
|
|
def-env ya [] {
|
|
let tmp = (mktemp -t "yazi-cwd.XXXXX")
|
|
yazi --cwd-file $tmp
|
|
let cwd = (cat -- $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}'
|
|
'';
|
|
}
|