Skip to content

Commit

Permalink
firefox: Add containersForce
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: nix-community#4989
  • Loading branch information
slotThe committed Feb 25, 2024
1 parent 4ee704c commit d91e36b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/programs/firefox.nix
Original file line number Diff line number Diff line change
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 d91e36b

Please sign in to comment.