tome: aspnetcore runtime, gapps wrapping, glib at runtime

Three separate reasons the packaged build didn't behave like the one Rider
launches:

- dotnet-runtime must be aspnetcore_10_0, not runtime_10_0. Tome.App's
  runtimeconfig.json requires Microsoft.AspNetCore.App as well as
  Microsoft.NETCore.App, because Photino hosts a local Kestrel server, and
  only the aspnetcore bundle ships it.
- wrapGAppsHook3, so gappsWrapperArgs get spliced into buildDotnetModule's
  own wrap step (it sets dontWrapGApps itself; same pattern as nixpkgs'
  libation). Without it nothing sets XDG_DATA_DIRS/GSETTINGS_SCHEMA_DIR, so
  GTK/WebKitGTK found neither the icon theme nor GTK settings — missing icons
  and a denser default font than in an already-initialized session.
- glib in runtimeDeps. It doesn't arrive via gtk3/webkitgtk's RPATH because
  the consumer is Photino.Native.so, a prebuilt binary out of the nuget
  package rather than something Nix built and patched.

tome-deps.json is the regenerated nuget lock for the aspnetcore switch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-06 03:31:56 +02:00
co-authored by Claude Opus 5
parent f431e81ce6
commit d5507811ea
2 changed files with 38 additions and 22 deletions
+18 -2
View File
@@ -3,11 +3,13 @@
, buildNpmPackage
, importNpmLock
, dotnetCorePackages
, glib
, gtk3
, webkitgtk_4_1
, libnotify
, makeDesktopItem
, copyDesktopItems
, wrapGAppsHook3
, src
}:
@@ -45,15 +47,29 @@ buildDotnetModule (finalAttrs: {
nugetDeps = ./tome-deps.json;
dotnet-sdk = dotnetCorePackages.sdk_10_0;
dotnet-runtime = dotnetCorePackages.runtime_10_0;
# aspnetcore_10_0, not runtime_10_0: Tome.App's runtimeconfig.json requires
# both Microsoft.NETCore.App AND Microsoft.AspNetCore.App (Photino hosts a
# local Kestrel server), and only the aspnetcore bundle ships the latter.
dotnet-runtime = dotnetCorePackages.aspnetcore_10_0;
dotnetFlags = [ "-p:SkipNpmBuild=true" ];
executables = [ "Tome.App" ];
nativeBuildInputs = [ copyDesktopItems ];
# wrapGAppsHook3: buildDotnetModule sets dontWrapGApps = true by default (to
# avoid double-wrapping) but its own wrap step still splices gappsWrapperArgs
# in when the hook is present (see nixpkgs' libation package, same pattern).
# Without it the binary never gets XDG_DATA_DIRS/GSETTINGS_SCHEMA_DIR set, so
# GTK/WebKitGTK can't find the icon theme or GTK settings from the desktop
# session — symptoms: missing icons and a denser default UI font/size than
# when launched from an already-fully-initialized session (e.g. via Rider).
nativeBuildInputs = [ copyDesktopItems wrapGAppsHook3 ];
runtimeDeps = [
# glib: not pulled in via gtk3/webkitgtk's own RPATH here, because the
# thing that needs it — Photino.Native.so — is a prebuilt binary shipped
# in the Photino.Native nuget package, not something Nix built/patched.
glib
gtk3
webkitgtk_4_1
libnotify