diff options
author | regnat <rg@regnat.ovh> | 2021-04-23 10:49:10 +0200 |
---|---|---|
committer | regnat <rg@regnat.ovh> | 2021-04-23 10:49:10 +0200 |
commit | 2f4562567398e145083e8df79e839f9f2728e4e8 (patch) | |
tree | e4d29b81517717009dc81460d65dcf3fc34e3fc1 /pkgs/stdenv | |
parent | 8def3d6c05e8e12ed897e9df193b69b81fe94ea0 (diff) |
Allow easily marking a derivation as content-addressed
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/generic/make-derivation.nix | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 74609412782c9..5b446b1182694 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -89,6 +89,8 @@ in rec { , patches ? [] + , __contentAddressed ? false + , ... } @ attrs: let @@ -253,6 +255,12 @@ in rec { inherit doCheck doInstallCheck; 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) { cmakeFlags = (/**/ if lib.isString cmakeFlags then [cmakeFlags] |