programs/browsers/firefox: move policies to wrapFirefox (make it rebuild itself)

This commit is contained in:
Anthony Rodriguez 2024-10-24 18:22:36 +02:00
parent 1745932cd8
commit 7bf11e55b6
Signed by: nezia
GPG key ID: EE3BE97C040A86CE

View file

@ -12,47 +12,81 @@
in { in {
programs.firefox = { programs.firefox = {
enable = true; enable = true;
policies = { package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
DisableTelemetry = true; extraPolicies = {
DisablePocket = true; DisableTelemetry = true;
DisableFeedbackCommands = true; DisablePocket = true;
DisableFirefoxStudies = true; DisableFeedbackCommands = true;
OfferToSaveLogins = false; DisableFirefoxStudies = true;
OffertosaveloginsDefault = false; OfferToSaveLogins = false;
PasswordManagerEnabled = false; OffertosaveloginsDefault = false;
SearchSuggestEnabled = true; PasswordManagerEnabled = false;
SearchSuggestEnabled = true;
# https://github.com/Sly-Harvey/NixOS/blob/f9da2691ea46565256ad757959cfc26ec6cee10d/modules/programs/browser/firefox/default.nix#L58-L163 # https://github.com/Sly-Harvey/NixOS/blob/f9da2691ea46565256ad757959cfc26ec6cee10d/modules/programs/browser/firefox/default.nix#L58-L163
# TODO: declare which block lists are needed "3rdparty".Extensions = {
"3rdparty".Extensions = { "addon@darkreader.org" = {
"addon@darkreader.org" = { permissions = ["internal:privateBrowsingAllowed"];
permissions = ["internal:privateBrowsingAllowed"];
enabled = true;
automation = {
enabled = true; enabled = true;
behavior = "OnOff"; automation = {
mode = "system"; enabled = true;
behavior = "OnOff";
mode = "system";
};
detectDarkTheme = true;
enabledByDefault = true;
changeBrowserTheme = false;
enableForProtectedPages = true;
fetchNews = false;
previewNewDesign = true;
}; };
detectDarkTheme = true; "uBlock0@raymondhill.net" = {
enabledByDefault = true; permissions = ["internal:privateBrowsingAllowed"];
changeBrowserTheme = false; advancedSettings = [
enableForProtectedPages = true; [
fetchNews = false; "userResourcesLocation"
previewNewDesign = true; "https://raw.githubusercontent.com/pixeltris/TwitchAdSolutions/master/video-swap-new/video-swap-new-ublock-origin.js"
}; ]
"uBlock0@raymondhill.net" = { ];
permissions = ["internal:privateBrowsingAllowed"]; adminSettings = {
advancedSettings = [ userSettings = {
[ uiTheme = "dark";
"userResourcesLocation" advancedUserEnabled = true;
"https://raw.githubusercontent.com/pixeltris/TwitchAdSolutions/master/video-swap-new/video-swap-new-ublock-origin.js" userFiltersTrusted = true;
] importedLists = [
]; "https://raw.githubusercontent.com/laylavish/uBlockOrigin-HUGE-AI-Blocklist/main/list.txt"
adminSettings = { ];
userSettings = { selectedFilterLists = [
uiTheme = "dark"; "FRA-0"
advancedUserEnabled = true; "adguard-cookies"
userFiltersTrusted = true; "adguard-mobile-app-banners"
"adguard-other-annoyances"
"adguard-popup-overlays"
"adguard-social"
"adguard-spyware-url"
"adguard-widgets"
"easylist"
"easylist-annoyances"
"easylist-chat"
"easylist-newsletters"
"easylist-notifications"
"easyprivacy"
"fanboy-cookiemonster"
"https://filters.adtidy.org/extension/ublock/filters/3.txt"
"https://github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt"
"plowe-0"
"ublock-annoyances"
"ublock-badware"
"ublock-cookies-adguard"
"ublock-cookies-easylist"
"ublock-filters"
"ublock-privacy"
"ublock-quick-fixes"
"ublock-unbreak"
"urlhaus-1"
"https://raw.githubusercontent.com/laylavish/uBlockOrigin-HUGE-AI-Blocklist/main/list.txt"
];
};
}; };
}; };
}; };
@ -73,7 +107,6 @@ in {
ublock-origin ublock-origin
violentmonkey violentmonkey
]; ];
# https://git.jacekpoz.pl/poz/niksos/src/commit/a48647a1c5bc6877a1100a65f4dc169b2fc11ed7/hosts/hape/firefox.nix # https://git.jacekpoz.pl/poz/niksos/src/commit/a48647a1c5bc6877a1100a65f4dc169b2fc11ed7/hosts/hape/firefox.nix
search = { search = {
default = "SearxNG"; default = "SearxNG";