From 77c47a454236cede268990eb3e457f062014f414 Mon Sep 17 00:00:00 2001 From: carschandler <92899389+carschandler@users.noreply.github.com> Date: Tue, 17 Feb 2026 15:05:52 -0600 Subject: [PATCH] carapace: `ignoreCase` option for case-insensitive completion Add option for case-insensitive matching in carapace completions. --- modules/programs/carapace.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/modules/programs/carapace.nix b/modules/programs/carapace.nix index fefa72cc..7e0556f7 100644 --- a/modules/programs/carapace.nix +++ b/modules/programs/carapace.nix @@ -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 = {