dotfiles-guix/home/nix/programs/firefox.nix

294 lines
9 KiB
Nix

{ config, pkgs, ... }:
let
lock-false = {
Value = false;
Status = "locked";
};
lock-true = {
Value = true;
Status = "locked";
};
in
{
programs.firefox = {
enable = true;
policies = {
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
EmailTracking = true;
};
# Certificates
Certificates = {
ImportEnterpriseRoots = true;
Install = [
"freya_ca.crt"
"tinternet.crt"
];
};
# Cookies
Cookies = {
Behavior = "reject-foreign";
BehaviorPrivateBrowsing = "reject-foreign";
Locked = true;
};
# DNS
DNSOverHTTPS = {
Enabled = false;
Locked = true;
};
# Disable Bad
DisableAppUpdate = true;
DisableAccounts = true;
DisableFirefoxAccounts = true;
DisableFirefoxScreenshots = true;
DisableFirefoxStudies = true;
DisablePocket = true;
DisableTelemetry = true;
AutofillAddressEnabled = false;
AutofillCreditCardEnabled = false;
# Disable Certain Messages
UserMessaging = {
WhatsNew = false;
ExtensionRecommendations = false;
FeatureRecommendations = false;
UrlbarInterventions = false;
SkipOnboarding = true;
MoreFromMozilla = false;
Labs = false;
Locked = true;
};
# Disable Password Manager
PasswordManagerEnabled = false;
PrimaryPassword = false;
OfferToSaveLogins = false;
# Remove Special Pages
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
# Start Page
Homepage = {
StartPage = "previous-session";
Loked = true;
};
# Home Page
FirefoxHome = {
Search = true;
TopSites = false;
SponsoredTopSites = false;
Highlights = false;
Pocket = false;
SponsoredPocket = false;
Snippets = false;
Locked = true;
};
# Search Suggestions
SearchSuggestEnabled = true;
FirefoxSuggest = {
WebSuggestions = false;
SponsoredSuggestions = false;
ImproveSuggest = false;
Locked = true;
};
# Save All on Shutdown
SanitizeOnShutdown = {
Cache = false;
Cookies = false;
Downloads = false;
Histroy = false;
Sessions = false;
SiteSettings = false;
OfflineApps = false;
Locked = true;
};
# Popups
PopupBlocking = {
Default = true;
Locked = true;
};
# Allow Bypasses
DisableSecurityBypass = {
InvalidCertificate = false;
SafeBrowsing = false;
};
# PictureInPicure
PictureInPicture = {
Enabled = true;
Locked = true;
};
# Topbar
SearchBar = "unified";
DisplayMenuBar = "default-off";
DisplayBookmarksToolbar = "newtab";
NoDefaultBookmarks = true;
# Miscellaneous
HttpsOnlyMode = "force_enabled";
HardwareAcceleration = true;
DontCheckDefaultBrowser = true;
PromptForDownloadLocation = false;
PrivateBrowsingModeAvailability = 0;
# Extensions
ExtensionSettings = {
"*".installation_mode = "blocked";
# uBlock Origin
"uBlock0@raymondhill.net" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "force_installed";
};
# Bitwarden
"{446900e4-71c2-419f-a6a7-df9c091e268b}" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi";
installation_mode = "force_installed";
};
# User Agent Switcher
"user-agent-switcher@ninetailed.ninja" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/uaswitcher/latest.xpi";
installation_mode = "force_installed";
};
# SponsorBlock
"sponsorBlocker@ajay.app" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/sponsorblock/latest.xpi";
installation_mode = "force_installed";
};
# Privacy Badger
"jid1-MnnxcxisBPnSXQ@jetpack" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi";
installation_mode = "force_installed";
};
};
# about:config Preferences
Preferences = {
# theme
"toolkit.legacyUserProfileCustomizations.stylesheets" = lock-true;
"extensions.activeThemeID" = {
Value = "firefox-compact-dark@mozilla.org";
Status = "locked";
};
# homepage
"browser.startup.homepage" = {
Value = " about:home";
Status = "locked";
};
"browser.newtabpage.enabed" = lock-true;
"browser.newtabpage.url" = {
Value = " about:home";
Status = "locked";
};
# search enable
"browser.urlbar.suggest.recentsearches" = lock-true;
"browser.urlbar.suggest.bookmark" = lock-true;
"browser.urlbar.suggest.clipboard" = lock-true;
"browser.urlbar.suggest.history" = lock-true;
# search disable
"browser.urlbar.suggest.addons" = lock-false;
"browser.urlbar.suggest.calculator" = lock-false;
"browser.urlbar.suggest.engines" = lock-false;
"browser.urlbar.suggest.fakespot" = lock-false;
"browser.urlbar.suggest.mdn" = lock-false;
"browser.urlbar.suggest.openpage" = lock-false;
"browser.urlbar.suggest.pocket" = lock-false;
"browser.urlbar.suggest.remotetab" = lock-false;
"browser.urlbar.suggest.topsites" = lock-false;
"browser.urlbar.suggest.trending" = lock-false;
"browser.urlbar.suggest.weather" = lock-false;
"browser.urlbar.suggest.yelp" = lock-false;
# privacy
"privacy.globalprivacycontrol.enabled" = lock-true;
# security
"security.OCSP.enabled" = {
Value = 0;
Status = "locked";
};
"browser.contentblocking.category" = {
Value = "strict";
Status = "locked";
};
"xpinstall.whitelist.required" = lock-true;
"signon.management.page.breach-alerts.enabled" = lock-false;
# graphics
"dom.webgpu.enabled" = lock-true;
"media.eme.enabled" = lock-true;
# tabs
"browser.tabs.inTitlebar" = {
Value = 1;
Status = "locked";
};
"browser.tabs.warnOnClose" = lock-true;
"browser.tabs.firefox-view" = lock-false;
# user messaging
"browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false;
"browser.newtabpage.activity-stream.feeds.snippets" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false;
"browser.newtabpage.activity-stream.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.system.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false;
# safebrowsing
"browser.safebrowsing.malware.enabled" = lock-true;
"browser.safebrowsing.phishing.enabled" = lock-true;
"browser.safebrowsing.downloads.enabled" = lock-true;
"browser.safebrowsing.downloads.remote.block_uncommon" = lock-false;
"browser.safebrowsing.downloads.remote.block_potentially_unwanted" = lock-false;
};
};
profiles = {
"freya" = {
settings = {
# general settings
"general.autoScroll" = lock-false;
"general.smoothScroll" = lock-true;
"widget.gtk.overlay-scrollbars.enabled" = lock-false;
"accessibility.browsewithcaret" = lock-false;
"accessibility.typeaheadfind" = lock-false;
"media.hardwaremediakeys.enabled" = lock-true;
"browser.crashReports.unsubmittedCheck.autoSubmit2" = lock-false;
};
search = {
force = true;
default = "DuckDuckGo";
engines = {
"Google".metaData.hidden = true;
"Bing".metaData.hidden = true;
"Amazon.com".metaData.hidden = true;
"eBay".metaData.hidden = true;
"Twitter".metaData.hidden = true;
};
};
userChrome = ''
#firefox-view-button {
visibility: collapse;
}
#alltabs-button {
visibility: collapse;
}
#tabbrowser-tabs {
border-inline-start: none !important;
}
'';
};
};
};
}