Files
home-manager/tests/modules/programs/fzf/nushell-widget-overrides.nix
T
Austin Horstman a4d410db95 fzf: group related module attributes
Group repeated attr prefixes so the fzf module and new tests are easier to scan without changing behavior.
2026-07-02 15:28:15 -05:00

52 lines
1.2 KiB
Nix

{ config, pkgs, ... }:
{
programs = {
fzf = {
enable = true;
enableNushellIntegration = true;
historyWidget = {
command = "global-history";
nushell.command = "";
};
package = config.lib.test.mkStubPackage {
name = "fzf";
version = "0.73.0";
buildScript = ''
mkdir -p $out/bin
cat > $out/bin/fzf <<'EOF'
#!/bin/sh
echo "Stub fzf"
EOF
chmod +x $out/bin/fzf
'';
};
};
nushell.enable = true;
};
nmt.script =
let
nushellConfigFile =
if pkgs.stdenv.isDarwin && !config.xdg.enable then
"home-files/Library/Application Support/nushell/config.nu"
else
"home-files/.config/nushell/config.nu";
in
''
assertFileExists "${nushellConfigFile}"
assertFileContent "$(normalizeStorePaths "${nushellConfigFile}")" ${builtins.toFile "nushell-fzf-widget-overrides-expected.nu" ''
load-env {
"FZF_CTRL_R_COMMAND": "global-history"
}
$env.FZF_CTRL_R_COMMAND = ""
source /nix/store/00000000000000000000000000000000-nushell-fzf-integration.nu
''}
'';
}