mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 03:29:45 +01: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:
parent
5bb057a7b5
commit
1d9b4a3e60
1 changed files with 10 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue