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
ed0770e962
commit
31a27e4806
|
@ -320,8 +320,13 @@ in {
|
||||||
${postBuild}
|
${postBuild}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
generateCompletions = package:
|
generateCompletions = let
|
||||||
pkgs.runCommand "${package.name}-fish-completions" {
|
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)
|
srcs = [ package ] ++ filter (p: p != null)
|
||||||
(builtins.map (outName: package.${outName} or null)
|
(builtins.map (outName: package.${outName} or null)
|
||||||
config.home.extraOutputsToInstall);
|
config.home.extraOutputsToInstall);
|
||||||
|
|
Loading…
Reference in a new issue