nixos/fish: fix completion generation for non-derivation packages
environment.systemPackages can include any package, which means it can be a top-level store path that is not a derivation and thus will not have a name attribute - their name is extracted from the path instead.
This commit is contained in:
@@ -258,16 +258,13 @@ in
|
|||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
allowSubstitutes = false;
|
allowSubstitutes = false;
|
||||||
};
|
};
|
||||||
generateCompletions = package: pkgs.runCommand
|
generateCompletions = package: pkgs.runCommandLocal
|
||||||
"${package.name}_fish-completions"
|
( with lib.strings; let
|
||||||
(
|
storeLength = stringLength storeDir + 34; # Nix' StorePath::HashLen + 2 for the separating slash and dash
|
||||||
{
|
pathName = substring storeLength (stringLength package - storeLength) package;
|
||||||
inherit package;
|
in (package.name or pathName) + "_fish-completions")
|
||||||
preferLocalBuild = true;
|
( { inherit package; } //
|
||||||
allowSubstitutes = false;
|
optionalAttrs (package ? meta.priority) { meta.priority = package.meta.priority; })
|
||||||
}
|
|
||||||
// optionalAttrs (package ? meta.priority) { meta.priority = package.meta.priority; }
|
|
||||||
)
|
|
||||||
''
|
''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
if [ -d $package/share/man ]; then
|
if [ -d $package/share/man ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user