1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2025-02-23 08:35:08 +01:00
home-manager/modules
Sven Over a95337eefd firefox: fix starting with non-default profile
When home-manager manages the Firefox configuration, the `profiles.ini`
file in `~/.mozilla/firefox/` is immutable. Any attempt by Firefox to
update it fails accordingly. Currently, when multiple profiles are defined,
it is not possible to choose a non-default one by passing a `-Profile`
option to Firefox, or by using `firefox -ProfileManager`: if the user
chooses a non-default profile, Firefox tries to update the `profile.ini`
with this choice, which fails because of the file's immutability, and
Firefox refuses to start up. The user is shown an error saying `An
unexpected error has prevented your changes from being saved.`.

Currently, the setting to save the profile choice back to `profiles.ini` is
hardcoded in home-manager. This Pull Request changes that, so the file is
never updated with the user choice.

This fixes the cases where a user attempts to start a non-default profile.

I think this is also matches home-manager philosophy nicely: because we
define what the default profile is in our home-manager config, the user
should not be able to change that in the firefox gui, because then the
active configuration would diverge from what's defined in home-manager.
As a matter of fact, the user currently can't change the default anyway,
as trying to do so results in an error, but the user should be able to
choose a profile for an individual Firefox instance.

The Firefox Profile Manager GUI (that you get by starting Firefox with the
`-ProfileManager` option) has a check box to decide whether to "use the
selected profile without asking at startup", i.e. make it the new default.
This is currently ticked (because it's hardcoded in home-manager as
`StartWithLastProfile = 1`). If it stays ticked, choosing any profile other
than the default results in the error. Unticking this box will also not
help, because now Firefox would attempt to update `profiles.ini` with
`StartWithLastProfile=0`.

Either way, when home-manager manages the Firefox config for us, we cannot
have Firefox update `profiles.ini`, and therefore we cannot change the
default profile through Firefox's GUI.

With this fix, choosing a different profile on the command line (`firefox
-Profile foo`) or via the GUI (`firefox -ProfileManager`) now works. The
user will still get an error when they tick the checkbox to "use the
selected profile without asking at startup", because that results in an
attempt to update `profiles.ini`. Also, it would mean that the chosen
default profile would diverge from the setting in the user's home-manager
config - so not allowing this seems sensible.
2024-12-30 10:54:03 +00:00
..
accounts accounts/contacts: fix defaultText rendering 2024-10-23 22:55:53 +02:00
config home-cursor: use profileExtra instead of initExtra 2024-12-04 12:38:17 +01:00
files files: make collision error message more helpful 2024-04-30 00:41:45 +02:00
i18n/input-method kime: remove documentation dependency on config 2024-03-18 22:13:07 +01:00
launchd treewide: deprecate DRY_RUN_CMD and DRY_RUN_NULL 2024-01-24 13:36:05 +01:00
lib pay-respects: add module 2024-12-21 18:13:06 +01:00
lib-bash home-manager: fix nix-build option -q 2024-03-22 19:46:20 +01:00
misc treewide: change pacien to euxane 2024-12-24 16:23:06 +01:00
po Translate using Weblate (German) 2024-10-17 11:23:29 +00:00
programs firefox: fix starting with non-default profile 2024-12-30 10:54:03 +00:00
services copyq: add option to disable XWayland 2024-12-28 11:16:56 +01:00
targets darwin: misc defaults (dock, menu clock, finder) 2024-05-11 00:04:45 +02:00
default.nix home-manager: set module class to "homeManager" 2024-04-27 09:28:21 +02:00
files.nix home-manager: extract inline shell script to file 2024-04-06 10:04:27 +02:00
home-environment.nix docs: home.sessionVariable clarification 2024-11-05 21:18:50 +01:00
manual.nix docs: add style sheets and scrubDerivations 2024-02-01 01:10:58 +01:00
modules.nix cavalier: add module 2024-12-22 09:48:38 +01:00
systemd-activate.rb Revert "systemd: use sd-switch" 2020-08-04 19:38:14 +02:00
systemd-activate.sh systemd: don't try to restart templates 2024-06-26 18:14:48 +02:00
systemd.nix systemd: use getExe for sd-switch 2024-09-12 13:54:47 +02:00
xresources.nix xresources: allow floating point values 2024-12-22 19:48:53 +01:00
xsession.nix xsession: allow xplugd to restart on failure 2024-01-16 08:07:00 +01:00