mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-09 18:41:06 +01:00
The disabled workaround stopped being necessary with fish 4.0, as noted in https://carapace-sh.github.io/carapace-bin/setup.html#fish
24 lines
904 B
Nix
24 lines
904 B
Nix
{ config, lib, realPkgs, ... }:
|
|
|
|
lib.mkIf config.test.enableBig {
|
|
programs = {
|
|
carapace.enable = true;
|
|
fish.enable = true;
|
|
};
|
|
|
|
nixpkgs.overlays = [ (self: super: { inherit (realPkgs) carapace; }) ];
|
|
|
|
nmt.script = let
|
|
needsCompletionOverrides = lib.versionOlder realPkgs.fish.version "4.0.0";
|
|
in ''
|
|
assertFileExists home-files/.config/fish/config.fish
|
|
assertFileRegex home-files/.config/fish/config.fish \
|
|
'/nix/store/.*carapace.*/bin/carapace _carapace fish \| source'
|
|
'' + (lib.optionalString needsCompletionOverrides ''
|
|
# Check whether completions are overridden, necessary for fish < 4.0
|
|
assertFileExists home-files/.config/fish/completions/git.fish
|
|
assertFileContent home-files/.config/fish/completions/git.fish /dev/null
|
|
'') + (lib.optionalString (!needsCompletionOverrides) ''
|
|
assertPathNotExists home-files/.config/fish/completions
|
|
'');
|
|
}
|