2023-03-24 00:07:29 +00:00
|
|
|
dotnetPackages:
|
2024-09-26 11:04:55 +00:00
|
|
|
{
|
|
|
|
buildEnv,
|
|
|
|
makeWrapper,
|
|
|
|
lib,
|
|
|
|
symlinkJoin,
|
|
|
|
}:
|
2022-09-09 14:08:57 +00:00
|
|
|
# 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?
|
2024-09-26 11:04:55 +00:00
|
|
|
let
|
|
|
|
cli = builtins.head dotnetPackages;
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
2024-09-26 11:04:55 +00:00
|
|
|
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/
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
mkdir $out/bin
|
|
|
|
ln -s $out/dotnet $out/bin/dotnet
|
|
|
|
'';
|
|
|
|
passthru = {
|
|
|
|
inherit (cli) icu;
|
2023-03-24 00:07:29 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
versions = lib.catAttrs "version" dotnetPackages;
|
|
|
|
packages = lib.concatLists (lib.catAttrs "packages" dotnetPackages);
|
|
|
|
targetPackages = lib.zipAttrsWith (_: lib.concatLists) (
|
|
|
|
lib.catAttrs "targetPackages" dotnetPackages
|
|
|
|
);
|
|
|
|
};
|
2023-03-24 00:07:29 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
inherit (cli) meta;
|
|
|
|
}
|