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 { config = lib.mkIf config.alyraffauf.apps.firefox.enable {
programs.firefox = { programs.firefox = {
enable = true; enable = true;
nativeMessagingHosts = lib.optionals (config.alyraffauf.apps.keepassxc.enable) [pkgs.keepassxc]; # 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;
};
}; };
}; };
} }

View file

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

View file

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

View file

@ -4,5 +4,5 @@
config, 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 = { options = {
alyraffauf = { alyraffauf = {
apps = { apps = {
firefox.enable = lib.mkOption {
description = "Firefox Web Browser.";
default = config.alyraffauf.desktop.enable;
type = lib.types.bool;
};
nicotine-plus.enable = nicotine-plus.enable =
lib.mkEnableOption "Nicotine+ Soulseek client."; lib.mkEnableOption "Nicotine+ Soulseek client.";
podman.enable = podman.enable =