From 9e7d3414d976b5b246a1a08db9839d192d17a4db Mon Sep 17 00:00:00 2001 From: PJ Date: Thu, 3 Sep 2026 15:06:35 +0530 Subject: [PATCH] give the nix package a gl driver on hosts that are not nixos --- nix/package.nix | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/nix/package.nix b/nix/package.nix index a705370..8916325 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -17,6 +17,8 @@ gsettings-desktop-schemas, gtk3, libsoup_3, + mesa, + runtimeShell, webkitgtk_4_1, xdg-utils, }: @@ -57,20 +59,45 @@ stdenv.mkDerivation { webkitgtk_4_1 ]; + # The binary sits under lib/ so wrapGAppsHook wraps the launcher in bin/ and nothing else. + # + # Outside NixOS there is no /run/opengl-driver, so the libglvnd this build links finds no EGL + # driver and WebKit aborts its web process on the spot. The launcher points it at nixpkgs' Mesa + # instead, unless something like nixGL already did. The xdg-open shim strips that again for the + # browser the app opens, which has a Mesa of its own. installPhase = '' runHook preInstall - mkdir -p $out - cp -r usr/bin usr/share $out/ + mkdir -p $out/bin $out/lib/margin-calendar/bin + cp usr/bin/margin-calendar $out/lib/margin-calendar/ + cp -r usr/share $out/ mv "$out/share/applications/Margin Calendar.desktop" $out/share/applications/margin-calendar.desktop + + cat > $out/bin/margin-calendar < $out/lib/margin-calendar/bin/xdg-open <