refactor: Move user config into modules/
This commit is contained in:
142
modules/home/users/crumb/firefox.nix
Normal file
142
modules/home/users/crumb/firefox.nix
Normal file
@@ -0,0 +1,142 @@
|
||||
{ config, lib, pkgs, inputs, ... }@args:
|
||||
|
||||
let
|
||||
cfg = config.sydnix.users.crumb.firefox;
|
||||
in {
|
||||
options.sydnix.users.crumb.firefox.enable =
|
||||
lib.mkEnableOption "Firefox, à la crumb";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
|
||||
# Available language codes can be found on the releases page:
|
||||
# https://releases.mozilla.org/pub/firefox/releases/134.0.2/linux-x86_64/xpi/.
|
||||
# The string `134.0.2` may be substituted for any other Firefox release
|
||||
# number.
|
||||
languagePacks = [
|
||||
"en-US"
|
||||
"en-GB"
|
||||
];
|
||||
|
||||
# Available options can be found at
|
||||
# https://mozilla.github.io/policy-templates/.
|
||||
policies = {
|
||||
DisableTelemetry = true;
|
||||
DisableFirefoxStudies = false;
|
||||
EnableTrackingProtection = {
|
||||
Value = true;
|
||||
Locked = true;
|
||||
Cryptomining = true;
|
||||
Fingerprinting = true;
|
||||
};
|
||||
FirefoxHome = {
|
||||
Search = true;
|
||||
TopSites = true;
|
||||
SponsoredTopSites = false;
|
||||
Highlights = false;
|
||||
Pocket = false;
|
||||
SponsoredPocket = false;
|
||||
Snippets = false;
|
||||
Locked = false;
|
||||
};
|
||||
# Weird advertiser shit.
|
||||
FirefoxSuggest = {
|
||||
WebSuggestions = false;
|
||||
SponsoredSuggestions = false;
|
||||
ImproveSuggest = false;
|
||||
Locked = false;
|
||||
};
|
||||
# Weird advertiser shit.
|
||||
DisablePocket = true;
|
||||
DisableFirefoxAccounts = true;
|
||||
DisableAccounts = true;
|
||||
# Firefox has an in-built screenshot tool that I do not need.
|
||||
DisableFirefoxScreenshots = true;
|
||||
# Disable pop-up windows that appear after installation and updates.
|
||||
OverrideFirstRunPage = "";
|
||||
OverridePostUpdatePage = "";
|
||||
# You think you're so important, don't you, Firefox?
|
||||
DontCheckDefaultBrowser = true;
|
||||
# Only tabs not yet visiting a page. Alternatives: `always`, `never`,
|
||||
# `newtab`.
|
||||
DisplayBookmarksToolbar = "newtab";
|
||||
# Alternatives: `always`, `never`, `default-on`, `default-on`.
|
||||
DisplayMenuBar = "default-off";
|
||||
# Alternative: `unified`, `separate`.
|
||||
SearchBar = "unified";
|
||||
};
|
||||
|
||||
profiles."msyds" = {
|
||||
bookmarks = [];
|
||||
|
||||
# Check about:support for extension/add-on ID strings.
|
||||
extensions = {
|
||||
# Override non-declared settings.
|
||||
force = true;
|
||||
packages =
|
||||
let pkgs' = import inputs.nixpkgs {
|
||||
system = args.system;
|
||||
overlays = [ inputs.nur.overlays.default ];
|
||||
};
|
||||
in
|
||||
with pkgs'.nur.repos.rycee.firefox-addons; [
|
||||
ublock-origin
|
||||
darkreader
|
||||
privacy-badger
|
||||
vimium
|
||||
kagi-search
|
||||
duckduckgo-privacy-essentials
|
||||
edit-with-emacs
|
||||
copy-as-org-mode
|
||||
clearurls
|
||||
];
|
||||
};
|
||||
|
||||
search = {
|
||||
# Override non-declared settings.
|
||||
force = true;
|
||||
# Precedence of search engines.
|
||||
order = [ "Kagi" "DuckDuckGo" ];
|
||||
default = "Kagi";
|
||||
privateDefault = "DuckDuckGo";
|
||||
engines = {
|
||||
"Nixpkgs" = {
|
||||
urls = [{
|
||||
template = "https://search.nixos.org/packages";
|
||||
params = [
|
||||
{ name = "type"; value = "packages"; }
|
||||
{ name = "query"; value = "{searchTerms}"; }
|
||||
];
|
||||
}];
|
||||
icon =
|
||||
"${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
||||
definedAliases = [ "!np" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# See `about:config` in Firefox for available settings.
|
||||
settings = {
|
||||
# Disable suggestions.
|
||||
"browser.search.suggest.enabled" = false;
|
||||
# Enable dark theme for non-website UI; the URL bar and such.
|
||||
"extensions.activeThemeID" = "firefox-compact-dark@mozilla.org";
|
||||
"browser.theme.content-theme" = 0;
|
||||
"browser.theme.toolbar-theme" = 0;
|
||||
"browser.in-content.dark-mode" = true;
|
||||
"ui.systemUsesDarkTheme" = 1;
|
||||
# Disable sponsored suggestions.
|
||||
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
|
||||
"browser.newtabpage.activity-stream.system.showSponsored" = false;
|
||||
"browser.newtabpage.activity-stream.showSponsored" = false;
|
||||
"browser.urlbar.sponsoredTopSites" = false;
|
||||
"services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsored"
|
||||
= false;
|
||||
"services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSites"
|
||||
= false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user