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
nixos/firefox: add more options #201033
nixos/firefox: add more options #201033
Conversation
environment.systemPackages = [ cfg.package ]; | ||
environment.systemPackages = [ | ||
(cfg.package.override { | ||
extraPrefs = cfg.autoConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Firefox may support read this from etc. https://bugzilla.mozilla.org/show_bug.cgi?id=1170092 We can also apply the patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to https://github.com/pyllyukko/user.js#system-wide-installation-all-platforms /etc/firefox/syspref.js
is supported but I didn't find docs and it seems the api is unstable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to read this from /etc
if possible, as that avoids rebuilding the package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AutoConfig in etc requires a patch so we should ask firefox maintains. @lovesegfault @mweinelt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no interest in this module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then let's wait upstream. Using the wrapper for now should be good enough.
There was a problem hiding this 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.
The "used but not defined" error will hit unstable soon so we should try and get this merged.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit message is a bit meaningless.
nixos/modules/programs/firefox.nix
Outdated
policiesJSON = | ||
policyFormat.generate | ||
"firefox-policies.json" | ||
{ inherit (cfg) policies; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
policiesJSON = | |
policyFormat.generate | |
"firefox-policies.json" | |
{ inherit (cfg) policies; }; | |
policiesJSON = policyFormat.generate "firefox-policies.json" { inherit (cfg) policies; }; |
nixos/modules/programs/firefox.nix
Outdated
- `"default"`: Read/Write: Settings appear as default even if factory default differs. | ||
- `"locked"`: Read-Only: Settings appear as default even if factory default differs. | ||
- `"user"`: Read/Write: Settings appear as changed if it differs from factory default. | ||
- `"clear"`: Read/Write: Value has no effect. Resets to factory defaults on each startup. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What means Read/write here? Which settings? That is not clear from the explanation.
nixos/modules/programs/firefox.nix
Outdated
description = mdDoc '' | ||
The status of `firefox.preferences`. | ||
|
||
`status` can be "default", "locked", "user" or "clear" | ||
- `"default"`: Read/Write: Settings appear as default even if factory default differs. | ||
- `"locked"`: Read-Only: Settings appear as default even if factory default differs. | ||
- `"user"`: Read/Write: Settings appear as changed if it differs from factory default. | ||
- `"clear"`: Read/Write: Value has no effect. Resets to factory defaults on each startup. | ||
''; | ||
type = types.enum [ "default" "locked" "user" "clear" ]; | ||
default = "locked"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally we would order type, default and description but all other things are like this too, so whatever.
nixos/modules/programs/firefox.nix
Outdated
AutoConfig files can be used to set and lock preferences that are not covered | ||
by the policies.json for Mac and Linux. This method can be used to automatically | ||
change user preferences or prevent the end user from modifiying specific | ||
preferences by locking them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where would I find more information how to use this?
nixos/modules/programs/firefox.nix
Outdated
browserpass = mkEnableOption (mdDoc "Browserpass support"); | ||
bukubrow = mkEnableOption (mdDoc "Bukubrow support"); | ||
ff2mpv = mkEnableOption (mdDoc "ff2mpv support"); | ||
fxCast = mkEnableOption (mdDoc "fx_cast support"); | ||
gsconnect = mkEnableOption (mdDoc "GSConnect support"); | ||
jabref = mkEnableOption (mdDoc "JabRef support"); | ||
passff = mkEnableOption (mdDoc "PassFF support"); | ||
tridactyl = mkEnableOption (mdDoc "Tridactyl support"); | ||
ugetIntegrator = mkEnableOption (mdDoc "Uget Integrator support"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we express this a bit smarter and shorter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure... What's your suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like mapAttrs (_: v: mkEnableOption (mdDoc v)) { browserpass = "Browserpass support"; … }
maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, got it. Thanks!
nixos/modules/programs/firefox.nix
Outdated
description = mdDoc '' | ||
The status of `firefox.preferences`. | ||
|
||
`status` can be "default", "locked", "user" or "clear" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`status` can be "default", "locked", "user" or "clear" | |
`status` can assume the following values: |
1d6a730
to
f3555d4
Compare
I applied suggestions and split the commits. |
Is this good enough to merge? What else should I do? |
Nothing. |
Thanks! |
Can we get this backported to 22.11 please? I ran into an error that this PR will fix. |
Successfully created backport PR #210557 for |
Hmmh, the way this is currently wired together doesn't allow passing |
Description of changes
error: The option `environment.etc."firefox/policies/policies.json".source' is used but not defined.
enableGnomeExtensions
andenablePlasmaBrowserIntegration
are not added since they are covered by other modules.wmc-mpris
is not added since it's deprecated.chrome-token-signing
is not added because it should be migrated to web-eid first.Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes