nixos/home/modules/firefox/default.nix

142 lines
3.9 KiB
Nix
Raw Normal View History

{ lib, pkgs, ... }:
{
programs.firefox = {
enable = true;
profiles.default = {
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
ublock-origin
private-relay
libredirect
reddit-enhancement-suite
enhancer-for-youtube
qr-code-address-bar
];
settings = {
"browser.newtabpage.pinned" = [
{
label = "Arch Wiki";
url = "https://wiki.archlinux.org";
}
{
label = "Translate";
url = "https://mozhi.pussthecat.org";
}
{
label = "ChatGPT";
url = "https://chatgpt.com";
}
{
label = "YouTube";
url = "https://youtube.com";
}
{
label = "Reddit";
url = "https://old.reddit.com";
}
{
label = "4chan";
url = "https://www.4chan.org/frames";
}
];
"browser.aboutConfig.showWarning" = false;
"browser.translations.automaticallyPopup" = false;
"browser.tabs.inTitlebar" = 0;
"services.sync.engine.addons" = false;
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"extensions.autoDisableScopes" = 0;
};
search = {
force = true;
default = "DuckDuckGo";
engines = let
makeShortcuts = let
prefix = "@";
in map (shortcut: prefix + shortcut);
hideEngines = let
hideEngine = engine: {
name = engine;
value = {
metaData.hidden = true;
};
};
in engines: lib.listToAttrs (map hideEngine engines);
in (hideEngines [ "Google" "Bing" "Amazon.com" "eBay" ]) //
{
"Arch Wiki" = {
urls = [{ template = "https://wiki.archlinux.org/index.php?search={searchTerms}"; }];
iconUpdateURL = "https://wiki.archlinux.org/favicon.ico";
definedAliases = makeShortcuts [ "archlinux" "aw" ];
};
"Nix Packages" = {
urls = [{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "channel"; value = "unstable"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = makeShortcuts [ "nixpkgs" "packages" "np" ];
};
"NixOS Wiki" = {
urls = [{ template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; }];
iconUpdateURL = "https://wiki.nixos.org/favicon.png";
definedAliases = makeShortcuts [ "nixos" "nw" ];
};
"MyNixOS" = {
urls = [{ template = "https://mynixos.com/search?q={searchTerms}"; }];
iconUpdateURL = "https://mynixos.com/favicon-light.svg";
definedAliases = makeShortcuts [ "mynixos" "mw" ];
};
"RuTracker" = {
urls = [{ template = "https://rutracker.org/forum/tracker.php?nm={searchTerms}"; }];
iconUpdateURL = "https://rutracker.org/favicon.ico";
definedAliases = makeShortcuts [ "rutracker" "rt" ];
};
};
};
};
policies = {
DontCheckDefaultBrowser = true;
DisableFirefoxStudies = true;
DisableTelemetry = true;
DisablePocket = true;
EnableTrackingProtection = {
Value = true;
Locked = false;
Cryptomining = true;
EmailTracking = true;
Fingerprinting = true;
Exceptions = [];
};
FirefoxHome = {
SponsoredTopSites = false;
SponsoredPocket = false;
Pocket = false;
};
StartDownloadsInTempDirectory = true;
};
};
}