Merge pull request #120316 from regnat/easy-ca
Make it easy to try out content-addressed derivations
This commit is contained in:
commit
6b19be4124
@ -89,6 +89,10 @@ in rec {
|
|||||||
|
|
||||||
, patches ? []
|
, patches ? []
|
||||||
|
|
||||||
|
, __contentAddressed ?
|
||||||
|
(! attrs ? outputHash) # Fixed-output drvs can't be content addressed too
|
||||||
|
&& (config.contentAddressedByDefault or false)
|
||||||
|
|
||||||
, ... } @ attrs:
|
, ... } @ attrs:
|
||||||
|
|
||||||
let
|
let
|
||||||
@ -253,6 +257,12 @@ in rec {
|
|||||||
inherit doCheck doInstallCheck;
|
inherit doCheck doInstallCheck;
|
||||||
|
|
||||||
inherit outputs;
|
inherit outputs;
|
||||||
|
} // lib.optionalAttrs (__contentAddressed) {
|
||||||
|
inherit __contentAddressed;
|
||||||
|
# Provide default values for outputHashMode and outputHashAlgo because
|
||||||
|
# most people won't care about these anyways
|
||||||
|
outputHashAlgo = attrs.outputHashAlgo or "sha256";
|
||||||
|
outputHashMode = attrs.outputHashMode or "recursive";
|
||||||
} // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
|
} // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
|
||||||
cmakeFlags =
|
cmakeFlags =
|
||||||
(/**/ if lib.isString cmakeFlags then [cmakeFlags]
|
(/**/ if lib.isString cmakeFlags then [cmakeFlags]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user