-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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 with extensions and global config #74297
Conversation
It looks like you did not push the commits in question. Please fix the branch locally force push to update it here. Also I am not sure how well will adding all the config options as top-level arguments scale – maybe grouping it under common attrset will be nicer. |
# For more information about anti tracking
# vist https://wiki.kairaven.de/open/app/firefox
Maybe mention that the page is in German?
, activateAntiTracking ? true
What is the promise here? Enable the Enterprise policy? Policy plus some extra about:config settings? Will the set of extras be updated?
I think a nice first step would be to have policies and config entries as two attrset arguments, with commented defaults and `deepMerge` of the arguments on top of the defaults. And use exactly the upstream names/paths.
, enableDarkDevTools ? true
This is just colour scheme application? Why set it to not-upstream-default?
Maybe also add a default-off option for honouring userChrome.css?
|
The Firefox wrapper is reaching a point where we should probably have tests for it. Otherwise this looks great but I do not think anyone is happily maintaining this without some supportive tests for (each of?) the features. Also did you solve the uninstall of firefox extensions? Previous attempts always fell short on that and I do not feel like adding support for adding but not removing plugins. |
I changed the enableDarkDevTools to false and made a note that the link is a german website.
This is already the case. The options |
I agree having tests for it is probably a good idea. Sadly I don't have the time and resources to do that but maybe someone else?
Yes this does remove the addons! Because here we work with the enterprise whitelist for extensions. If the extension is not whitelisted then it will automatically be removed from every profile |
I am still not convinced the package should expose convenience features. Could we have the low-level options and let the convenience be handled by external helpers? Something like this overlay: (self: super: {
firefoxCustomization.enableDarkDevTools = config: super.lib.recursiveUpdate config {
lockPrefs = {
"devtools.theme" = "dark";
};
};
firefoxCustomization.disableManualExtensions = config: super.lib.recursiveUpdate config {
policies = {
ExtensionSettings = {
"*" = {
blocked_install_message = "You can't have manual extension mixed with nix extensions";
installation_mode = "blocked";
};
};
};
lockPrefs = {
"extensions.getAddons.showPane" = false;
"extensions.htmlaboutaddons.recommendations.enabled" = false;
"app.update.auto" = false;
};
};
myFirefox = super.firefox.override {
config = super.lib.pipe super.firefox.defaultConfig [
self.firefoxCustomization.enableDarkDevTools
self.firefoxCustomization.disableManualExtensions
];
};
}) |
Ohh this is nice. Yeah seems like a good idea |
Sorry somehow I cherry picked the wrong commit version. I added now everything that was missing. |
.direnv | ||
shell.nix | ||
.history | ||
pkgs/applications/search/deezer-downloader/ |
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 don't have anything against expanding gitignore, but another-package-specific entry is probably too unrelted
(builtins.toJSON enterprisePolicies); | ||
|
||
mozillaCfg = builtins.toFile "mozilla.cfg" '' | ||
// First line must be a comment |
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 think ''
strips indentation if it is equal throught the string, so no need to have zero indentation here
|
||
// Remove default top sites | ||
lockPref("browser.newtabpage.pinned", ""); | ||
lockPref("browser.newtabpage.activity-stream.default.sites", ""); |
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.
If we generate the policy unconditionally, shouldn't disbling any functionlity be conditional on some flag?
Thank you for your contributions.
|
Oh, sad to see this closed. Didn't look at the implementation, but the feature is wanted (by me at least). |
I made an overhauled version of it: #91724 |
This pull request adds two main features.
I used and added features to the code from #57554 as a reference as the pull request is sadly on hold.
An example for a Firefox extension nix package would be:
https://github.com/Luis-Hebendanz/nix-configs/blob/master/own-pkgs/ublock-origin/default.nix
or if the extension does not provide an extension id it would be like this:
https://github.com/Luis-Hebendanz/nix-configs/blob/master/own-pkgs/canvas-fingerprint-defender/default.nix
An example on how to call the wrapper is located here:
https://github.com/Luis-Hebendanz/nix-configs/blob/master/firefox.nix
I am sure that some things can be improved. Sadly I have very limited time but many people want this so I am putting this up. If you have improvement ideas please add them directly as a commit because I do not have the time to implement them myself ^^
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @Lassulus