Files
home-manager/tests/modules/programs/atuin/nushell.nix
T
novenaryandAustin Horstman 44a3b79aad fish: ensure generated completions considered last
home-manager's generated completions shadow built-in completion scripts.
fish actually has logic to deal with this when the path ends with
/generated_completions, so let's take advantage of it.

Link: https://github.com/fish-shell/fish-shell/blob/47c773300a40adf66e59e83ca2492f87b7ccb57d/src/autoload.rs#L421-L424
(cherry picked from commit e4e25a8c31)
2025-12-01 12:21:54 -06:00

36 lines
728 B
Nix

{
config,
lib,
pkgs,
realPkgs,
...
}:
{
programs = {
atuin.enable = true;
nushell.enable = true;
};
_module.args.pkgs = lib.mkForce realPkgs;
# Needed to avoid error with dummy fish package.
xdg.dataFile."fish/home-manager/generated_completions".source = lib.mkForce (
builtins.toFile "empty" ""
);
nmt.script =
let
configDir =
if pkgs.stdenv.isDarwin && !config.xdg.enable then
"home-files/Library/Application Support/nushell"
else
"home-files/.config/nushell";
in
''
assertFileExists "${configDir}/config.nu"
assertFileRegex "${configDir}/config.nu" \
'source /nix/store/[^/]*-atuin-nushell-config.nu'
'';
}