nix-configs/hm-modules/firefox.nix
Lucy Hochkamp f7afa33a13
Some checks failed
ci/woodpecker/push/build-cache Pipeline failed
ci/woodpecker/cron/dependency-pr Pipeline was successful
update
2025-10-23 16:38:51 +02:00

435 lines
14 KiB
Nix

{
pkgs,
config,
lib,
inputs,
...
}:
let
cfg = config.xyno.firefox;
in
{
options.xyno.firefox.enable = lib.mkOption { default = false; };
config = lib.mkIf cfg.enable {
programs.zen-browser = {
enable = true;
languagePacks = [
"en-US"
"de"
];
policies = {
# Updates & Background Services
AppAutoUpdate = false;
BackgroundAppUpdate = false;
DisableSetDesktopBackground = true;
DisablePocket = true;
DisableTelemetry = true;
DisableFirefoxAccounts = true;
DontCheckDefaultBrowser = true;
PasswordManagerEnabled = false;
Proxy = {
# set up ssh socks proxy but don't enable it
Mode = "none";
Locked = false;
SOCKSProxy = "[::1]:12345";
SOCKSVersion = 5;
UseProxyForDns = true;
};
SkipTermsOfUse = true;
ExtensionSettings =
let
moz = name: "https://addons.mozilla.org/firefox/downloads/latest/${name}/latest.xpi";
in
{
"{d07ccf11-c0cd-4938-a265-2a4d6ad01189}" = {
# web archives
default_area = "navbar";
install_url = moz "view_page_archive";
installation_mode = "force_installed";
private_browsing = true;
};
"de_DE@dicts.j3e.de" = {
install_url = moz "german_dictionary_de_de_for_sp";
};
"uBlock0@raymondhill.net" = {
default_area = "navbar";
install_url = moz "ublock-origin";
installation_mode = "force_installed";
private_browsing = true;
};
"vimium-c@gdh1995.cn" = {
default_area = "navbar";
install_url = moz "vimium-c";
installation_mode = "force_installed";
private_browsing = true;
};
"keepassxc-browser@keepassxc.org" = {
default_area = "menupanel";
install_url = moz "keepassxc-browser";
installation_mode = "force_installed";
private_browsing = true;
};
"{aecec67f-0d10-4fa7-b7c7-609a2db280cf}" = {
default_area = "menupanel";
install_url = moz "violentmonkey";
installation_mode = "force_installed";
private_browsing = true;
};
"sponsorBlocker@ajay.app" = {
default_area = "menupanel";
install_url = moz "sponsorblock";
installation_mode = "force_installed";
private_browsing = true;
};
"clipper@obsidian.md" = {
default_area = "navbar";
install_url = moz "web-clipper-obsidian";
installation_mode = "force_installed";
private_browsing = true;
};
"@testpilot-containers" = {
default_area = "menupanel";
install_url = moz "multi_account_containers";
installation_mode = "force_installed";
private_browsing = true;
};
"{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}" = {
default_area = "menupanel";
install_url = moz "styl_us";
installation_mode = "force_installed";
private_browsing = true;
};
};
};
profiles.lucy = {
spacesForce = true;
spaces = {
main = {
id = "59c80d1b-ec79-4d65-a337-aa69e3af8614";
icon = "";
};
work = {
id = "7753b3d5-28e4-4575-9b8f-f9fa999bddd8";
position = 1001;
icon = "🚂";
container = 2;
};
};
containersForce = true;
containers = {
work = {
id = 2;
icon = "dollar";
color = "blue";
};
};
settings = {
"widget.use-xdg-desktop-portal.file-picker" = 1;
"font.default.x-western" = "sans-serif";
"font.name.sans-serif.x-western" = "Source Sans 3";
"font.name.monospace.x-western" = "JetBrainsMono Nerd Font";
"font.size.variable.x-western" = "14";
"browser.display.use_document_fonts" = "0";
"network.proxy.allow_hijacking_localhost" = true;
"browser.newtabpage.pinned" = builtins.toJSON [
# won't ever see that but whatever
{
url = "https://mastodon.catgirl.cloud";
label = "fedi";
}
{
url = "https://youtube.com";
label = "YouTube";
}
{
url = "https://tagesschau.de";
label = "Tagesschau";
}
{
url = "https://heise.de";
label = "heise";
}
{
url = "https://j.hailsatan.eu";
label = "Lucy+";
}
];
"privacy.trackingprotection.enabled" = true;
"privacy.trackingprotection.socialtracking.enabled" = true;
"privacy.trackingprotection.emailtracking.enabled" = true;
"privacy.fingerprintingProtection" = true;
"privacy.clearOnShutdown_v2.formdata" = true;
"privacy.history.custom" = true;
"privacy.query_stripping.enabled" = true;
"extensions.formautofill.addresses.enabled" = false;
"extensions.formautofill.creditCards.enabled" = false;
"zen.view.use-single-toolbar" = false;
"zen.welcome-screen.seen" = true;
"browser.translations.neverTranslateLanguages" = "de";
"dom.security.https_only_mode" = true;
"dom.security.https_only_mode_ever_enabled" = true;
# things ripped from https://github.com/yokoffing/Betterfox/blob/main/Fastfox.js
"media.memory_cache_max_size" = 65536;
"media.cache_readahead_limit" = 7200;
"media.cache_resume_threshold" = 3600;
"network.http.max-connections" = 1000;
"network.http.max-persistent-connections-per-server" = 10;
"network.http.max-urgent-start-excessive-connections-per-host" = 5;
"network.ssl_tokens_cache_capacity" = 10240;
"extensions.webextensions.ExtensionStorageIDB.enabled" = false;
};
bookmarks.force = true;
bookmarks.settings = [
{
name = "wikipedia";
tags = [ "wiki" ];
keyword = "wiki";
url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go";
}
{
name = "mastodon.catgirl.cloud";
tags = [ "fedi" ];
keyword = "fedi";
url = "https://mastodon.catgirl.cloud";
}
{
name = "YouTube";
tags = [ "video" ];
keyword = "yt";
url = "https://youtube.com";
}
{
name = "Lucy+";
tags = [ "video" ];
keyword = "j";
url = "https://j.hailsatan.eu";
}
{
name = "tagesschau.de";
tags = [ "news" ];
keyword = "tagesschau";
url = "https://tagesschau.de";
}
{
name = "heise.de";
tags = [ "news" ];
keyword = "heise";
url = "https://heise.de";
}
"separator"
{
name = "Nix sites";
toolbar = true;
bookmarks = [
{
name = "Nixpkgs Manual";
tags = [
"nix"
];
url = "https://ryantm.github.io/nixpkgs/";
}
{
name = "NixOS Manual";
tags = [
"nix"
];
url = "https://nixos.org/manual/nixos/stable/#sec-option-declarations";
}
{
name = "Home Manager Options";
tags = [
"nix"
];
url = "https://nix-community.github.io/home-manager/options.xhtml";
}
{
name = "homepage";
url = "https://nixos.org/";
}
{
name = "wiki";
tags = [
"wiki"
"nix"
];
url = "https://wiki.nixos.org/";
}
];
}
];
extensions.force = true;
extensions.settings = {
"{d07ccf11-c0cd-4938-a265-2a4d6ad01189}".settings = {
engines = [
"archiveIs"
"archiveOrg"
"archiveOrgAll"
"yandex"
"archiveIsAll"
"memento"
"permacc"
"megalodon"
"ghostarchive"
"webcite"
];
menuItems = [
"openCurrentDoc_1"
"sep_1"
"search_allEngines_1"
"sep_2"
"search_archiveIs_1"
"search_archiveOrg_1"
"search_yandex_1"
"search_memento_1"
"search_permacc_1"
"search_megalodon_1"
"search_ghostarchive_1"
"search_webcite_1"
];
};
"vimium-c@gdh1995.cn".settings = {
searchEngines = ''
g|go|gg|google|Google: https://www.google.com/search?q=%s \\
www.google.com re=/^(?:\\.[a-z]{2,4})?\\/search\\b.*?[#&?]q=([^#&]*)/i \\
blank=https://www.google.com/ Google
g.m|gm|g.map|gmap: https://www.google.com/maps?q=%s \\
blank=https://www.google.com/maps Google Maps
y|yt: https://www.youtube.com/results?search_query=%s \\
blank=https://www.youtube.com/ YouTube
w|wiki: https://www.wikipedia.org/w/index.php?search=%s Wikipedia
g.s|gs|gscholar: https://scholar.google.com/scholar?q=$s \\
scholar.google.com re=/^(?:\\.[a-z]{2,4})?\\/scholar\\b.*?[#&?]q=([^#&]*)/i \\
blank=https://scholar.google.com/ Google Scholar
a|ae|ali|alie|aliexp: https://www.aliexpress.com/wholesale?SearchText=%s \\
blank=https://www.aliexpress.com/ AliExpress
az|amazon: https://www.amazon.com/s?k=%s \\
blank=https://www.amazon.com/ Amazon
\\:i: vimium://sed/s/^//,lower\\ $S re= Lower case
v.m|math: vimium://math\\ $S re= Calculate
v.p: vimium://parse\\ $S re= Redo Search
gh|github: https://github.com/search?q=$s \\
blank=https://github.com/ GitHub Repo
ge|gitee: https://search.gitee.com/?type=repository&q=$s \\
blank=https://gitee.com/ Gitee
js\\:|Js: javascript:\\ $S; JavaScript
'';
keyLayout = 2;
scrollStepSize = 150;
searchUrl = "https://duckduckgo.com/?tq=$s DDG";
keyMappings = ''
#!no-check
unmap gs
map gs LinkHints.activateHover
map <c-i> enterInsertMode key="<c-esc>"
'';
};
"{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}".settings = {
dbInChromeStorage = true; # required for Stylus
};
"uBlock0@raymondhill.net".settings = {
selectedFilterLists = [
"user-filters"
"ublock-filters"
"ublock-badware"
"ublock-privacy"
"ublock-quick-fixes"
"ublock-unbreak"
"easylist"
"easyprivacy"
"urlhaus-1"
"plowe-0"
"fanboy-cookiemonster"
"ublock-cookies-easylist"
"fanboy-social"
"easylist-chat"
"easylist-newsletters"
"easylist-notifications"
"easylist-annoyances"
];
"user-filters" =
''marketplace.visualstudio.com##+js(rpnt, script, /"(DisableVSCodeDownloadButtonEnabled|Microsoft\\.VisualStudio\\.Services\\.Gallery\\.DisableVSCodeDownloadButton)":true/, "$1":false)'';
"hostnameSwitchesString" =
"no-large-media: behind-the-scene false\nno-remote-fonts: * true\nno-csp-reports: * true";
};
};
search = {
force = true;
default = "ddg";
privateDefault = "ddg";
engines = {
"Nix Packages" = {
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "channel";
value = "unstable";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"Nix Options" = {
urls = [
{
template = "https://search.nixos.org/options";
params = [
{
name = "channel";
value = "unstable";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"NixOS Wiki" = {
urls = [
{
template = "https://wiki.nixos.org/w/index.php";
params = [
{
name = "search";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@nw" ];
};
};
};
};
};
};
}