nixos-framework-laptop-config/home/apps/firefox.nix
2024-12-28 19:33:49 -05:00

83 lines
3.5 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
lib,
pkgs,
osConfig,
...
}: let
enablePlasma = osConfig.services.desktopManager.plasma6.enable;
extension = shortId: uuid: {
name = uuid;
value = {
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
installation_mode = "force_installed";
};
};
oldExtensions = builtins.listToAttrs;
ext = shortId: {
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
installation_mode = "force_installed";
};
exts = builtins.mapAttrs (_: ext);
in {
programs.firefox = {
enable = true;
nativeMessagingHosts = [
pkgs.tridactyl-native
];
policies.ExtensionSettings = lib.mkMerge [
(oldExtensions [
# languagetool?
#(extension "tree-style-tab" "treestyletab@piro.sakura.ne.jp")
(extension "sidebery" "{3c078156-979c-498b-8990-85f7987dd929}") # has no email id
(extension "kagi-search-for-firefox" "search@kagi.com")
(extension "ublock-origin" "uBlock0@raymondhill.net")
#(extension "umatrix" "uMatrix@raymondhill.net")
(extension "privacy-badger17" "jid1-MnnxcxisBPnSXQ@jetpack")
(extension "i-dont-care-about-cookies" "jid1-KKzOGWgsW3Ao4Q@jetpack")
# (extension "clearurls" "{74145f27-f039-47ce-a470-a662b129930a}") # has no email id
(extension "keepassxc-browser" "keepassxc-browser@keepassxc.org")
#(extension "bitwarden-password-manager" "{446900e4-71c2-419f-a6a7-df9c091e268b}")
#(extension "tabliss" "extension@tabliss.io")
# (extension "bukubrow" "bukubrow@samhh.com")
# (extension "multi-account-containers" "@testpilot-containers")
# (extension "rust-search-extension" "{04188724-64d3-497b-a4fd-7caffe6eab29}") # has no email id
# (extension "tridactyl-vim" "tridactyl.vim@cmcaine.co.uk")
# site-specific
# (extension "libredirect" "7esoorv3@alefvanoon.anonaddy.me")
(extension "toolkit-for-ynab" "{4F1FB113-D7D8-40AE-A5BA-9300EAEA0F51}") # has no email id
(extension "sponsorblock" "sponsorBlocker@ajay.app")
# (extension "steam-database" "firefox-extension@steamdb.info")
])
# TODO: Can we get this from nixpkgs instead?
(lib.mkIf enablePlasma (exts {
"plasma-browser-integration@kde.org" = "plasma-integration";
}))
];
# To add additional extensions, find it on addons.mozilla.org, find
# the short ID in the url (like https://addons.mozilla.org/en-US/firefox/addon/!SHORT_ID!/)
# Then, download the XPI by filling it in to the install_url template, unzip it,
# run `jq .browser_specific_settings.gecko.id manifest.json` or
# `jq .applications.gecko.id manifest.json` to get the UUID
# You dont need to get the UUID from the xpi. You can install it then find the UUID in about:debugging#/runtime/this-firefox.
profiles.default = {
settings = {
"app.normandy.first_run" = false;
"app.shield.optoutstudies.enabled" = false;
"app.update.channel" = "default";
# "browser.link.open_newwindow" = true;
"browser.shell.checkDefaultBrowser" = true;
"browser.urlbar.showSearchSuggestionsFirst" = false;
"browser.vpn_promo.enabled" = false;
# "extensions.activeThemeID" = "firefox-alpenglow@mozilla.org";
# "extensions.extensions.activeThemeID" = "firefox-alpenglow@mozilla.org";
"extensions.pocket.enabled" = false;
"media.ffmpeg.vaapi.enabled" = true;
};
};
};
}