nix/home-mods/firefox/default.nix

216 lines
6.1 KiB
Nix

{ config
, lib
, pkgs
, ...
}: {
programs.firefox = {
enable = true;
package = pkgs.firefox;
profiles = {
default = {
isDefault = true;
settings = {
# Extensions are managed with Nix, so don't update.
"extensions.update.autoUpdateDefault" = false;
"extensions.update.enabled" = false;
# Sync
# "services.sync.username" = config.etu.user.email;
"services.sync.engine.addons" = false; # Do not sync extensions.
"general.autoScroll" = true; # Middle click to scroll
"browser.startup.page" = 3; # Restore previous windows and tabs.
# Privacy enhancements
"browser.newtabpage.activity-stream.feeds.telemetry" = false;
"browser.newtabpage.activity-stream.telemetry" = false;
"browser.newtabpage.activity-stream.feeds.snippets" = false;
"browser.newtabpage.activity-stream.feeds.section.topstories" = false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
"browser.newtabpage.activity-stream.showSponsored" = false;
"browser.newtabpage.activity-stream.feeds.discoverystreamfeed" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
# Improve performance
"gfx.webrender.all" = true;
# Do Not Track header
"privacy.donottrackheader.enabled" = true;
"privacy.donottrackheader.value" = 1;
# Enable userChrome customisations
# "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
};
extensions = with config.nur.repos.rycee.firefox-addons; [
bitwarden
clearurls
consent-o-matic
darkreader
dearrow
deutsch-de-language-pack
dictionary-german
localcdn
plasma-integration
privacy-badger
rust-search-extension
leechblock-ng
sidebery
skip-redirect
sponsorblock
tab-stash
ublock-origin
unpaywall
];
search = {
force = true;
default = "DuckDuckGo";
order = [ "DuckDuckGo" "Nix Packages" "Nix Options" "NixOS Wiki" ];
engines = {
"DuckDuckGo".metaData = {
alias = "@ddg";
};
"Nix Packages" = {
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"Nix Options" = {
urls = [
{
template = "https://search.nixos.org/options";
params = [
{
name = "type";
value = "options";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"Home-Manager Options" = {
urls = [
{
template = "https://mipmip.github.io/home-manager-option-search";
params = [
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@ho" ];
};
"NixOS Wiki" = {
urls = [
{
template = "https://nixos.wiki/index.php?search={searchTerms}";
}
];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000;
definedAliases = [ "@nw" ];
};
"Bing".metaData.hidden = true;
"Amazon.de".metaData.hidden = true;
"Google".metaData = {
alias = "@g";
hidden = true;
};
};
};
bookmarks = [
{
toolbar = true;
bookmarks = [
{
name = "Home Manager";
url = "https://nixos.wiki/wiki/Home_Manager";
}
];
}
{
name = "wikipedia";
tags = [ "wiki" ];
keyword = "wiki";
url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go";
}
{
name = "kernel.org";
url = "https://www.kernel.org";
}
{
name = "Nix sites";
bookmarks = [
{
name = "homepage";
url = "https://nixos.org/";
}
{
name = "wiki";
tags = [ "wiki" "nix" ];
url = "https://nixos.wiki/";
}
{
name = "Nix sites";
bookmarks = [
{
name = "homepage";
url = "https://nixos.org/";
}
{
name = "wiki";
url = "https://nixos.wiki/";
}
];
}
];
}
];
};
};
};
home.sessionVariables = {
BROWSER = "firefox";
MOZ_USE_XINPUT2 = "1";
MOZ_ENABLE_WAYLAND = "1";
};
}