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 <noreply@anthropic.com>
This commit is contained in:
rope 2026-08-31 19:40:57 +01:00
parent 316601db6c
commit 0bc16d0cdc

View file

@ -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 <mtime>", "missing <path>" or "error <exception>" 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;
})
];