dotnetCorePackages.combinePackages: use wrapper

This commit is contained in:
David McFarland
2024-12-06 10:01:59 -04:00
parent 895b69405c
commit 791b829b32
@@ -4,6 +4,7 @@ dotnetPackages:
makeWrapper,
lib,
symlinkJoin,
callPackage,
}:
# TODO: Rethink how we determine and/or get the CLI.
# Possible options raised in #187118:
@@ -12,14 +13,15 @@ dotnetPackages:
# 3. Something else?
let
cli = builtins.head dotnetPackages;
mkWrapper = callPackage ./wrapper.nix { };
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";
mkWrapper "sdk" (buildEnv {
name = "dotnet-combined";
paths = dotnetPackages;
pathsToLink = map (x: "/share/dotnet/${x}") [
"host"
@@ -43,6 +45,8 @@ assert lib.assertMsg ((builtins.length dotnetPackages) > 0) ''
ln -s ${cli.man} $man
'';
passthru = {
pname = "dotnet";
version = "combined";
inherit (cli) icu;
versions = lib.catAttrs "version" dotnetPackages;
@@ -53,9 +57,4 @@ assert lib.assertMsg ((builtins.length dotnetPackages) > 0) ''
};
inherit (cli) meta;
}).overrideAttrs
({
outputs = [
"out"
] ++ lib.optional (cli ? man) "man";
})
})