Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install different versions of Firefox side by side. #296

Closed
zeorin opened this issue Jul 28, 2022 · 2 comments
Closed

Install different versions of Firefox side by side. #296

zeorin opened this issue Jul 28, 2022 · 2 comments

Comments

@zeorin
Copy link

zeorin commented Jul 28, 2022

It'd be great to have first-class support in the overlay for installing different versions of Firefox side by side, at the moment this is not possible.

I have the following workaround:

let
  mkFirefox = { name, desktopName, profileName }:
    let
      pkg = latest."${name}-bin".overrideAttrs (old: {
        desktopItem = makeDesktopItem {
          inherit name desktopName;
          exec = "${name} %U";
          icon = name;
          comment = "";
          genericName = "Web Browser";
          categories = [ "Network" "WebBrowser" ];
          mimeTypes = [
            "text/html"
            "text/xml"
            "application/xhtml+xml"
            "application/vnd.mozilla.xul+xml"
            "x-scheme-handler/http"
            "x-scheme-handler/https"
            "x-scheme-handler/ftp"
          ];
        };
      });
      wrapped = pkgs.writeShellScriptBin name ''
        exec ${pkg}/bin/firefox --no-remote -P ${profileName} "''${@}"
      '';
    in pkgs.symlinkJoin {
      inherit name;
      paths = [ wrapped pkg ];
    };
in [
  latest.firefox-bin
  (mkFirefox {
    name = "firefox-nightly";
    desktopName = "Firefox Nightly";
    profileName = "nightly";
  })
  (mkFirefox {
    name = "firefox-beta";
    desktopName = "Firefox Beta";
    profileName = "beta";
  })
  (mkFirefox {
    name = "firefox-esr";
    desktopName = "Firefox ESR";
    profileName = "esr";
  })
]

This changes the binary name (so there's no clash and all can be installed side by side), and overwrites the desktop item definition so that we can actually tell the different versions apart using your Desktop Environment's application launcher.

@nbp
Copy link
Collaborator

nbp commented Aug 18, 2022

@zeorin I recall we had a live discussion about this topic on Matrix.
Last time we spoke about changing the way the Firefox wrapper is handled in Nixpkgs, as this overlay relies on Nixpkgs wrapper to provide binaries.

I suspect we can close this issue and reference another one in Nixpkgs?

@zeorin
Copy link
Author

zeorin commented Mar 15, 2024

NixOS/nixpkgs#294971

@zeorin zeorin closed this as completed Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants