mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 12:15:34 +03:00
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:
parent
67ff218c7c
commit
3fd98e7fcb
1 changed files with 7 additions and 10 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue