From cfcd19313cd2a4b7de8b02b0d8fbbfcc5cadf4fe Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 17 Oct 2023 13:25:07 +0800 Subject: [PATCH] overlays/firefox-foodogsquared: init --- overlays/default.nix | 1 + overlays/firefox-foodogsquared/default.nix | 104 +++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 overlays/firefox-foodogsquared/default.nix diff --git a/overlays/default.nix b/overlays/default.nix index 68b7eb7b..281792c6 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -4,5 +4,6 @@ # simply have to append them as a list (i.e., `lib.attrValues`). { ffmpeg-foodogsquared = import ./ffmpeg-foodogsquared; + firefox-foodogsquared = import ./firefox-foodogsquared; blender-foodogsquared = import ./blender-foodogsquared; } diff --git a/overlays/firefox-foodogsquared/default.nix b/overlays/firefox-foodogsquared/default.nix new file mode 100644 index 00000000..d95b53b7 --- /dev/null +++ b/overlays/firefox-foodogsquared/default.nix @@ -0,0 +1,104 @@ +# My personalized Firefox installation. +final: prev: + +{ + firefox-foodogsquared = with prev; wrapFirefox firefox-unwrapped { + cfg = { + enableBrowserpass = true; + enableBukubrow = true; + enableGnomeExtensions = true; + enableTridactylNative = true; + enableFxCastBridge = true; + }; + + extraNativeMessagingHosts = [ + ff2mpv + ]; + + extraPolicies = { + AppAutoUpdate = false; + + Containers.Default = + let + mkContainer = name: color: icon: { + inherit name color icon; + }; + in + [ + (mkContainer "Personal" "blue" "fingerprint") + (mkContainer "Self-hosted" "pink" "fingerprint") + (mkContainer "Work" "red" "briefcase") + (mkContainer "Banking" "green" "dollar") + (mkContainer "Shopping" "pink" "cart") + (mkContainer "Gaming" "turquoise" "chill") + ]; + + DisableAppUpdate = true; + DisableMasterPasswordCreation = true; + DisablePocket = true; + DisableSetDesktopBackground = true; + DontCheckDefaultBrowser = true; + EnableTrackingProtection = true; + + ExtensionSettings = + let + mozillaAddon = id: "https://addons.mozilla.org/firefox/downloads/latest/${id}/latest.xpi"; + + # This option assumes the default installation mode is `normal_installed`. + extensions = { + "@contain-facebook".install_url = mozillaAddon "facebook-container"; + "@contain-google".install_url = mozillaAddon "google-container"; + "@testpilot-containers".install_url = mozillaAddon "multi-account-containers"; + "{157eb9f0-9814-4fcc-b0b7-586b3093c641}".install_url = mozillaAddon "updateswh"; + "{15bdb1ce-fa9d-4a00-b859-66c214263ac0}".install_url = mozillaAddon "get-rss-feed-url"; + "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { + install_url = mozillaAddon "bitwarden-password-manager"; + installation_mode = "force_installed"; + default_area = "navbar"; + }; + "{dedb3663-6f13-4c6c-bf0f-5bd111cb2c79}".install_url = mozillaAddon "zhongwen"; + "{ef87d84c-2127-493f-b952-5b4e744245bc}".install_url = mozillaAddon "aw-watcher-web"; + "ff2mpv@yossarian.net" = { + install_url = mozillaAddon "ff2mpv"; + default_area = "navbar"; + }; + "FirefoxColor@mozilla.com".install_url = mozillaAddon "firefox-color"; + "firefox-translations-addon@mozilla.org".install_url = mozillaAddon "firefox-translations"; + "fx_cast@matt.tf".install_url = "https://github.com/hensm/fx_cast/releases/download/v0.3.1/fx_cast-0.3.1.xpi"; + "jid1-MnnxcxisBPnSXQ@jetpack".install_url = mozillaAddon "privacy-badger17"; + "regrets-reporter@mozillafoundation.org".install_url = mozillaAddon "regretsreporter"; + "tridactyl.vim@cmcaine.co.uk".install_url = mozillaAddon "tridactyl-vim"; + "uBlock0@raymondhill.net".install_url = mozillaAddon "ublock-origin"; + "wayback_machine@mozilla.org" = { + install_url = mozillaAddon "wayback-machine_new"; + default_area = "navbar"; + }; + "zotero@chnm.gmu.edu".install_url = "https://download.zotero.org/connector/firefox/release/Zotero_Connector-5.0.114.xpi"; + }; + + applyInstallationMode = name: value: + lib.nameValuePair name (value // + (lib.optionalAttrs + (! (lib.hasAttrByPath [ "installation_mode" ] value)) + { installation_mode = "normal_installed"; })); + in + lib.mapAttrs' applyInstallationMode extensions; + + FirefoxHome = { + Highlights = false; + Pocket = false; + Snippets = false; + SponsporedPocket = false; + SponsporedTopSites = false; + }; + + NoDefaultBookmarks = true; + OfferToSaveLoginsDefault = false; + PasswordManagerEnabled = false; + SanitizeOnShutdown = { + FormData = true; + }; + UseSystemPrintDialog = true; + }; + }; +}