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.
38 lines
1,006 B
Nix
38 lines
1,006 B
Nix
{ lib, ... }:
|
|
|
|
let
|
|
fishRegex = ''
|
|
function __fish_command_not_found_handler --on-event fish_command_not_found
|
|
/nix/store/.*command-not-found $argv
|
|
end
|
|
'';
|
|
in {
|
|
programs.bash.enable = true;
|
|
programs.fish.enable = true;
|
|
programs.zsh.enable = true;
|
|
|
|
# Needed to avoid error with dummy fish package.
|
|
xdg.dataFile."fish/home-manager_generated_completions".source =
|
|
lib.mkForce (builtins.toFile "empty" "");
|
|
|
|
programs.nix-index.enable = true;
|
|
|
|
nmt.script = ''
|
|
# Bash integration
|
|
assertFileExists home-files/.bashrc
|
|
assertFileRegex \
|
|
home-files/.bashrc \
|
|
'source @nix-index@/etc/profile.d/command-not-found.sh'
|
|
|
|
# Zsh integration
|
|
assertFileExists home-files/.zshrc
|
|
assertFileRegex \
|
|
home-files/.zshrc \
|
|
'source @nix-index@/etc/profile.d/command-not-found.sh'
|
|
|
|
# Fish integration
|
|
assertFileExists home-files/.config/fish/config.fish
|
|
assertFileRegex \
|
|
home-files/.config/fish/config.fish '${fishRegex}'
|
|
'';
|
|
}
|