stdenv: cleanup things a little bit
This commit is contained in:
parent
d834ba6654
commit
845fa56921
@ -131,31 +131,33 @@ rec {
|
|||||||
outputs ++
|
outputs ++
|
||||||
(if separateDebugInfo then assert stdenv.hostPlatform.isLinux; [ "debug" ] else []);
|
(if separateDebugInfo then assert stdenv.hostPlatform.isLinux; [ "debug" ] else []);
|
||||||
|
|
||||||
|
computedSandboxProfile =
|
||||||
|
lib.concatMap (input: input.__propagatedSandboxProfile or [])
|
||||||
|
(stdenv.extraNativeBuildInputs
|
||||||
|
++ stdenv.extraBuildInputs
|
||||||
|
++ lib.concatLists dependencies);
|
||||||
|
|
||||||
|
computedPropagatedSandboxProfile =
|
||||||
|
lib.concatMap (input: input.__propagatedSandboxProfile or [])
|
||||||
|
(lib.concatLists propagatedDependencies);
|
||||||
|
|
||||||
|
computedImpureHostDeps =
|
||||||
|
lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or [])
|
||||||
|
(stdenv.extraNativeBuildInputs
|
||||||
|
++ stdenv.extraBuildInputs
|
||||||
|
++ lib.concatLists dependencies));
|
||||||
|
|
||||||
|
computedPropagatedImpureHostDeps =
|
||||||
|
lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or [])
|
||||||
|
(lib.concatLists propagatedDependencies));
|
||||||
|
|
||||||
derivationArg =
|
derivationArg =
|
||||||
(removeAttrs attrs
|
(removeAttrs attrs
|
||||||
["meta" "passthru" "crossAttrs" "pos"
|
["meta" "passthru" "crossAttrs" "pos"
|
||||||
"doCheck" "doInstallCheck"
|
"doCheck" "doInstallCheck"
|
||||||
"__impureHostDeps" "__propagatedImpureHostDeps"
|
"__impureHostDeps" "__propagatedImpureHostDeps"
|
||||||
"sandboxProfile" "propagatedSandboxProfile"])
|
"sandboxProfile" "propagatedSandboxProfile"])
|
||||||
// (let
|
// {
|
||||||
computedSandboxProfile =
|
|
||||||
lib.concatMap (input: input.__propagatedSandboxProfile or [])
|
|
||||||
(stdenv.extraNativeBuildInputs
|
|
||||||
++ stdenv.extraBuildInputs
|
|
||||||
++ lib.concatLists dependencies);
|
|
||||||
computedPropagatedSandboxProfile =
|
|
||||||
lib.concatMap (input: input.__propagatedSandboxProfile or [])
|
|
||||||
(lib.concatLists propagatedDependencies);
|
|
||||||
computedImpureHostDeps =
|
|
||||||
lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or [])
|
|
||||||
(stdenv.extraNativeBuildInputs
|
|
||||||
++ stdenv.extraBuildInputs
|
|
||||||
++ lib.concatLists dependencies));
|
|
||||||
computedPropagatedImpureHostDeps =
|
|
||||||
lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or [])
|
|
||||||
(lib.concatLists propagatedDependencies));
|
|
||||||
in
|
|
||||||
{
|
|
||||||
# A hack to make `nix-env -qa` and `nix search` ignore broken packages.
|
# A hack to make `nix-env -qa` and `nix search` ignore broken packages.
|
||||||
# TODO(@oxij): remove this assert when something like NixOS/nix#1771 gets merged into nix.
|
# TODO(@oxij): remove this assert when something like NixOS/nix#1771 gets merged into nix.
|
||||||
name = assert validity.handled; name + lib.optionalString
|
name = assert validity.handled; name + lib.optionalString
|
||||||
@ -194,6 +196,13 @@ rec {
|
|||||||
|
|
||||||
} // lib.optionalAttrs (hardeningDisable != [] || hardeningEnable != []) {
|
} // lib.optionalAttrs (hardeningDisable != [] || hardeningEnable != []) {
|
||||||
NIX_HARDENING_ENABLE = enabledHardeningOptions;
|
NIX_HARDENING_ENABLE = enabledHardeningOptions;
|
||||||
|
} // lib.optionalAttrs (outputs' != [ "out" ]) {
|
||||||
|
outputs = outputs';
|
||||||
|
} // lib.optionalAttrs doCheck' {
|
||||||
|
doCheck = true;
|
||||||
|
} // lib.optionalAttrs doInstallCheck' {
|
||||||
|
doInstallCheck = true;
|
||||||
|
|
||||||
} // lib.optionalAttrs (stdenv.buildPlatform.isDarwin) {
|
} // lib.optionalAttrs (stdenv.buildPlatform.isDarwin) {
|
||||||
# TODO: remove lib.unique once nix has a list canonicalization primitive
|
# TODO: remove lib.unique once nix has a list canonicalization primitive
|
||||||
__sandboxProfile =
|
__sandboxProfile =
|
||||||
@ -208,13 +217,7 @@ rec {
|
|||||||
"/bin/sh"
|
"/bin/sh"
|
||||||
];
|
];
|
||||||
__propagatedImpureHostDeps = computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps;
|
__propagatedImpureHostDeps = computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps;
|
||||||
} // lib.optionalAttrs (outputs' != [ "out" ]) {
|
};
|
||||||
outputs = outputs';
|
|
||||||
} // lib.optionalAttrs doCheck' {
|
|
||||||
doCheck = true;
|
|
||||||
} // lib.optionalAttrs doInstallCheck' {
|
|
||||||
doInstallCheck = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
validity = import ./check-meta.nix {
|
validity = import ./check-meta.nix {
|
||||||
inherit lib config meta;
|
inherit lib config meta;
|
||||||
|
Loading…
Reference in New Issue
Block a user