diff --git a/modules/graphical/firefox/default.nix b/modules/graphical/firefox/default.nix index b69672ad..27f3516e 100644 --- a/modules/graphical/firefox/default.nix +++ b/modules/graphical/firefox/default.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, ... }: let - ff2mpv = pkgs.stdenv.mkDerivation rec { + ff2mpv-host = pkgs.stdenv.mkDerivation rec { pname = "ff2mpv"; version = "3.9.1"; src = pkgs.fetchFromGitHub { @@ -21,9 +21,78 @@ let cp ff2mpv.json $out/lib/mozilla/native-messaging-hosts ''; }; + ffPackage = pkgs.firefox.override { + extraNativeMessagingHosts = [ ff2mpv-host ]; + pkcs11Modules = [ pkgs.eid-mw ]; + forceWayland = true; + extraPolicies = { + DisableFirefoxStudies = true; + DisablePocket = true; + DisableTelemetry = true; + DisableFirefoxAccounts = true; + FirefoxHome = { Pocket = false; Snippets = false; }; + OfferToSaveLogins = false; + UserMessaging = { SkipOnboarding = true; ExtensionRecommendations = false; }; + }; + }; + belgium-eid = pkgs.nur.repos.rycee.firefox-addons.buildFirefoxXpiAddon rec { + pname = "belgium-eid"; + version = "1.0.32"; + addonId = "belgiumeid@eid.belgium.be"; + url = "https://addons.mozilla.org/firefox/downloads/file/3736679/eid_belgie-${version}-fx.xpi"; + sha256 = "t2zbE58IuHeAlM91lNX4rbiWLzt5sQq350b1PRdSY7w="; + meta = with lib; { + homepage = "https://eid.belgium.be/"; + description = "Use the Belgian electronic identity card (eID) in Firefox"; + license = licenses.lgpl3; + platforms = platforms.all; + }; + }; + better-tweetdeck = pkgs.nur.repos.rycee.firefox-addons.buildFirefoxXpiAddon rec { + pname = "better-tweetdeck"; + version = "4.7.2"; + addonId = "BetterTweetDeck@erambert.me"; + url = "https://addons.mozilla.org/firefox/downloads/file/3897452/better_tweetdeck-${version}-fx.xpi"; + sha256 = "zme93hAAaxIkKg7dO+SVhv1XU7dTzMWZlrd237uZ1zg="; + meta = with lib; { + license = licenses.mit; + platforms = platforms.all; + }; + }; + ff2mpv = pkgs.nur.repos.rycee.firefox-addons.buildFirefoxXpiAddon rec { + pname = "ff2mpv"; + version = "3.9.1"; + addonId = "ff2mpv@yossarian.net"; + url = "https://addons.mozilla.org/firefox/downloads/file/3874208/ff2mpv-${version}-fx.xpi"; + sha256 = "AJO9h2jv/VmqlfShu8q7VqJ7N+bGBtippaODZeCCM6I="; + meta = with lib; { + license = licenses.mit; + platforms = platforms.all; + }; + }; + zotero-connector = pkgs.nur.repos.rycee.firefox-addons.buildFirefoxXpiAddon rec { + pname = "zotero-connector"; + version = "5.0.92"; + addonId = "zotero@chnm.gmu.edu"; + url = "https://download.zotero.org/connector/firefox/release/Zotero_Connector-${version}.xpi"; + sha256 = "DfaDjjgJiSGJ0q9ScStAVRN3IcH8HY30K7IssuHZi2A="; + meta = with lib; { + homepage = "https://www.zotero.org"; + description = "Save references to Zotero from your web browser"; + license = licenses.agpl3; + platforms = platforms.all; + }; + }; in { - options.chvp.graphical.firefox.enable = lib.mkEnableOption "firefox"; + options.chvp.graphical.firefox = { + enable = lib.mkEnableOption "firefox"; + package = lib.mkOption { + description = "Final used firefox package"; + default = ffPackage; + readOnly = true; + }; + }; config = lib.mkIf config.chvp.graphical.firefox.enable { chvp.base.zfs.homeLinks = [ @@ -38,74 +107,17 @@ in }; firefox = { enable = true; - package = pkgs.firefox.override { - extraNativeMessagingHosts = [ ff2mpv ]; - pkcs11Modules = [ pkgs.eid-mw ]; - forceWayland = true; - extraPolicies = { - DisableFirefoxStudies = true; - DisablePocket = true; - DisableTelemetry = true; - DisableFirefoxAccounts = true; - FirefoxHome = { Pocket = false; Snippets = false; }; - OfferToSaveLogins = false; - UserMessaging = { SkipOnboarding = true; ExtensionRecommendations = false; }; - }; - }; + package = ffPackage; extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - (buildFirefoxXpiAddon rec { - pname = "belgium-eid"; - version = "1.0.32"; - addonId = "belgiumeid@eid.belgium.be"; - url = "https://addons.mozilla.org/firefox/downloads/file/3736679/eid_belgie-${version}-fx.xpi"; - sha256 = "t2zbE58IuHeAlM91lNX4rbiWLzt5sQq350b1PRdSY7w="; - meta = with lib; { - homepage = "https://eid.belgium.be/"; - description = "Use the Belgian electronic identity card (eID) in Firefox"; - license = licenses.lgpl3; - platforms = platforms.all; - }; - }) - (buildFirefoxXpiAddon rec { - pname = "better-tweetdeck"; - version = "4.7.2"; - addonId = "BetterTweetDeck@erambert.me"; - url = "https://addons.mozilla.org/firefox/downloads/file/3897452/better_tweetdeck-${version}-fx.xpi"; - sha256 = "zme93hAAaxIkKg7dO+SVhv1XU7dTzMWZlrd237uZ1zg="; - meta = with lib; { - license = licenses.mit; - platforms = platforms.all; - }; - }) + belgium-eid + better-tweetdeck browserpass decentraleyes - (buildFirefoxXpiAddon rec { - pname = "ff2mpv"; - version = "3.9.1"; - addonId = "ff2mpv@yossarian.net"; - url = "https://addons.mozilla.org/firefox/downloads/file/3874208/ff2mpv-${version}-fx.xpi"; - sha256 = "AJO9h2jv/VmqlfShu8q7VqJ7N+bGBtippaODZeCCM6I="; - meta = with lib; { - license = licenses.mit; - platforms = platforms.all; - }; - }) + ff2mpv https-everywhere ublock-origin umatrix - (buildFirefoxXpiAddon rec { - pname = "zotero-connector"; - version = "5.0.92"; - addonId = "zotero@chnm.gmu.edu"; - url = "https://download.zotero.org/connector/firefox/release/Zotero_Connector-${version}.xpi"; - sha256 = "DfaDjjgJiSGJ0q9ScStAVRN3IcH8HY30K7IssuHZi2A="; - meta = with lib; { - homepage = "https://www.zotero.org"; - description = "Save references to Zotero from your web browser"; - license = licenses.agpl3; - platforms = platforms.all; - }; - }) + zotero-connector ]; profiles.default.settings = { "browser.aboutConfig.showWarning" = false; diff --git a/modules/graphical/sway/default.nix b/modules/graphical/sway/default.nix index 5371e81b..6e151061 100644 --- a/modules/graphical/sway/default.nix +++ b/modules/graphical/sway/default.nix @@ -155,7 +155,7 @@ in default_border pixel workspace 1 - exec ${pkgs.qutebrowser}/bin/qutebrowser + exec ${config.chvp.graphical.firefox.package}/bin/firefox '' + (lib.optionalString config.chvp.programs.element.enable '' workspace 3 exec ${pkgs.element-desktop-wayland}/bin/element-desktop