From 2e6013cf1bdf6b0409589bdaca6588710cc145a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Tue, 13 Jun 2023 18:58:37 +0200 Subject: [PATCH] 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. --- pkgs/build-support/trivial-builders/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index d3cb22a1f535..2af36008c7a5 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;