Open quigonjeff opened 2 years ago
How are you writing the derivation? I managed to get the extension compiling using the following:
{ lib, fetchFromGitHub, rustPlatform, cmake }:
rustPlatform.buildRustPackage rec {
pname = "firefox-profile-switcher-connector";
version = "0.1.1";
src = fetchFromGitHub {
owner = "null-dev";
repo = pname;
rev = "v${version}";
sha256 = "sha256-mnPpIJ+EQAjfjhrSSNTrvCqGbW0VMy8GHbLj39rR8r4=";
};
nativeBuildInputs = [ cmake ];
cargoSha256 = "sha256-EQIBeZwF9peiwpgZNfMmjvLv8NyhvVGUjVXgkf12Wig=";
postInstall = ''
mkdir -p $out/lib/mozilla/native-messaging-hosts
sed -i s#/usr/bin/ff-pswitch-connector#$out/bin/firefox_profile_switcher_connector# manifest/manifest-linux.json
cp manifest/manifest-linux.json $out/lib/mozilla/native-messaging-hosts/ax.nd.profile_switcher_ff.json
'';
meta = with lib; {
description = "Native connector software for the 'Profile Switcher for Firefox' extension.";
homepage = "https://github.com/null-dev/firefox-profile-switcher-connector";
license = licenses.gpl3;
};
}
You can then add the extension as a messaging host to Firefox with something like:
{
firefox = prev.firefox.override { extraNativeMessagingHosts = [ firefox-profile-switcher-connector ]; };
}
or:
{
packages = with pkgs; [
(firefox.override { extraNativeMessagingHosts = [ firefox-profile-switcher-connector ]; })
];
}
This seemed to compile for me just fine against nixpkgs-unstable. The only issue is I can't actually get the extension to switch profiles now...
@epetousis were you able to get it working?
Edit: Nevermind, got it working with https://github.com/null-dev/firefox-profile-switcher-connector/issues/14#issuecomment-1366879583
Have any of you gotten this working in a way I could consume instead of writing my own thing? Relatedly, anyone submitted it to be in the default set of packages?
@genebean Yes, I got it working with @epetousis method and the link posted in my comment.
@addy419 is your package / code published somewhere that I can pull from or do I need to replicate what you have done? I am still fairly new to Nix so sorry if this sounds like a no duh question.
Hi @genebean you can check my config here https://github.com/addy419/configurations/blob/master/modules/desktop/firefox/firefox-profile-switcher-connector.nix and https://github.com/addy419/configurations/blob/master/modules/desktop/firefox/default.nix
Be sure to add the config file pointed in my comment once you are able to do this.
Edit: You can use the config on line 53 in my default.nix and set it automatically.
Many thanks @addy419
I created a packaging request for Nix at https://github.com/NixOS/nixpkgs/issues/332470 - it would be great if you all would +1 it if interested. Also, @epetousis if you are game to submit the package I'd be happy to try and help maintain it. I don't know enough about rust or nix packaging to be the sole maintainer, but am happy to help.
Is that config hack still necessary to get the extension working? If it isn't I'll happily submit a PR, although it's been a while since I last used this.
Is that config hack still necessary to get the extension working? If it isn't I'll happily submit a PR, although it's been a while since I last used this.
As far as I know, yes. It doesn't seem to be packaged in Nix anywhere.
Hi. I am having problems compiling for NixOS. I am getting the following error messages:
Any advise on how to fix the problem?
Also, is there any chance you could provide an AppImage version of the connector?
Thanks a lot.