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
This commit is contained in:
Ihar Hrachyshka
2026-08-25 23:04:29 -04:00
parent b562ac4e90
commit 2452ba690c

View File

@@ -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"