Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions pkgs/stdenv/generic/make-derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -878,8 +878,7 @@ let
inputDerivation = derivation (
deleteFixedOutputRelatedAttrs derivationArg
// {
# Add a name in case the original drv didn't have one
name = derivationArg.name or "inputDerivation";
name = "inputDerivation${lib.optionalString (derivationArg ? name) "-${derivationArg.name}"}";
# This always only has one output
outputs = [ "out" ];

Expand Down Expand Up @@ -912,23 +911,20 @@ let
];
}
// (
let
sharedOutputChecks = {
# inputDerivation produces the inputs; not the outputs, so any
# restrictions on what used to be the outputs don't serve a purpose
# anymore.
# inputDerivation produces the inputs; not the outputs, so any
# restrictions on what used to be the outputs don't serve a purpose
# anymore.
if __structuredAttrs then
{
outputChecks = { };
}
else
{
allowedReferences = null;
allowedRequisites = null;
disallowedReferences = [ ];
disallowedRequisites = [ ];
};
in
if __structuredAttrs then
{
outputChecks.out = sharedOutputChecks;
}
else
sharedOutputChecks
)
);

Expand Down
4 changes: 4 additions & 0 deletions pkgs/test/stdenv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ in
touch $out
'';

test-inputDerivation-structured = (stdenv.mkDerivation {
__structuredAttrs = true;
}).inputDerivation;

test-prepend-append-to-var = testPrependAndAppendToVar {
name = "test-prepend-append-to-var";
stdenv' = bootStdenv;
Expand Down
Loading