.files/nix/nixosModules/common/fish.nix
Léana 江 ebf8468807
tree-wide: format with nixfmt
Another saturday another useless formatter change.
It's my dotfiles, after all

alejandra doesn't handle c-style inline comments well.
2025-11-08 10:15:58 +08:00

25 lines
573 B
Nix

#
# 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"
];
}