1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-10-22 04:57:26 +02:00

fish: make generation of completions optional

Add a config option to optionally disable the generation of command
completions based upon man pages.
This commit is contained in:
Jeffrey C. Ollie 2024-02-05 19:34:52 -06:00 committed by Robert Helgesson
parent 5bb057a7b5
commit 1d9b4a3e60
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED

View file

@ -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.