firefox: move policies to nixos config

This commit is contained in:
Aly Raffauf 2024-06-24 14:01:07 -04:00
parent 89cfaaef1e
commit ab64b44497
6 changed files with 179 additions and 166 deletions

View file

@ -7,111 +7,7 @@
config = lib.mkIf config.alyraffauf.apps.firefox.enable {
programs.firefox = {
enable = true;
nativeMessagingHosts = lib.optionals (config.alyraffauf.apps.keepassxc.enable) [pkgs.keepassxc];
policies = {
Cookies.Behavior = "reject-foreign";
DisableFirefoxStudies = true;
DisableMasterPasswordCreation = true;
DisablePocket = true;
DisableProfileImport = true;
DisableSetDesktopBackground = true;
DisableTelemetry = true;
DisplayBookmarksToolbar = "newtab";
DNSOverHTTPS = {
Enabled = true;
Fallback = true;
};
DontCheckDefaultBrowser = true;
EnableTrackingProtection = {
Cryptomining = true;
Fingerprinting = true;
EmailTracking = true;
Locked = false;
Value = true;
};
EncryptedMediaExtensions = {
Enabled = true;
Locked = false;
};
ExtensionSettings =
{
"uBlock0@raymondhill.net" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "normal_installed";
};
"jid1-BoFifL9Vbdl2zQ@jetpack" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/decentraleyes/latest.xpi";
installation_mode = "normal_installed";
};
}
// lib.attrsets.optionalAttrs (config.alyraffauf.apps.keepassxc.enable) {
"keepassxc-browser@keepassxc.org" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/keepassxc-browser/latest.xpi";
installation_mode = "normal_installed";
};
};
FirefoxHome = {
Highlights = false;
Locked = false;
Pocket = false;
Search = true;
Snippets = false;
SponsoredPocket = false;
SponsoredTopSites = false;
TopSites = false;
};
FirefoxSuggest = {
ImproveSuggest = false;
Locked = false;
SponsoredSuggestions = false;
WebSuggestions = false;
};
HardwareAcceleration = true;
Homepage = {
Locked = false;
StartPage = "previous-session";
};
NewTabPage = false;
NoDefaultBookmarks = true;
OfferToSaveLoginsDefault = false;
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
PDFjs = {
Enabled = true;
EnablePermissions = false;
};
Preferences = {
"browser.aboutConfig.showWarning" = false;
"browser.bookmarks.addedImportButton" = false;
"datareporting.healthreport.uploadEnabled" = false;
"datareporting.policy.dataSubmissionPolicyAccepted" = true;
"datareporting.policy.firstRunURL" = "";
"dom.security.https_only_mode" = true;
"extensions.autoDisableScopes" = 0;
};
UserMessaging = {
ExtensionRecommendations = false;
FeatureRecommendations = false;
MoreFromMozilla = false;
SkipOnboarding = true;
};
UseSystemPrintDialog = true;
};
# nativeMessagingHosts = lib.optionals (config.alyraffauf.apps.keepassxc.enable) [pkgs.keepassxc];
};
};
}

View file

@ -38,6 +38,7 @@
home-manager.enable = true;
firefox = {
enable = true;
profiles.work = {
id = 1;
@ -63,9 +64,12 @@
profiles.default = {
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
augmented-steam
decentraleyes
keepassxc-browser
omnivore
sidebery
sponsorblock
ublock-origin
zoom-redirector
];
@ -75,7 +79,7 @@
default = "DuckDuckGo";
force = true;
engines = {
"Nix Packages" = {
"nixpkgs" = {
urls = [
{
template = "https://search.nixos.org/packages";
@ -122,64 +126,64 @@
"privacy.trackingprotection.socialtracking.enabled" = true;
"services.sync.prefs.sync.browser.uiCustomization.state" = true;
"browser.uiCustomization.state" = ''
{
"placements": {
"widget-overflow-fixed-list": [],
"unified-extensions-area": [
"ublock0_raymondhill_net-browser-action",
"sponsorblocker_ajay_app-browser-action",
"_019b606a-6f61-4d01-af2a-cea528f606da_-browser-action",
"jid1-bofifl9vbdl2zq_jetpack-browser-action"
],
"nav-bar": [
"back-button",
"forward-button",
"stop-reload-button",
"customizableui-special-spring1",
"urlbar-container",
"customizableui-special-spring2",
"downloads-button",
"save-extension_omnivore_app-browser-action",
"keepassxc-browser_keepassxc_org-browser-action",
"_3c078156-979c-498b-8990-85f7987dd929_-browser-action",
"unified-extensions-button",
"fxa-toolbar-menu-button"
],
"toolbar-menubar": [
"menubar-items"
],
"TabsToolbar": [
"firefox-view-button",
"tabbrowser-tabs",
"new-tab-button",
"alltabs-button"
],
"PersonalToolbar": [
"personal-bookmarks"
]
},
"seen": [
"save-extension_omnivore_app-browser-action",
"_019b606a-6f61-4d01-af2a-cea528f606da_-browser-action",
"sponsorblocker_ajay_app-browser-action",
"developer-button",
"keepassxc-browser_keepassxc_org-browser-action",
"ublock0_raymondhill_net-browser-action",
"jid1-bofifl9vbdl2zq_jetpack-browser-action",
"_3c078156-979c-498b-8990-85f7987dd929_-browser-action"
],
"dirtyAreaCache": [
"unified-extensions-area",
"nav-bar",
"toolbar-menubar",
"TabsToolbar",
"PersonalToolbar"
],
"currentVersion": 20,
"newElementCount": 4
}
'';
# "browser.uiCustomization.state" = ''
# {
# "placements": {
# "widget-overflow-fixed-list": [],
# "unified-extensions-area": [
# "ublock0_raymondhill_net-browser-action",
# "sponsorblocker_ajay_app-browser-action",
# "_019b606a-6f61-4d01-af2a-cea528f606da_-browser-action",
# "jid1-bofifl9vbdl2zq_jetpack-browser-action"
# ],
# "nav-bar": [
# "back-button",
# "forward-button",
# "stop-reload-button",
# "customizableui-special-spring1",
# "urlbar-container",
# "customizableui-special-spring2",
# "downloads-button",
# "save-extension_omnivore_app-browser-action",
# "keepassxc-browser_keepassxc_org-browser-action",
# "_3c078156-979c-498b-8990-85f7987dd929_-browser-action",
# "unified-extensions-button",
# "fxa-toolbar-menu-button"
# ],
# "toolbar-menubar": [
# "menubar-items"
# ],
# "TabsToolbar": [
# "firefox-view-button",
# "tabbrowser-tabs",
# "new-tab-button",
# "alltabs-button"
# ],
# "PersonalToolbar": [
# "personal-bookmarks"
# ]
# },
# "seen": [
# "save-extension_omnivore_app-browser-action",
# "_019b606a-6f61-4d01-af2a-cea528f606da_-browser-action",
# "sponsorblocker_ajay_app-browser-action",
# "developer-button",
# "keepassxc-browser_keepassxc_org-browser-action",
# "ublock0_raymondhill_net-browser-action",
# "jid1-bofifl9vbdl2zq_jetpack-browser-action",
# "_3c078156-979c-498b-8990-85f7987dd929_-browser-action"
# ],
# "dirtyAreaCache": [
# "unified-extensions-area",
# "nav-bar",
# "toolbar-menubar",
# "TabsToolbar",
# "PersonalToolbar"
# ],
# "currentVersion": 20,
# "newElementCount": 4
# }
# '';
};
};
};

View file

@ -42,7 +42,7 @@
};
desktop = {
hyprland = {
randomWallpaper = false;
randomWallpaper = true;
};
};
theme = {

View file

@ -4,5 +4,5 @@
config,
...
}: {
imports = [./nicotine-plus ./steam ./podman ./virt-manager];
imports = [./firefox ./nicotine-plus ./steam ./podman ./virt-manager];
}

View file

@ -0,0 +1,108 @@
{
config,
lib,
pkgs,
...
}: {
config = lib.mkIf config.alyraffauf.apps.firefox.enable {
programs.firefox = {
enable = true;
policies = {
Cookies.Behavior = "reject-foreign";
DisableAppUpdate = true;
DisableFirefoxStudies = true;
DisableMasterPasswordCreation = true;
DisablePocket = true;
DisableProfileImport = true;
DisableSetDesktopBackground = true;
DisableTelemetry = true;
DisplayBookmarksToolbar = "newtab";
DNSOverHTTPS = {
Enabled = true;
Fallback = true;
};
DontCheckDefaultBrowser = true;
EnableTrackingProtection = {
Cryptomining = true;
Fingerprinting = true;
EmailTracking = true;
Locked = false;
Value = true;
};
EncryptedMediaExtensions = {
Enabled = true;
Locked = false;
};
ExtensionSettings = {
"uBlock0@raymondhill.net" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "normal_installed";
};
"jid1-BoFifL9Vbdl2zQ@jetpack" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/decentraleyes/latest.xpi";
installation_mode = "normal_installed";
};
};
FirefoxHome = {
Highlights = false;
Locked = false;
Pocket = false;
Search = true;
Snippets = false;
SponsoredPocket = false;
SponsoredTopSites = false;
TopSites = false;
};
FirefoxSuggest = {
ImproveSuggest = false;
Locked = false;
SponsoredSuggestions = false;
WebSuggestions = false;
};
HardwareAcceleration = true;
Homepage = {
Locked = false;
StartPage = "previous-session";
};
NewTabPage = false;
NoDefaultBookmarks = true;
OfferToSaveLoginsDefault = false;
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
PDFjs = {
Enabled = true;
EnablePermissions = false;
};
Preferences = {
"browser.aboutConfig.showWarning" = false;
"browser.bookmarks.addedImportButton" = false;
"datareporting.healthreport.uploadEnabled" = false;
"datareporting.policy.dataSubmissionPolicyAccepted" = true;
"dom.security.https_only_mode" = true;
"extensions.autoDisableScopes" = 0;
};
UserMessaging = {
ExtensionRecommendations = false;
FeatureRecommendations = false;
MoreFromMozilla = false;
SkipOnboarding = true;
};
UseSystemPrintDialog = true;
};
};
};
}

View file

@ -9,6 +9,11 @@
options = {
alyraffauf = {
apps = {
firefox.enable = lib.mkOption {
description = "Firefox Web Browser.";
default = config.alyraffauf.desktop.enable;
type = lib.types.bool;
};
nicotine-plus.enable =
lib.mkEnableOption "Nicotine+ Soulseek client.";
podman.enable =