elvos

30 commits
Updated 2026-06-12 16:26:02
modules
modules/firefox.nix
{ ... }:
{
  programs.firefox = {
    enable = true;

    profiles = {
      default = {
        id = 0;
        isDefault = true;

        settings = {
          "browser.aboutConfig.showWarning" = false;

          "sidebar.verticalTabs" = true;

          "browser.startup.page" = 3;
          "browser.startup.homepage" = "about:blank";
          "browser.newtabpage.enabled" = false;

          "browser.urlbar.suggest.history" = false;
          "browser.urlbar.suggest.bookmark" = false;
          "browser.urlbar.suggest.openpage" = false;
          "browser.urlbar.suggest.topsites" = true;
          "browser.urlbar.suggest.searches" = false;

          "browser.toolbars.bookmarks.visibility" = "never";

          "browser.search.defaultenginename" = "google";
          "browser.search.selectedEngine" = "google";
          "browser.search.order.1" = "google";

          "browser.translations.automaticallyPopup" = false;
        };

        search = {
          force = true;
          default = "google";
        };
      };
    };

    policies = {
      AppAutoUpdate = false;
      BackgroundAppUpdate = false;

      DisableBuiltinPDFViewer = true;
      DisableFirefoxStudies = true;
      DisableFirefoxAccounts = true;
      DisableFirefoxScreenshots = true;
      DisableForgetButton = true;
      DisableMasterPasswordCreation = true;
      DisableProfileImport = true;
      DisableProfileRefresh = true;
      DisableSetDesktopBackground = true;
      DisablePocket = true;
      DisableTelemetry = true;
      DisableFormHistory = true;
      DisablePasswordReveal = true;

      BlockAboutConfig = false;
      BlockAboutProfiles = true;
      BlockAboutSupport = true;

      DisplayMenuBar = "never";
      DontCheckDefaultBrowser = true;
      HardwareAcceleration = true;
      OfferToSaveLogins = false;

      ExtensionSettings =
        let
          moz = short: "https://addons.mozilla.org/firefox/downloads/latest/${short}/latest.xpi";
        in
        {
          "*".installation_mode = "blocked";

          "uBlock0@raymondhill.net" = {
            install_url = moz "ublock-origin";
            installation_mode = "force_installed";
            updates_disabled = true;
            allowed_in_private_browsing = true;
          };
          "78272b6fa58f4a1abaac99321d503a20@proton.me" = {
            install_url = moz "proton-pass";
            installation_mode = "force_installed";
            updates_disabled = true;
            allowed_in_private_browsing = true;
          };
          "vpn@proton.ch" = {
            install_url = moz "proton-vpn-firefox-extension";
            installation_mode = "force_installed";
            updates_disabled = true;
            allowed_in_private_browsing = true;
          };
        };
    };
  };
}