| 1 | { runCommand, fetchurl, mono, unzip }: |
| 2 | let |
| 3 | references = fetchurl { |
| 4 | url = "https://api.nuget.org/v3-flatcontainer/microsoft.netframework.referenceassemblies.net48/1.0.3/microsoft.netframework.referenceassemblies.net48.1.0.3.nupkg"; |
| 5 | hash = "sha256-in40hTjn65E1FpaRFon0nj1PY/i6tRdDK74Vm4sRBKI="; |
| 6 | }; |
| 7 | in runCommand "computer-windows" { |
| 8 | nativeBuildInputs = [ mono unzip ]; |
| 9 | } '' |
| 10 | unzip -q ${references} -d references |
| 11 | ref="$PWD/references/build/.NETFramework/v4.8" |
| 12 | mkdir -p "$out/bin" |
| 13 | mcs -noconfig -nostdlib -deterministic -optimize+ -target:winexe -platform:anycpu \ |
| 14 | -r:"$ref/mscorlib.dll" -r:"$ref/System.dll" -r:"$ref/System.Core.dll" \ |
| 15 | -r:"$ref/System.Management.dll" -r:"$ref/Microsoft.CSharp.dll" \ |
| 16 | -r:"$ref/System.Web.Extensions.dll" -r:"$ref/WindowsBase.dll" \ |
| 17 | -r:"$ref/UIAutomationClient.dll" -r:"$ref/UIAutomationTypes.dll" \ |
| 18 | -out:"$out/bin/worker.exe" ${../guest/computer-windows.cs} |
| 19 | '' |