Make it easy to build everything as content-addressed

Add a config field `contentAddressedByDefault` and an associated
environment variable `NIXPKGS_CA_BY_DEFAULT` to make every nixpkgs
derivation content-addressed by default
This commit is contained in:
regnat 2021-04-23 10:54:38 +02:00
parent 2f45625673
commit cc5b30c6ac

View File

@ -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: