1/*
2How to combine packages for use in development:
3dotnetCombined = with dotnetCorePackages; combinePackages [ sdk_6_0 aspnetcore_7_0 ];
4
5Hashes and urls are retrieved from:
6https://dotnet.microsoft.com/download/dotnet
7*/
8{ lib, config, callPackage, recurseIntoAttrs }:
9let
10 buildDotnet = attrs: callPackage (import ./build-dotnet.nix attrs) {};
11 buildAttrs = {
12 buildAspNetCore = attrs: buildDotnet (attrs // { type = "aspnetcore"; });
13 buildNetRuntime = attrs: buildDotnet (attrs // { type = "runtime"; });
14 buildNetSdk = attrs: buildDotnet (attrs // { type = "sdk"; });
15 };
16
17 ## Files in versions/ are generated automatically by update.sh ##
18 dotnet_6_0 = import ./versions/6.0.nix buildAttrs;
19 dotnet_7_0 = import ./versions/7.0.nix buildAttrs;
20 dotnet_8_0 = import ./versions/8.0.nix buildAttrs;
21 dotnet_9_0 = import ./versions/9.0.nix buildAttrs;
22
23 runtimeIdentifierMap = {
24 "x86_64-linux" = "linux-x64";
25 "aarch64-linux" = "linux-arm64";
26 "x86_64-darwin" = "osx-x64";
27 "aarch64-darwin" = "osx-arm64";
28 "x86_64-windows" = "win-x64";
29 "i686-windows" = "win-x86";
30 };
31
32 # Convert a "stdenv.hostPlatform.system" to a dotnet RID
33 systemToDotnetRid = system: runtimeIdentifierMap.${system} or (throw "unsupported platform ${system}");
34in
35{
36 inherit systemToDotnetRid;
37
38 combinePackages = attrs: callPackage (import ./combine-packages.nix attrs) {};
39
40 dotnet_8 = recurseIntoAttrs (callPackage ./8 { bootstrapSdk = dotnet_8_0.sdk_8_0_1xx; });
41 dotnet_9 = recurseIntoAttrs (callPackage ./9 {});
42} // lib.optionalAttrs config.allowAliases {
43 # EOL
44 sdk_2_1 = throw "Dotnet SDK 2.1 is EOL, please use 6.0 (LTS) or 7.0 (Current)";
45 sdk_2_2 = throw "Dotnet SDK 2.2 is EOL, please use 6.0 (LTS) or 7.0 (Current)";
46 sdk_3_0 = throw "Dotnet SDK 3.0 is EOL, please use 6.0 (LTS) or 7.0 (Current)";
47 sdk_3_1 = throw "Dotnet SDK 3.1 is EOL, please use 6.0 (LTS) or 7.0 (Current)";
48 sdk_5_0 = throw "Dotnet SDK 5.0 is EOL, please use 6.0 (LTS) or 7.0 (Current)";
49} // dotnet_6_0 // dotnet_7_0 // dotnet_8_0 // dotnet_9_0