Commit b9509c28 authored by jopejoe1's avatar jopejoe1
Browse files

windows.sdk: move throw behind meta.license check

parent 5c20d4dc
Loading
Loading
Loading
Loading
+98 −96
Original line number Diff line number Diff line
@@ -24,13 +24,6 @@ let
    else
      throw "Unsupported system";
in
if !config.microsoftVisualStudioLicenseAccepted then
  throw ''
    Microsoft Software License Terms are not accepted with config.microsoftVisualStudioLicenseAccepted.
    Please read https://visualstudio.microsoft.com/license-terms/mt644918/ and if you agree, change your
    config to indicate so.
  ''
else
stdenvNoCC.mkDerivation (finalAttrs: {
  inherit version;
  pname = "msvc-sdk";
@@ -41,7 +34,15 @@ else

  outputHashAlgo = "sha256";
  outputHashMode = "recursive";
    outputHash = hashes.${arch};
  outputHash =
    if !config.microsoftVisualStudioLicenseAccepted then
      throw ''
        Microsoft Software License Terms are not accepted with config.microsoftVisualStudioLicenseAccepted.
        Please read https://visualstudio.microsoft.com/license-terms/mt644918/ and if you agree, change your
        config to indicate so.
      ''
    else
      hashes.${arch};

  __structuredAttrs = true;
  xwinArgs = [
@@ -114,6 +115,7 @@ else
      fullName = "Microsoft Software License Terms";
      shortName = "msvc";
      spdxId = "unknown";
      free = false;
      url = "https://www.visualstudio.com/license-terms/mt644918/";
    };
    platforms = lib.platforms.all;