diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 5b446b11826..2bceb9e4333 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -89,7 +89,10 @@ in rec { , patches ? [] - , __contentAddressed ? false + , __contentAddressed ? + (! attrs ? outputHash) # Fixed-output drvs can't be content addressed too + && (config.contentAddressedByDefault or false + || builtins.getEnv "NIXPKGS_CA_BY_DEFAULT" == "1") , ... } @ attrs: