Change:
<ins> { lib , stdenv , buildDotnetModule , fetchFromGitHub , dotnetCorePackages , dbus , fontconfig , libICE , libSM , libX11 , portaudio }: buildDotnetModule rec { pname = "OpenUtau"; version = "0.1.158"; src = fetchFromGitHub { owner = "stakira"; repo = "OpenUtau"; rev = "build/${version}"; hash = "sha256-/+hlL2sj/juzWrDcb5dELp8Zdg688XK8OnjKz20rx/M="; }; dotnet-sdk = dotnetCorePackages.sdk_7_0; dotnet-runtime = dotnetCorePackages.runtime_7_0; projectFile = "OpenUtau.sln"; nugetDeps = ./deps.nix; executables = [ "OpenUtau" ]; runtimeDeps = [ dbus fontconfig libICE libSM libX11 portaudio ]; dotnetInstallFlags = [ "-p:PublishReadyToRun=false" ]; # socket cannot bind to localhost on darwin for tests doCheck = !stdenv.isDarwin; # needed until upstream bumps to dotnet 7 postPatch = '' substituteInPlace OpenUtau/OpenUtau.csproj OpenUtau.Test/OpenUtau.Test.csproj --replace  "<TargetFramework>net6.0</TargetFramework>"  "<TargetFramework>net7.0</TargetFramework>" ''; # need to make sure proprietary worldline resampler is copied postInstall = let runtime = if (stdenv.isLinux && stdenv.isx86_64) then "linux-x64" else if (stdenv.isLinux && stdenv.isAarch64) then "linux-arm64" else if stdenv.isDarwin then "osx" else null; in lib.optionalString (runtime != null) '' cp runtimes/${runtime}/native/libworldline${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/OpenUtau/ ''; passthru.updateScript = ./update.sh; meta = with lib; { description = "Open source singing synthesis platform and UTAU successor"; homepage = "http://www.openutau.com/"; sourceProvenance = with sourceTypes; [ fromSource # deps binaryBytecode # some deps and worldline resampler binaryNativeCode ]; license = with licenses; [ # dotnet code mit # worldline resampler unfree ]; maintainers = with maintainers; [ lilyinstarlight ]; platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; }; } </ins>

Discussion:
Project description Open singing synthesis platform / Open source UTAU successor Metadata homepage URL: source URL: license: mit platforms: linux, darwin
For anyone wanting to package, here is some info I've acquired from my attempts to package (I eventually gave up, as I have no real dotnet knowledge). It's built made in dotnet, and uses avalonia ui. Seems to target dotnet 6.0, but the arch aur packages all use dotnet 7.0, so both probably work.
I found this issue while trying to package this too! I also don't know anything about dotnet and I've been pulling my hair out trying to figure out why my package fails during the install phase. Hope someone who knows more can figure it out lol. I've been using the osu-lazer package as a reference, maybe that will be helpful to someone?
I've tried working on this too, and had no luck. I've not used any references, but as you've said, I'm going to look into Ryujinx and osu-lazer - although I highly doubt if they're going to be any helpful - there's a whole lot of dependencies missing probably, and the logs are misleading. Here's what I was able to come up with: The stuff after needs to be removed for nixpkgs, but since I'm trying this out on nix-build, I had to add them.
See . I actually hadn't see this issue before making that
will the build be cached? It takes a significant amount of time for NuGet to download the dependencies, followed by the build.
Right now it will not be cached by Hydra, no, since the resampler does not seem to have a license (or source code) and so is not necessarily legally distributable, as far as I could tell If you can find evidence otherwise, though, I can update the license or I can get creative in allowing it to be cached without the resampler and then symlink it in a new derivation or something
Thanks for adding OpenUtau to NixOS. Would the below statement be enough for redistribution?
I think that's probably sufficient, sure. Thank you for adding that! I'll update the package today in nixpkgs to remove the "unfree" bit