Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firefox: Add containersForce #5057

Merged
merged 1 commit into from Apr 10, 2024
Merged

Conversation

slotThe
Copy link
Contributor

@slotThe slotThe commented Feb 25, 2024

Description

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


I guess it would be best if this was inlined into the existing containers field, in a backwards compatible way; e.g.,

containers = {
  force = true;

  "name" = {
    id    = 1;
    color = "purple";
  };

but I haven't managed to make that work.

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

Maintainer CC

@rycee @kira-bruneau

Copy link
Contributor

@DamienCassou DamienCassou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@DamienCassou
Copy link
Contributor

I guess it would be best if this was inlined into the existing containers field, in a backwards compatible way

I agree a profile.<name>.containers.force would be better but only if container definitions where not directly within profile.<name>.containers. Mixing both options and containers in the same attribute set is just confusing I think.

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
@teto
Copy link
Collaborator

teto commented Mar 22, 2024

since I've enabled this, firefox crashes on nixos-rebuild (at least the one in focus). Does anyone else see that ?

@DamienCassou
Copy link
Contributor

since I've enabled this, firefox crashes on nixos-rebuild (at least the one in focus). Does anyone else see that ?

I've been using this for 2 weeks with no problem. I just tried again and it worked.

@slotThe
Copy link
Contributor Author

slotThe commented Mar 22, 2024

I've also been using this ever since I created this PR, and across many nix-rebuilds I've never notices any weird things like that

@kanopeld
Copy link

working great for me, thanks! when to expect it in the master?

@DamienCassou
Copy link
Contributor

Still using it and didn't notice anything.

@rycee rycee merged commit 18f89ef into nix-community:master Apr 10, 2024
3 checks passed
@rycee
Copy link
Member

rycee commented Apr 10, 2024

Thanks! Merged to master now 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: firefox creates a new containers.json on quite that is not overwritten
5 participants