mirror of
https://github.com/nix-community/home-manager
synced 2024-11-13 06:39:44 +01:00
fish: query pname and version for completions
Query the `pname` and `version` attributes for completion generation, if the `name` attribute is not available. Fixes #2813
This commit is contained in:
parent
5ca19629fd
commit
5f34ca8c64
1 changed files with 23 additions and 18 deletions
|
@ -320,8 +320,13 @@ in {
|
|||
${postBuild}
|
||||
'';
|
||||
|
||||
generateCompletions = package:
|
||||
pkgs.runCommand "${package.name}-fish-completions" {
|
||||
generateCompletions = let
|
||||
getName = attrs:
|
||||
attrs.name or "${attrs.pname or "«pname-missing»"}-${
|
||||
attrs.version or "«version-missing»"
|
||||
}";
|
||||
in package:
|
||||
pkgs.runCommand "${getName package}-fish-completions" {
|
||||
srcs = [ package ] ++ filter (p: p != null)
|
||||
(builtins.map (outName: package.${outName} or null)
|
||||
config.home.extraOutputsToInstall);
|
||||
|
|
Loading…
Reference in a new issue