···290290 in [ nativeBuildInputs buildInputs ];
291291292292 propagatedDependencies' = map lib.chooseDevOutputs propagatedDependencies;
293293- in
294293295294 # Throw an error if trying to evaluate an non-valid derivation
296296- assert let v = checkValidity attrs;
295295+ validityCondition =
296296+ let v = checkValidity attrs;
297297 in if !v.valid
298298 then throwEvalHelp (removeAttrs v ["valid"])
299299 else true;
300300301301- lib.addPassthru (derivation (
301301+ derivationArg =
302302 (removeAttrs attrs
303303 ["meta" "passthru" "crossAttrs" "pos"
304304 "__impureHostDeps" "__propagatedImpureHostDeps"
···343343 __propagatedImpureHostDeps = computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps;
344344 } // (if outputs' != [ "out" ] then {
345345 outputs = outputs';
346346- } else { })))) (
347347- {
348348- overrideAttrs = f: mkDerivation (attrs // (f attrs));
349349- # The meta attribute is passed in the resulting attribute set,
350350- # but it's not part of the actual derivation, i.e., it's not
351351- # passed to the builder and is not a dependency. But since we
352352- # include it in the result, it *is* available to nix-env for queries.
353353- meta = { }
354354- # If the packager hasn't specified `outputsToInstall`, choose a default,
355355- # which is the name of `p.bin or p.out or p`;
356356- # if he has specified it, it will be overridden below in `// meta`.
357357- # Note: This default probably shouldn't be globally configurable.
358358- # Services and users should specify outputs explicitly,
359359- # unless they are comfortable with this default.
360360- // { outputsToInstall =
361361- let
362362- outs = outputs'; # the value passed to derivation primitive
363363- hasOutput = out: builtins.elem out outs;
364364- in [( lib.findFirst hasOutput null (["bin" "out"] ++ outs) )];
365365- }
366366- // meta
367367- # Fill `meta.position` to identify the source location of the package.
368368- // lib.optionalAttrs (pos' != null)
369369- { position = pos'.file + ":" + toString pos'.line; }
370370- ;
371371- inherit passthru;
372372- } //
373373- # Pass through extra attributes that are not inputs, but
374374- # should be made available to Nix expressions using the
375375- # derivation (e.g., in assertions).
376376- passthru);
346346+ } else { }));
347347+348348+ # The meta attribute is passed in the resulting attribute set,
349349+ # but it's not part of the actual derivation, i.e., it's not
350350+ # passed to the builder and is not a dependency. But since we
351351+ # include it in the result, it *is* available to nix-env for queries.
352352+ meta = { }
353353+ # If the packager hasn't specified `outputsToInstall`, choose a default,
354354+ # which is the name of `p.bin or p.out or p`;
355355+ # if he has specified it, it will be overridden below in `// meta`.
356356+ # Note: This default probably shouldn't be globally configurable.
357357+ # Services and users should specify outputs explicitly,
358358+ # unless they are comfortable with this default.
359359+ // { outputsToInstall =
360360+ let
361361+ outs = outputs'; # the value passed to derivation primitive
362362+ hasOutput = out: builtins.elem out outs;
363363+ in [( lib.findFirst hasOutput null (["bin" "out"] ++ outs) )];
364364+ }
365365+ // attrs.meta or {}
366366+ # Fill `meta.position` to identify the source location of the package.
367367+ // lib.optionalAttrs (pos' != null)
368368+ { position = pos'.file + ":" + toString pos'.line; }
369369+ ;
370370+371371+ in
372372+373373+ assert validityCondition;
374374+375375+ lib.addPassthru (derivation derivationArg) (
376376+ {
377377+ overrideAttrs = f: mkDerivation (attrs // (f attrs));
378378+ inherit meta passthru;
379379+ } //
380380+ # Pass through extra attributes that are not inputs, but
381381+ # should be made available to Nix expressions using the
382382+ # derivation (e.g., in assertions).
383383+ passthru);
377384378385 # The stdenv that we are producing.
379386 result =