languagePacks installs the pack and the policy reports it as active, but the interface stayed English: installing is not switching, the same split the theme already had. Firefox does not fall back to LANG either, although de_DE.UTF-8 reaches the process. RequestedLocales is what switches to it. Three settings from the same first run: address autofill, payment autofill, and the three Firefox Suggest switches. The autofill pair are preferences. Suggest is a policy instead, because its preferences already ship as false and the profile sets no user value while the switches were on — something enables them at runtime, which a preference set as a default does not survive. ImproveSuggest is named rather than left to follow from the other two, so the data collection cannot come back if Suggest is ever turned on again.
140 lines
6.0 KiB
Nix
140 lines
6.0 KiB
Nix
# ABOUTME: Firefox with its preconfiguration, and Chromium as the second browser.
|
|
# ABOUTME: Carries the default-handler registration the two of them make necessary.
|
|
|
|
{ pkgs, moonarchPkgs, ... }:
|
|
|
|
let
|
|
# The Firefox theme's add-on ID, read twice below: once to install the theme,
|
|
# once to select it. This is upstream Catppuccin's own build; the similarly
|
|
# named catppuccin-mocha on the same store belongs to a third party.
|
|
catppuccinThemeId = "{8446b178-c865-4f5c-8ccc-1d7887811ae3}";
|
|
in
|
|
{
|
|
# Browser. moonarch runs waterfox-bin, which nixpkgs does not carry; see
|
|
# DECISIONS.md for why this is not packaged here.
|
|
#
|
|
# The module puts the wrapped Firefox into environment.systemPackages itself,
|
|
# which is why the package list below names only the second browser.
|
|
# autoConfigFiles is what carries Betterfox: the wrapper concatenates every
|
|
# file named here into mozilla.cfg, which Firefox reads before a profile
|
|
# exists — the only way in without home-manager.
|
|
programs.firefox = {
|
|
enable = true;
|
|
languagePacks = [ "de" ];
|
|
autoConfigFiles = [ "${moonarchPkgs.betterfox}/user.cfg" ];
|
|
|
|
# Betterfox rewrites user_pref to defaultPref so that each of its 115 values
|
|
# stays changeable in about:config. This option defaults to "locked", which
|
|
# would nail these three down harder than the set they sit in.
|
|
preferencesStatus = "default";
|
|
preferences = {
|
|
"general.autoScroll" = true;
|
|
|
|
# Only the offer to translate. Translating by hand from the context menu
|
|
# keeps working.
|
|
"browser.translations.automaticallyPopup" = false;
|
|
|
|
# ExtensionSettings installs the theme but does not select it; without
|
|
# this, Firefox starts on the default look with Catppuccin sitting unused
|
|
# in the add-on manager.
|
|
"extensions.activeThemeID" = catppuccinThemeId;
|
|
|
|
# The two autofill switches in the privacy settings, "Save and fill
|
|
# addresses" and "Save and fill payment methods". Each carries a capture
|
|
# half as a child preference, so one switch covers both storing and
|
|
# filling. Betterfox leaves these alone; Firefox ships them on.
|
|
"extensions.formautofill.addresses.enabled" = false;
|
|
"extensions.formautofill.creditCards.enabled" = false;
|
|
};
|
|
|
|
# normal_installed rather than force_installed: both add-ons stay removable.
|
|
# Leaving LibreWolf was about hardening that could only be undone by hand.
|
|
#
|
|
# The latest.xpi URLs redirect to whatever the current version is, so
|
|
# neither add-on needs a version bump here.
|
|
policies = {
|
|
ExtensionSettings = {
|
|
"uBlock0@raymondhill.net" = {
|
|
installation_mode = "normal_installed";
|
|
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
|
|
};
|
|
${catppuccinThemeId} = {
|
|
installation_mode = "normal_installed";
|
|
install_url = "https://addons.mozilla.org/firefox/downloads/latest/catppuccin-mocha-lavender-git/latest.xpi";
|
|
};
|
|
};
|
|
|
|
# languagePacks installs the German pack, it does not switch to it — the
|
|
# same split as the theme above. Firefox does not derive this from LANG
|
|
# either: without the policy the interface stays English with the pack
|
|
# sitting installed and active.
|
|
RequestedLocales = [ "de" ];
|
|
|
|
# The three suggestion switches in the search settings. Their preferences
|
|
# ship as false and no user value sets them, so something enables them at
|
|
# runtime — the policy is what holds against that. From Firefox 146 on,
|
|
# WebSuggestions switches Suggest off as a whole; this is 156.
|
|
#
|
|
# ImproveSuggest is the data collection behind it: what gets typed into
|
|
# the address bar goes to Mozilla to improve the suggestions. It is stated
|
|
# rather than left to follow from the other two, so it does not come back
|
|
# if Suggest is ever turned on again.
|
|
FirefoxSuggest = {
|
|
WebSuggestions = false;
|
|
SponsoredSuggestions = false;
|
|
ImproveSuggest = false;
|
|
};
|
|
|
|
SearchEngines.Default = "DuckDuckGo";
|
|
OfferToSaveLogins = false;
|
|
|
|
# Startup and the home button both land on a blank page. StartPage
|
|
# "homepage" is what makes the URL apply to startup as well; "none" would
|
|
# reach the same screen but leave the home button pointing elsewhere.
|
|
Homepage = {
|
|
URL = "about:blank";
|
|
StartPage = "homepage";
|
|
};
|
|
|
|
# A new tab opens blank as well, rather than on the Firefox start page
|
|
# with its search field and shortcuts.
|
|
NewTabPage = false;
|
|
|
|
# The initial state only — the toolbar stays something you can bring back
|
|
# from the View menu. There is no policy that locks it away.
|
|
DisplayBookmarksToolbar = "never";
|
|
|
|
# This is the Sync policy. There is no DisableSync: the CCK2 name of this
|
|
# one is disableSync, and it sets identity.fxaccounts.enabled.
|
|
DisableFirefoxAccounts = true;
|
|
|
|
# DisablePocket is deprecated and, by Mozilla's own note, leaves the new
|
|
# tab page alone. FirefoxHome covers that half: Stories replaced Pocket
|
|
# there in Firefox 141, after the service was discontinued.
|
|
DisablePocket = true;
|
|
FirefoxHome = {
|
|
Stories = false;
|
|
SponsoredStories = false;
|
|
};
|
|
};
|
|
};
|
|
|
|
# Both browsers claim x-scheme-handler/http in their desktop entries, and
|
|
# with two candidates xdg-open picks by whatever order it finds them in.
|
|
# These four types are exactly what firefox.desktop declares.
|
|
xdg.mime.defaultApplications = {
|
|
"text/html" = "firefox.desktop";
|
|
"application/xhtml+xml" = "firefox.desktop";
|
|
"x-scheme-handler/http" = "firefox.desktop";
|
|
"x-scheme-handler/https" = "firefox.desktop";
|
|
};
|
|
|
|
environment.systemPackages = [
|
|
# Second browser, for testing against a Blink engine. The ungoogled
|
|
# variant because the stock chromium carries the Google endpoints; it is
|
|
# fully substitutable, so the patch set does not have to be built here.
|
|
# Firefox comes from programs.firefox above and is the default handler.
|
|
pkgs.ungoogled-chromium
|
|
];
|
|
}
|