carapace: ignoreCase option for case-insensitive completion
Add option for case-insensitive matching in carapace completions.
This commit is contained in:
parent
4ebb171bc5
commit
77c47a4542
1 changed files with 23 additions and 0 deletions
|
|
@ -27,9 +27,32 @@ in
|
|||
enableNushellIntegration = lib.hm.shell.mkNushellIntegrationOption { inherit config; };
|
||||
|
||||
enableZshIntegration = lib.hm.shell.mkZshIntegrationOption { inherit config; };
|
||||
|
||||
ignoreCase = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to enable case-insensitive matching for carapace completions.
|
||||
When enabled, the carapace binary is wrapped with {env}`CARAPACE_MATCH`
|
||||
set to `1`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.carapace.package = lib.mkIf cfg.ignoreCase (
|
||||
pkgs.symlinkJoin {
|
||||
name = "carapace-wrapped";
|
||||
paths = [ pkgs.carapace ];
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/carapace \
|
||||
--set CARAPACE_MATCH 1
|
||||
'';
|
||||
meta.mainProgram = "carapace";
|
||||
}
|
||||
);
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
programs = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue