diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index b33f75e34676..49ed332a1d01 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -117,7 +117,9 @@ rec { in finalAttrs: { - name, + pname ? null, + version ? null, + name ? "${pname}-${version}", text, executable ? false, destination ? "", @@ -127,7 +129,7 @@ rec { allowSubstitutes ? false, preferLocalBuild ? true, derivationArgs ? { }, - pos ? builtins.unsafeGetAttrPos "name" args, + pos ? builtins.unsafeGetAttrPos (if pname != null then "pname" else "name") args, }@args: { inherit @@ -139,6 +141,10 @@ rec { allowSubstitutes preferLocalBuild ; + + ${if pname != null then "pname" else null} = pname; + ${if version != null then "version" else null} = version; + destination = assert (destination != "" -> (hasRootPrefix destination && destination != "/"))