1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-01 06:31:04 +01:00
home-manager/tests/modules/programs/carapace/fish.nix
Austin Horstman cba2f9ce95 treewide: reformat nixfmt-rfc-style
Reformat repository using new nixfmt-rfc-style.
2025-04-08 08:50:05 -07:00

33 lines
952 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
'');
}