From 0d8a23bfcd0a6dc412a2a911eeb4107ded6e6a2f Mon Sep 17 00:00:00 2001 From: Ivar Scholten Date: Wed, 7 Sep 2022 22:53:07 +0200 Subject: [PATCH] dotnet-sdk: add passthru attribute to generate a runtime ID --- pkgs/development/compilers/dotnet/build-dotnet.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; {