Files
server/nix/lib/buildSpacebarDotnetModule.nix
2026-04-11 15:41:18 +02:00

61 lines
1.3 KiB
Nix

{ pkgs, rVersion }:
{
name,
nugetDeps ? null,
projectReferences ? [ ],
projectFile ? "${name}/${name}.csproj",
runtimeId ? null,
useAppHost ? null,
packNupkg ? true,
srcRoot ? ./.,
...
}@args:
pkgs.buildDotnetModule (pkgs.lib.recursiveUpdate
(
rec {
inherit
projectReferences
nugetDeps
projectFile
runtimeId
useAppHost
srcRoot
packNupkg
;
pname = "${name}";
version = "1.0.0-" + rVersion;
dotnetPackFlags = [
"--include-symbols"
"--include-source"
"--version-suffix ${rVersion}"
];
# dotnetFlags = [ "-v:n" ]; # diag
dotnet-sdk = pkgs.dotnet-sdk_10;
dotnet-runtime = pkgs.dotnet-aspnetcore_10;
src = pkgs.lib.cleanSource srcRoot;
meta = with pkgs.lib; {
description = "Spacebar Server, Typescript Edition (C# extensions)";
homepage = "https://github.com/spacebarchat/server";
license = licenses.agpl3Plus;
maintainers = with maintainers; [ RorySys ];
mainProgram = name;
};
}
// {
__nugetDeps = args.nugetDeps;
}
)
(
builtins.removeAttrs args [
"name"
"nugetDeps"
"projectReferences"
"projectFile"
"runtimeId"
"useAppHost"
"packNupkg"
"srcRoot"
]
)
)