From d2b5f8dda80d08bb0a3dfbaea17df030c23cb2a6 Mon Sep 17 00:00:00 2001 From: chn Date: Sun, 1 Sep 2024 16:16:59 +0800 Subject: [PATCH] packages.firefox: enable pwa --- modules/packages/firefox.nix | 3 ++- modules/user/chn/firefox.nix | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/modules/packages/firefox.nix b/modules/packages/firefox.nix index a5a4e8f8..e643623c 100644 --- a/modules/packages/firefox.nix +++ b/modules/packages/firefox.nix @@ -12,7 +12,8 @@ inputs: { enable = true; languagePacks = [ "zh-CN" "en-US" ]; - nativeMessagingHosts.packages = with inputs.pkgs; [ uget-integrator ]; + nativeMessagingHosts.packages = with inputs.pkgs; [ uget-integrator firefoxpwa ]; }; + nixos.packages.packages._packages = [ inputs.pkgs.firefoxpwa ]; }; } diff --git a/modules/user/chn/firefox.nix b/modules/user/chn/firefox.nix index 79536ad9..a3884a86 100644 --- a/modules/user/chn/firefox.nix +++ b/modules/user/chn/firefox.nix @@ -7,8 +7,7 @@ inputs: programs.firefox = { enable = true; - nativeMessagingHosts = [ inputs.pkgs.plasma-browser-integration ]; - # TODO: switch to chromium as default browser + nativeMessagingHosts = with inputs.pkgs; [ plasma-browser-integration uget-integrator firefoxpwa ]; # TODO: use fixed-version of plugins policies.DefaultDownloadDirectory = "\${home}/Downloads"; profiles.default = @@ -17,7 +16,16 @@ inputs: [ immersive-translate tampermonkey bitwarden cookies-txt dualsub firefox-color i-dont-care-about-cookies metamask pakkujs switchyomega rsshub-radar rsspreview tabliss tree-style-tab ublock-origin wallabagger - wappalyzer grammarly plasma-integration zotero-connector + wappalyzer grammarly plasma-integration zotero-connector + (buildFirefoxXpiAddon + { + pname = "pwas-for-firefox"; + version = "2.12.1"; + addonId = "firefoxpwa@filips.si"; + url = "https://addons.mozilla.org/firefox/downloads/file/4293028/pwas_for_firefox-2.12.1.xpi"; + sha256 = "sha256-m8BCAlQt37RxVnWw+2hIPnmofTicNa5OWkwXp/IXdWY="; + meta = {}; + }) ]; search = { default = "Google"; force = true; }; userChrome = builtins.readFile "${inputs.topInputs.lepton}/userChrome.css"; @@ -36,6 +44,8 @@ inputs: "browser.toolbars.bookmarks.visibility" = "never"; # allow to apply userChrome.css "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + # automatically enable extensions + "extensions.autoDisableScopes" = 0; }; }; };