mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-10 02:36:54 +00:00
Instead of having to manually stub packages that should not be downloaded we instead automatically stub all packages (except a small list of whitelisted ones). Tests can re-introduce the real package by using the `realPkgs` module argument.
31 lines
693 B
Nix
31 lines
693 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.isDarwin && !config.xdg.enable then
|
|
"home-files/Library/Application Support/nushell/config.nu"
|
|
else
|
|
"home-files/.config/nushell/config.nu";
|
|
in ''
|
|
assertFileContains '${configPath}' '${shellIntegration}'
|
|
'';
|
|
}
|