about summary refs log tree commit diff
path: root/pkgs/development/compilers/dotnet/combine-packages.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/dotnet/combine-packages.nix')
-rw-r--r--pkgs/development/compilers/dotnet/combine-packages.nix67
1 files changed, 40 insertions, 27 deletions
diff --git a/pkgs/development/compilers/dotnet/combine-packages.nix b/pkgs/development/compilers/dotnet/combine-packages.nix
index 303e5eaba847..661f9c482a12 100644
--- a/pkgs/development/compilers/dotnet/combine-packages.nix
+++ b/pkgs/development/compilers/dotnet/combine-packages.nix
@@ -1,37 +1,50 @@
 dotnetPackages:
-{ buildEnv, makeWrapper, lib, symlinkJoin }:
+{
+  buildEnv,
+  makeWrapper,
+  lib,
+  symlinkJoin,
+}:
 # TODO: Rethink how we determine and/or get the CLI.
 #       Possible options raised in #187118:
 #         1. A separate argument for the CLI (as suggested by IvarWithoutBones
 #         2. Use the highest version SDK for the CLI (as suggested by GGG)
 #         3. Something else?
-let cli = builtins.head dotnetPackages;
+let
+  cli = builtins.head dotnetPackages;
 in
-assert lib.assertMsg ((builtins.length dotnetPackages) > 0)
-    ''You must include at least one package, e.g
-      `with dotnetCorePackages; combinePackages [
-          sdk_6_0 aspnetcore_7_0
-       ];`'' ;
-  buildEnv {
-    name = "dotnet-core-combined";
-    paths = dotnetPackages;
-    pathsToLink = [ "/host" "/packs" "/sdk" "/sdk-manifests" "/shared" "/templates" ];
-    ignoreCollisions = true;
-    postBuild = ''
-      cp -R ${cli}/{dotnet,share,nix-support} $out/
+assert lib.assertMsg ((builtins.length dotnetPackages) > 0) ''
+  You must include at least one package, e.g
+        `with dotnetCorePackages; combinePackages [
+            sdk_6_0 aspnetcore_7_0
+         ];`'';
+buildEnv {
+  name = "dotnet-core-combined";
+  paths = dotnetPackages;
+  pathsToLink = [
+    "/host"
+    "/packs"
+    "/sdk"
+    "/sdk-manifests"
+    "/shared"
+    "/templates"
+  ];
+  ignoreCollisions = true;
+  postBuild = ''
+    cp -R ${cli}/{dotnet,share,nix-support} $out/
 
-      mkdir $out/bin
-      ln -s $out/dotnet $out/bin/dotnet
-    '';
-    passthru = {
-      inherit (cli) icu;
+    mkdir $out/bin
+    ln -s $out/dotnet $out/bin/dotnet
+  '';
+  passthru = {
+    inherit (cli) icu;
 
-      versions = lib.catAttrs "version" dotnetPackages;
-      packages = symlinkJoin {
-        name = "combined-packages";
-        paths = lib.remove null (lib.catAttrs "packages" dotnetPackages);
-      };
-    };
+    versions = lib.catAttrs "version" dotnetPackages;
+    packages = lib.concatLists (lib.catAttrs "packages" dotnetPackages);
+    targetPackages = lib.zipAttrsWith (_: lib.concatLists) (
+      lib.catAttrs "targetPackages" dotnetPackages
+    );
+  };
 
-    inherit (cli) meta;
-  }
+  inherit (cli) meta;
+}