runCommand: don't set meta.position if meta is given

Fixes #242093 without breaking #237589

If `meta` is given we probably already have position information, so no
need to get it from the arguments.
This commit is contained in:
Naïm Favier 2023-07-07 19:10:03 +02:00
parent e08fab0406
commit 9be0bfb5e0
No known key found for this signature in database
GPG key ID: 95AFCE8211908325

View file

@ -87,6 +87,8 @@ rec {
inherit buildCommand name;
passAsFile = [ "buildCommand" ]
++ (derivationArgs.passAsFile or []);
}
// lib.optionalAttrs (! derivationArgs?meta) {
pos = let args = builtins.attrNames derivationArgs; in
if builtins.length args > 0
then builtins.unsafeGetAttrPos (builtins.head args) derivationArgs