Use nix-locate for command-not-found
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
let
|
||||
nix-locate = config.inputs.nix-locate.defaultPackage.${config.currentSystem};
|
||||
in {
|
||||
imports = [
|
||||
./flakes.nix
|
||||
./pia.nix
|
||||
@@ -43,6 +45,7 @@
|
||||
micro
|
||||
helix
|
||||
lm_sensors
|
||||
nix-locate
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
@@ -63,8 +66,25 @@
|
||||
|
||||
nix.gc.automatic = true;
|
||||
|
||||
programs.fish.enable = true;
|
||||
programs.fish.shellInit = ''
|
||||
set fish_greeting
|
||||
'';
|
||||
programs.command-not-found.enable = false;
|
||||
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
|
||||
shellInit = let
|
||||
wrapper = pkgs.writeScript "command-not-found" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
source ${nix-locate}/etc/profile.d/command-not-found.sh
|
||||
command_not_found_handle "$@"
|
||||
'';
|
||||
in ''
|
||||
# use nix-locate for command-not-found functionality
|
||||
function __fish_command_not_found_handler --on-event fish_command_not_found
|
||||
${wrapper} $argv
|
||||
end
|
||||
|
||||
# disable annoying fish shell greeting
|
||||
set fish_greeting
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@ in {
|
||||
|
||||
# pin nixpkgs for system commands such as "nix shell"
|
||||
registry.nixpkgs.flake = config.inputs.nixpkgs;
|
||||
|
||||
# pin system nixpkgs to the same version as the flake input
|
||||
nixPath = [ "nixpkgs=${config.inputs.nixpkgs}" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user