2023-03-19 19:38:24 +00:00
|
|
|
dotnetPackages:
|
2022-08-17 13:12:43 +00:00
|
|
|
{ buildEnv, makeWrapper, lib }:
|
|
|
|
# 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?
|
2023-03-19 19:38:24 +00:00
|
|
|
let cli = builtins.head dotnetPackages;
|
2020-01-17 13:54:22 +00:00
|
|
|
in
|
2023-03-19 19:38:24 +00:00
|
|
|
assert lib.assertMsg ((builtins.length dotnetPackages) > 0)
|
2020-01-17 13:54:22 +00:00
|
|
|
''You must include at least one package, e.g
|
2020-04-28 11:58:35 +00:00
|
|
|
`with dotnetCorePackages; combinePackages [
|
2023-03-21 21:27:19 +00:00
|
|
|
sdk_6_0 aspnetcore_7_0
|
2020-04-28 11:58:35 +00:00
|
|
|
];`'' ;
|
2020-01-17 13:54:22 +00:00
|
|
|
buildEnv {
|
|
|
|
name = "dotnet-core-combined";
|
2023-03-19 19:38:24 +00:00
|
|
|
paths = dotnetPackages;
|
2022-08-17 13:12:43 +00:00
|
|
|
pathsToLink = [ "/host" "/packs" "/sdk" "/sdk-manifests" "/shared" "/templates" ];
|
2020-01-17 13:54:22 +00:00
|
|
|
ignoreCollisions = true;
|
|
|
|
postBuild = ''
|
2022-10-06 19:58:54 +00:00
|
|
|
cp -R ${cli}/{dotnet,share,nix-support} $out/
|
2022-08-17 13:12:43 +00:00
|
|
|
|
2020-01-17 13:54:22 +00:00
|
|
|
mkdir $out/bin
|
2022-08-17 13:12:43 +00:00
|
|
|
ln -s $out/dotnet $out/bin/dotnet
|
2020-01-17 13:54:22 +00:00
|
|
|
'';
|
2022-08-17 13:12:43 +00:00
|
|
|
passthru = {
|
2023-03-19 19:38:24 +00:00
|
|
|
inherit (cli) icu;
|
|
|
|
|
|
|
|
versions = lib.catAttrs "version" dotnetPackages;
|
|
|
|
packages = lib.remove null (lib.catAttrs "packages" dotnetPackages);
|
2022-08-17 13:12:43 +00:00
|
|
|
};
|
2023-03-19 19:38:24 +00:00
|
|
|
|
|
|
|
inherit (cli) meta;
|
2020-01-17 13:54:22 +00:00
|
|
|
}
|