Commit 2f456256 authored by regnat's avatar regnat
Browse files

Allow easily marking a derivation as content-addressed

parent 8def3d6c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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]