From 1d9b4a3e60398572f4a760bc93f89ebeebbdb3e2 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Mon, 5 Feb 2024 19:34:52 -0600 Subject: [PATCH] fish: make generation of completions optional Add a config option to optionally disable the generation of command completions based upon man pages. --- modules/programs/fish.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 8cd7f9f92..02141042d 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -253,6 +253,12 @@ in { ''; }; + generateCompletions = mkEnableOption + "the automatic generation of completions based upon installed man pages" + // { + default = true; + }; + shellAliases = mkOption { type = with types; attrsOf str; default = { }; @@ -390,9 +396,9 @@ in { }; config = mkIf cfg.enable (mkMerge [ - { - home.packages = [ cfg.package ]; + { home.packages = [ cfg.package ]; } + (mkIf cfg.generateCompletions { # Support completion for `man` by building a cache for `apropos`. programs.man.generateCaches = mkDefault true; @@ -456,7 +462,9 @@ in { set fish_complete_path $prev "${config.xdg.dataHome}/fish/home-manager_generated_completions" $post end ''; + }) + { xdg.configFile."fish/config.fish".source = fishIndent "config.fish" '' # ~/.config/fish/config.fish: DO NOT EDIT -- this file has been generated # automatically by home-manager.