tree-wide: init fish completion module

This commit is contained in:
Primrose 2025-11-02 12:25:01 +08:00
parent 006798d917
commit 82baec0470
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
4 changed files with 28 additions and 10 deletions

View file

@ -0,0 +1,22 @@
#
# This module links fish vendor completions, otherwise tab completion would be broken.
#
{
config,
lib,
...
}: let
fishNixOSEnabled = config.programs.fish.enable;
fishHMEnabled =
if config ? home-manager
then lib.any (userConfig: userConfig.programs.fish.enable) (lib.attrValues config.home-manager.users)
else false;
fishEnabled = fishNixOSEnabled || fishHMEnabled;
in {
environment.pathsToLink = lib.mkIf fishEnabled [
"/share/fish/vendor_conf.d"
"/share/fish/vendor_completions.d"
"/share/fish/vendor_functions.d"
];
}

View file

@ -18,12 +18,6 @@
};
users.groups.leana = {};
environment.pathsToLink = [
"/share/fish/vendor_conf.d"
"/share/fish/vendor_completions.d"
"/share/fish/vendor_functions.d"
];
#
# My nix binary cache
#