mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19: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 {
|
shellAliases = mkOption {
|
||||||
type = with types; attrsOf str;
|
type = with types; attrsOf str;
|
||||||
default = { };
|
default = { };
|
||||||
|
@ -390,9 +396,9 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
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`.
|
# Support completion for `man` by building a cache for `apropos`.
|
||||||
programs.man.generateCaches = mkDefault true;
|
programs.man.generateCaches = mkDefault true;
|
||||||
|
|
||||||
|
@ -456,7 +462,9 @@ in {
|
||||||
set fish_complete_path $prev "${config.xdg.dataHome}/fish/home-manager_generated_completions" $post
|
set fish_complete_path $prev "${config.xdg.dataHome}/fish/home-manager_generated_completions" $post
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
|
})
|
||||||
|
|
||||||
|
{
|
||||||
xdg.configFile."fish/config.fish".source = fishIndent "config.fish" ''
|
xdg.configFile."fish/config.fish".source = fishIndent "config.fish" ''
|
||||||
# ~/.config/fish/config.fish: DO NOT EDIT -- this file has been generated
|
# ~/.config/fish/config.fish: DO NOT EDIT -- this file has been generated
|
||||||
# automatically by home-manager.
|
# automatically by home-manager.
|
||||||
|
|
Loading…
Reference in a new issue