Skip to content

Commit

Permalink
firefox: add containersForce flag
Browse files Browse the repository at this point in the history
Firefox, upon exit, creates the default containers.json file in place of
the one that home-manager created. This leads to errors when switching
to a new profile, as home-manager is careful with overwriting existing
files. The added option toggles that behaviour.

Closes: #4989
  • Loading branch information
slotThe committed Mar 19, 2024
1 parent 0224644 commit 5ba6569
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/programs/firefox.nix
Expand Up @@ -573,6 +573,17 @@ in {
};
};

containersForce = mkOption {
type = types.bool;
default = false;
description = ''
Whether to force replace the existing containers
configuration. This is recommended since Firefox will
replace the symlink on every launch, but note that you'll
lose any existing configuration by enabling this.
'';
};

containers = mkOption {
type = types.attrsOf (types.submodule ({ name, ... }: {
options = {
Expand Down Expand Up @@ -762,6 +773,7 @@ in {

"${profilesPath}/${profile.path}/containers.json" =
mkIf (profile.containers != { }) {
force = profile.containersForce;
text = mkContainersJson profile.containers;
};

Expand Down

0 comments on commit 5ba6569

Please sign in to comment.