From 2452ba690cfa131ce5bb55b2974b99a01ac94709 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Tue, 25 Aug 2026 23:04:29 -0400 Subject: [PATCH] firefox/wrapper: add appDataDir argument This is immediately helpful on MacOS 27+ where access to default datadir is now restricted to apps that are signed by Mozilla. Moving datadir to a new location implies a completely new profile will be created, unless users migrate their datadirs from the default location to the new one. Nixpkgs derivation cannot execute this migration for the users, nor it includes any tools to help with it. For this reason, users on 27+ will have to explicitly opt-in their firefox to use a new location, potentially also migrating their existing datadir beforehand. I expect Home Manager programs.firefox module to allow to set the argument to: ${cfg.home.homeDirectory}/Library/Application Support/org.nixos.firefox Other package consumers are advised to use the same directory for portability reasons. Fixes #535123 --- pkgs/applications/networking/browsers/firefox/wrapper.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix index 5976eb00cb86..2083d60b3656 100644 --- a/pkgs/applications/networking/browsers/firefox/wrapper.nix +++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix @@ -71,6 +71,7 @@ let pkcs11Modules ? [ ], useGlvnd ? (!isDarwin), cfg ? config.${applicationName} or { }, + appDataDir ? null, ## Following options are needed for extra prefs & policies # For more information about anti tracking (german website) @@ -334,6 +335,11 @@ let "MOZ_ALLOW_DOWNGRADE" "1" ] + ++ lib.optionals (appDataDir != null) [ + "--set" + "MOZ_APP_DATA" + appDataDir + ] ++ lib.optionals (!isDarwin) [ "--suffix" "GTK_PATH"