From 7ec53a932f314bd9a04ec1e23424e51b26d475bf Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Thu, 14 Feb 2019 20:32:08 +0100 Subject: [PATCH] stdenv: only set __darwinAllowLocalNetworking on darwin This is a darwin only nix attribute for sandbox builds, it can be ignored on other platforms to avoid unnecessary rebuilds. --- pkgs/stdenv/generic/make-derivation.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index cafd1031ab8..3e3bbab40ab 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -70,6 +70,7 @@ rec { else builtins.unsafeGetAttrPos "name" attrs) , separateDebugInfo ? false , outputs ? [ "out" ] + , __darwinAllowLocalNetworking ? false , __impureHostDeps ? [] , __propagatedImpureHostDeps ? [] , sandboxProfile ? "" @@ -175,6 +176,7 @@ rec { (removeAttrs attrs ["meta" "passthru" "pos" "checkInputs" "installCheckInputs" + "__darwinAllowLocalNetworking" "__impureHostDeps" "__propagatedImpureHostDeps" "sandboxProfile" "propagatedSandboxProfile"]) // (lib.optionalAttrs (!(attrs ? name) && attrs ? pname && attrs ? version)) { @@ -245,6 +247,7 @@ rec { } // lib.optionalAttrs (hardeningDisable != [] || hardeningEnable != []) { NIX_HARDENING_ENABLE = enabledHardeningOptions; } // lib.optionalAttrs (stdenv.buildPlatform.isDarwin) { + inherit __darwinAllowLocalNetworking; # TODO: remove lib.unique once nix has a list canonicalization primitive __sandboxProfile = let profiles = [ stdenv.extraSandboxProfile ] ++ computedSandboxProfile ++ computedPropagatedSandboxProfile ++ [ propagatedSandboxProfile sandboxProfile ];