Mikołaj Lercher
2025-11-25 14:04:20 +01:00
committed by GitHub
parent 381f4f8a3a
commit 295d90e22d
3 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
{ config, ... }:
{
time = "2025-11-25T11:33:50+00:00";
condition = config.programs.nix-index.enable && config.programs.nushell.enable;
message = ''
The nix-index module now adds a command-not-found handler to Nushell by default.
This can be disabled:
programs.nix-index.enableNushellIntegration = false;
'';
}

View File

@@ -23,6 +23,8 @@ in
enableFishIntegration = lib.hm.shell.mkFishIntegrationOption { inherit config; };
enableZshIntegration = lib.hm.shell.mkZshIntegrationOption { inherit config; };
enableNushellIntegration = lib.hm.shell.mkNushellIntegrationOption { inherit config; };
};
config = lib.mkIf cfg.enable {
@@ -65,5 +67,9 @@ in
${wrapper} $argv
end
'';
programs.nushell.settings.hooks.command_not_found = lib.mkIf cfg.enableNushellIntegration (
lib.hm.nushell.mkNushellInline "source ${cfg.package}/etc/profile.d/command-not-found.nu"
);
};
}

View File

@@ -11,6 +11,7 @@ in
programs.bash.enable = true;
programs.fish.enable = true;
programs.zsh.enable = true;
programs.nushell.enable = true;
# Needed to avoid error with dummy fish package.
xdg.dataFile."fish/home-manager_generated_completions".source = lib.mkForce (
@@ -36,5 +37,11 @@ in
assertFileExists home-files/.config/fish/config.fish
assertFileRegex \
home-files/.config/fish/config.fish '${fishRegex}'
# Nushell integration
assertFileExists home-files/.config/nushell/config.nu
assertFileContains \
home-files/.config/nushell/config.nu \
'$env.config.hooks.command_not_found = (source @nix-index@/etc/profile.d/command-not-found.nu)'
'';
}