diff options
author | Naïm Favier <n@monade.li> | 2023-06-13 18:58:37 +0200 |
---|---|---|
committer | Naïm Favier <n@monade.li> | 2023-06-14 23:27:45 +0200 |
commit | 2e6013cf1bdf6b0409589bdaca6588710cc145a2 (patch) | |
tree | 7d75848ee638855be5672be8fd206cb27699adb0 /pkgs/build-support | |
parent | 69be6e9c723d9eec2838d4d8394ed3731cf30de3 (diff) |
runCommand: set meta.position from the arguments
Currently all packages defined by a call to runCommand have their meta.position pointing to trivial-builders.nix. This change makes uses of runCommand that supply at least one attribute in the second argument point to the right file.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/trivial-builders/default.nix | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index d3cb22a1f5351..2af36008c7a51 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -87,6 +87,10 @@ rec { inherit buildCommand name; passAsFile = [ "buildCommand" ] ++ (derivationArgs.passAsFile or []); + pos = let args = builtins.attrNames derivationArgs; in + if builtins.length args > 0 + then builtins.unsafeGetAttrPos (builtins.head args) derivationArgs + else null; } // (lib.optionalAttrs runLocal { preferLocalBuild = true; |