snowfallorg / icicle

A gtk4/libadwaita installer for NixOS based distributions
GNU General Public License v3.0
70 stars 7 forks source link

Modify Firefox installation to ease Firefox's Gnome extension and FIrefox's GSconnect extension installation #10

Open Thatoo opened 8 months ago

Thatoo commented 8 months ago

Hello,

In order to install https://addons.mozilla.org/fr/firefox/addon/gnome-shell-integration and https://addons.mozilla.org/fr/firefox/addon/gsconnect/ and make them working, we need to install firefox this way :

programs.firefox = {
   enable = true;
   package = pkgs.firefox;
   nativeMessagingHosts.packages = with pkgs; [
     browserpass
     gnomeExtensions.gsconnect
   ];
 };

instead of, as coded here, https://github.com/snowfallorg/icicle/blob/8e3776886fa391473d9c5421a7334d04638cb75f/src/utils/install.rs#L557-L560C7 :

    # List packages installed in system profile.
  environment.systemPackages = with pkgs; [
    firefox
  ];

Of course, gnomeExtensions.gsconnect should not be added at installation time thanks to icicle but should be added by the gsconnect module as I explain in my researches here : https://github.com/snowfallorg/snowflakeos-modules/issues/4#

However, to make it easy for the gsconnect module to do so, it would be better if icicle was installing Firefox like that

programs.firefox = {
   enable = true;
   package = pkgs.firefox;
   nativeMessagingHosts.packages = with pkgs; [
     browserpass
   ];
 };

instead of how it is coded in https://github.com/snowfallorg/icicle/blob/8e3776886fa391473d9c5421a7334d04638cb75f/src/utils/install.rs#L557-L560C7

I'm pretty sure it is a good thing to enable nativeMessagingHosts.packages.browserpass at installation time because Gnome user would expect to be able to use https://addons.mozilla.org/fr/firefox/addon/gnome-shell-integration right after installation time.

I even wonder if this firefox extension should not be installed by default during installation time thanks to icicle. If I understand what is written here, https://support.mozilla.org/en-US/kb/deploying-firefox-with-extensions , it would require to download the last version from https://addons.mozilla.org/firefox/downloads/latest/gnome-shell-integration/latest.xpi, rename it to chrome-gnome-shell@gnome.org.xpi (the add-on ID found in here https://gitlab.gnome.org/GNOME/gnome-browser-extension/-/blob/master/extension/manifest.firefox.json) and place it into the <firefox installation folder>/distribution/extensions/ folder.

Thatoo commented 8 months ago

Thanks @vlinkz for this PR https://github.com/NixOS/calamares-nixos-extensions/commit/4668933a80ee6a3136b6c413b49a5b6a5fd511ba Awesome, you already started to work on it :wink:

Thatoo commented 7 months ago

If installing browserpass is a too big change, we could do the same than for Thunderbird, just suggesting it by writing it but commenting it like

    nativeMessagingHosts.packages = with pkgs; [
      # browserpass

This way, it won't change installation process at all but it will make it very much easier for module to activate it and make Firefox work with Gnome extension.

It would also make it easy for gsconnect module to install the gsconnect extension within firefox and why not creating a firefoxwpa module too :

    nativeMessagingHosts.packages = with pkgs; [
      browserpass
      gnomeExtensions.gsconnect
      firefoxpwa
    ];
  };