From 0bc16d0cdc92acdb5ca98fb8e212c6ec7ef1d311 Mon Sep 17 00:00:00 2001 From: rope Date: Mon, 31 Aug 2026 19:40:57 +0100 Subject: [PATCH] zen: unsandbox autoconfig so the theme watcher can run Firefox 62+ restricts mozilla.cfg to pref()/defaultPref(); Components was undefined, so the watcher threw on its first line and so did its catch. Co-Authored-By: Claude Opus 5 --- apps/zen.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/zen.nix b/apps/zen.nix index 2592a57..e47f0fa 100644 --- a/apps/zen.nix +++ b/apps/zen.nix @@ -17,9 +17,13 @@ let # BEFORE the profile's userChrome.css, which would let the startup copy # outrank every sheet we register. # - # Everything here goes through Components.classes. The autoconfig sandbox is - # not a normal system-principal scope: `Services` is not a global in it, and - # reaching for it throws before a single sheet is registered. + # Everything here goes through Components.classes rather than `Services`, + # which is not a global in this scope. + # + # None of it runs without general.config.sandbox_enabled=false below: since + # Firefox 62 autoconfig is sandboxed down to pref()/defaultPref(), so + # `Components` is undefined and the script throws on its first line — as does + # the catch that would have reported it. # # Diagnosing a silent failure: about:config -> fred.zenTheme.status holds # "ok ", "missing " or "error " from the last pass. @@ -90,6 +94,9 @@ in config = lib.mkIf (lib.elem config.networking.hostName [ "FredOS-Gaming" "FredOS-Macbook" ]) { environment.systemPackages = [ (inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default.override { + # Lands in defaults/pref/autoconfig.js, the only place this pref is + # read — setting it from mozilla.cfg is too late to unsandbox itself. + extraAutoConfig = ''pref("general.config.sandbox_enabled", false);''; extraPrefs = themeHotReload; }) ];