nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.17k stars 1.85k forks source link

declarative configurations of firefox extensions #4618

Open teto opened 1 year ago

teto commented 1 year ago

Description

We support declarative configuration of firefox but what about its addons ? I recently had to setup a new machine and lost access to my firefox sync profile and there are some extensions I would like to keep my settings via nix instead, for instance this one https://addons.mozilla.org/en-US/firefox/addon/refined-github-/?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=search which I like but has a few bad defaults.

I have no idea how this works, if it's even possible. I suspect addons can use any mechanism they want unless they care about firefox sync. I found https://discourse.mozilla.org/t/in-which-file-are-stored-an-add-on-settings-options/26064 but I have no storage.js in my ~/.mozilla it looks like

NB: I know about https://github.com/nix-community/home-manager/issues/606 but wanted a distinct more focused issue

GetPsyched commented 1 year ago

I wanted this for a long time too!

I did some digging and found:

  1. Firefox's own management of extension configuration goes in these 2 files:
    • ~/.mozilla/firefox/<profile>/extension-settings.json # couldn't really decipher much of this
    • ~/.mozilla/firefox/<profile>/extension-preferences.json # this has permissions and origins for both themes and extensions
  2. Extensions themselves can have their own files in any location within a Firefox profile for their config (assumption)
    • The containers extension saves its container config in ~/.mozilla/firefox/<profile>/containers.json
    • Extension state (not exactly config) are stored in ~/.mozilla/firefox/<profile>/storage/default/moz-extension+++<uuid>

I've only recently learnt how to create NixOS modules, so, I can't help much in actually making a declarative config module (though I might later down the line) but yeah this definitely seems quite messy and/or volatile in terms of what config goes where. Perhaps someone with hands on experience messing with Firefox config would have a better idea.

nixos-discourse commented 1 year ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/set-firefox-extension-settings-in-home-manager/35076/2

stale[bot] commented 10 months ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

DamienCassou commented 8 months ago

I don’t think there is a way to configure extensions in general except through policies and most extensions don’t seem to support policy-based configuration.

I think we should close the issue as I don't think there is anything home-manager can do.

stale[bot] commented 5 months ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.