From e058c6aa1dfbf2fac3ed046a91427f69bf361216 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sun, 12 May 2024 16:02:34 +0100 Subject: [PATCH] Add browserpass firefox extension --- programs/firefox/default.nix | 263 ++++++++++++++++++----------------- 1 file changed, 136 insertions(+), 127 deletions(-) diff --git a/programs/firefox/default.nix b/programs/firefox/default.nix index af72aaf..879c107 100644 --- a/programs/firefox/default.nix +++ b/programs/firefox/default.nix @@ -1,140 +1,149 @@ { - config, lib, pkgs, ... }: { - programs.firefox = { - enable = true; - policies = { - BlockAboutProfiles = true; - Cookies = { - Behavior = "reject-tracker-and-partition-foreign"; - BehaviorPrivateBrowsing = "reject"; - Locked = true; - }; - DefaultDownloadDirectory = "\${home}/Downloads"; - DisableAppUpdate = true; - DisableFirefoxAccounts = true; - DisableFirefoxScreenshots = true; - DisableFirefoxStudies = true; - DisableFormHistory = true; - DisablePocket = true; - DisableProfileImport = true; - DisableSetDesktopBackground = true; - DisableSystemAddonUpdate = true; - DisableTelemetry = true; - DisplayBookmarksToolbar = "always"; - DisplayMenuBar = "default-off"; - DontCheckDefaultBrowser = true; - EnableTrackingProtection = { - Value = true; - Locked = true; - Cryptomining = true; - Fingerprinting = true; - }; - ExtensionSettings = { - "queryamoid@kaply.com" = { - installation_mode = "force_installed"; - install_url = "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi"; - }; - "uBlock0@raymondhill.net" = { - installation_mode = "force_installed"; - install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; - }; - "addon@simplelogin" = { - installation_mode = "force_installed"; - install_url = "https://addons.mozilla.org/firefox/downloads/latest/simplelogin/latest.xpi"; - }; - "{8446b178-c865-4f5c-8ccc-1d7887811ae3}" = { - installation_mode = "force_installed"; - install_url = "https://addons.mozilla.org/firefox/downloads/latest/catppuccin-mocha-lavender-git/latest.xpi"; - }; - }; - FirefoxHome = { - Search = true; - TopSites = false; - SponsoredTopSites = false; - Highlights = false; - Pocket = false; - SponsoredPocket = false; - Snippets = false; - Locked = true; - }; - FirefoxSuggest = { - WebSuggestions = false; - SponsoredSuggestions = false; - ImproveSuggest = false; - Locked = true; - }; - HardwareAcceleration = true; - Homepage = { - Locked = true; - StartPage = "homepage-locked"; - }; - NewTabPage = true; - NoDefaultBookmarks = false; - OfferToSaveLogins = false; - PasswordManagerEnabled = false; - PDFjs = {Enabled = false;}; - Permissions = { - Autoplay = { - Default = "block-audio-video"; - }; - }; - PictureInPicture = {Enabled = true;}; - PopupBlocking = {Default = true;}; - RequestedLocales = ["en-GB"]; - SearchBar = "unified"; - ShowHomeButton = true; - StartDownloadsInTempDirectory = true; + programs = { + browserpass = { + enable = true; + browsers = ["firefox"]; }; - profiles.default = { - settings = { - "app.shield.optoutstudies.enabled" = false; - "browser.bookmarks.addedImportButton" = false; - "browser.bookmarks.showMobileBookmarks" = false; - "browser.toolbars.bookmarks.visibility" = "newtab"; - "browser.contentblocking.category" = "strict"; - "browser.search.region" = "GB"; - "browser.search.isUS" = false; - "browser.warnOnQuitShortcut" = false; - "distribution.searchplugins.defaultLocale" = "en-GB"; - "doh-rollout.home-region" = "GB"; - "extensions.activeThemeID" = "{c6698fd1-fe9b-4eae-95d5-fe1703820469}"; - "extensions.formautofill.creditCards.enabled" = false; - "general.useragent.locale" = "en-GB"; - "intl.accept_languages" = "en-gb,en"; - "intl.locale.requested" = "en-gb,en"; - "intl.regional_prefs.use_os_locales" = false; - "media.eme.enabled" = true; - "privacy.webrtc.legacyGlobalIndicator" = false; - "signon.management.page.breach-alerts.enabled" = false; - "signon.rememberSignons" = false; - "browser.newtabpage.pinned" = [ + firefox = { + enable = true; + policies = { + BlockAboutProfiles = true; + Cookies = { + Behavior = "reject-tracker-and-partition-foreign"; + BehaviorPrivateBrowsing = "reject"; + Locked = true; + }; + DefaultDownloadDirectory = "\${home}/Downloads"; + DisableAppUpdate = true; + DisableFirefoxAccounts = true; + DisableFirefoxScreenshots = true; + DisableFirefoxStudies = true; + DisableFormHistory = true; + DisablePocket = true; + DisableProfileImport = true; + DisableSetDesktopBackground = true; + DisableSystemAddonUpdate = true; + DisableTelemetry = true; + DisplayBookmarksToolbar = "always"; + DisplayMenuBar = "default-off"; + DontCheckDefaultBrowser = true; + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + ExtensionSettings = { + "queryamoid@kaply.com" = { + installation_mode = "force_installed"; + install_url = "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi"; + }; + "uBlock0@raymondhill.net" = { + installation_mode = "force_installed"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + }; + "browserpass@maximbaz.com" = { + installation_mode = "force_installed"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/browserpass-ce/latest.xpi"; + }; + "addon@simplelogin" = { + installation_mode = "force_installed"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/simplelogin/latest.xpi"; + }; + "{8446b178-c865-4f5c-8ccc-1d7887811ae3}" = { + installation_mode = "force_installed"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/catppuccin-mocha-lavender-git/latest.xpi"; + }; + }; + FirefoxHome = { + Search = true; + TopSites = false; + SponsoredTopSites = false; + Highlights = false; + Pocket = false; + SponsoredPocket = false; + Snippets = false; + Locked = true; + }; + FirefoxSuggest = { + WebSuggestions = false; + SponsoredSuggestions = false; + ImproveSuggest = false; + Locked = true; + }; + HardwareAcceleration = true; + Homepage = { + Locked = true; + StartPage = "homepage-locked"; + }; + NewTabPage = true; + NoDefaultBookmarks = false; + OfferToSaveLogins = false; + PasswordManagerEnabled = false; + PDFjs = {Enabled = false;}; + Permissions = { + Autoplay = { + Default = "block-audio-video"; + }; + }; + PictureInPicture = {Enabled = true;}; + PopupBlocking = {Default = true;}; + RequestedLocales = ["en-GB"]; + SearchBar = "unified"; + ShowHomeButton = true; + StartDownloadsInTempDirectory = true; + }; + profiles.default = { + settings = { + "app.shield.optoutstudies.enabled" = false; + "browser.bookmarks.addedImportButton" = false; + "browser.bookmarks.showMobileBookmarks" = false; + "browser.toolbars.bookmarks.visibility" = "newtab"; + "browser.contentblocking.category" = "strict"; + "browser.search.region" = "GB"; + "browser.search.isUS" = false; + "browser.warnOnQuitShortcut" = false; + "distribution.searchplugins.defaultLocale" = "en-GB"; + "doh-rollout.home-region" = "GB"; + "extensions.activeThemeID" = "{c6698fd1-fe9b-4eae-95d5-fe1703820469}"; + "extensions.formautofill.creditCards.enabled" = false; + "general.useragent.locale" = "en-GB"; + "intl.accept_languages" = "en-gb,en"; + "intl.locale.requested" = "en-gb,en"; + "intl.regional_prefs.use_os_locales" = false; + "media.eme.enabled" = true; + "privacy.webrtc.legacyGlobalIndicator" = false; + "signon.management.page.breach-alerts.enabled" = false; + "signon.rememberSignons" = false; + "browser.newtabpage.pinned" = [ + { + title = "NixOS Wiki"; + url = "https://nixos.wiki"; + } + { + title = "Arch Wiki"; + url = "https://wiki.archlinux.org"; + } + ]; + }; + search = { + default = "DuckDuckGo"; + force = true; + order = ["DuckDuckGo"]; + engines = import ./search-engines/default.nix pkgs; + }; + bookmarks = [ { - title = "NixOS Wiki"; - url = "https://nixos.wiki"; - } - { - title = "Arch Wiki"; - url = "https://wiki.archlinux.org"; + name = "toplevel"; + toolbar = true; + bookmarks = import ./bookmarks/default.nix lib; } ]; }; - search = { - default = "DuckDuckGo"; - force = true; - order = ["DuckDuckGo"]; - engines = import ./search-engines/default.nix pkgs; - }; - bookmarks = [ - { - name = "toplevel"; - toolbar = true; - bookmarks = import ./bookmarks/default.nix lib; - } - ]; }; }; }