diff --git a/pkgs/development/compilers/dotnet/build-dotnet.nix b/pkgs/development/compilers/dotnet/build-dotnet.nix index f8cf3d302ec4..05bbcd092857 100644 --- a/pkgs/development/compilers/dotnet/build-dotnet.nix +++ b/pkgs/development/compilers/dotnet/build-dotnet.nix @@ -105,8 +105,18 @@ stdenv.mkDerivation rec { export DOTNET_CLI_TELEMETRY_OPTOUT=1 ''; - passthru = { + passthru = rec { inherit icu packages; + + runtimeIdentifierMap = { + "x86_64-linux" = "linux-x64"; + "aarch64-linux" = "linux-arm64"; + "x86_64-darwin" = "osx-x64"; + "aarch64-darwin" = "osx-arm64"; + }; + + # Convert a "stdenv.hostPlatform.system" to a dotnet RID + systemToDotnetRid = system: runtimeIdentifierMap.${system} or (throw "unsupported platform ${system}"); }; meta = with lib; {