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

tridactyl-native: init at 1.14.9 #61703

Merged
merged 1 commit into from May 28, 2019
Merged

Conversation

timokau
Copy link
Member

@timokau timokau commented May 19, 2019

Motivation for this change

Tridactyl requires a native messenger plugin for many of its features (like reading an rc file or shelling out). I'd like to be able to install that declaratively.

@infinisil can you review this? I know near to nothing about firefox in nixpkgs and I basically copied what bukubrow does.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@timokau
Copy link
Member Author

timokau commented May 24, 2019

@infinisil friendly ping in case this got lost :)

If you saw it and don't have time for a review right now thats also perfectly fine, just say so.

@infinisil
Copy link
Member

infinisil commented May 25, 2019

Hm, I can't get it to work myself. I rebuilt my firefox with this patch, and I know it has a reference to the json file, but after installing the extension, the :native command tells me it's not installed.

$ cat $(which firefox)
#! /nix/store/yjkch3aia9ny4dq42dbcjrdwqb1y8c33-bash-4.4-p23/bin/bash -e
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH${LD_LIBRARY_PATH:+':'}'/nix/store/czh92g266as0d468m5v9zrsbw3z5gz6k-systemd-239.20190219-lib/lib:/nix/store/pmv45xnczps301qqaa5rj79kawv5cmgn-ffmpeg-3.4.6/lib:/nix/store/2i9yxzjlllac73r0v3p82ysc8iah823i-libkrb5-1.17/lib:/nix/store/dg0gs6ld2v8a28mgkabs7zd1kmby25y7-libpulseaudio-12.2/lib:/nix/store/czh92g266as0d468m5v9zrsbw3z5gz6k-systemd-239.20190219-lib/lib64:/nix/store/pmv45xnczps301qqaa5rj79kawv5cmgn-ffmpeg-3.4.6/lib64:/nix/store/2i9yxzjlllac73r0v3p82ysc8iah823i-libkrb5-1.17/lib64:/nix/store/dg0gs6ld2v8a28mgkabs7zd1kmby25y7-libpulseaudio-12.2/lib64'
export GTK_PATH=$GTK_PATH${GTK_PATH:+:}'/nix/store/a08dw9n16fd1zmb40gn3gxmlbaxa5p24-libcanberra-0.30/lib/gtk-2.0/'
export PATH=$PATH${PATH:+':'}'/nix/store/9r49sclrw78m8v133kyrqq0dvlflz8v1-firefox-66.0.3/bin'
export MOZ_APP_LAUNCHER='firefox'
export MOZ_SYSTEM_DIR='/nix/store/9r49sclrw78m8v133kyrqq0dvlflz8v1-firefox-66.0.3/lib/mozilla'
export XDG_DATA_DIRS='/nix/store/sawhigii98n4zj5jmipk07nb0w7g9nhi-gsettings-desktop-schemas-3.32.0/share/gsettings-schemas/gsettings-desktop-schemas-3.32.0:/nix/store/3vysp8jf0jx1vf8wvsz84zqviqj8gp4s-gtk+3-3.24.8/share/gsettings-schemas/gtk+3-3.24.8:/nix/store/sawhigii98n4zj5jmipk07nb0w7g9nhi-gsettings-desktop-schemas-3.32.0/share/gsettings-schemas/gsettings-desktop-schemas-3.32.0:/nix/store/3vysp8jf0jx1vf8wvsz84zqviqj8gp4s-gtk+3-3.24.8/share/gsettings-schemas/gtk+3-3.24.8'${XDG_DATA_DIRS:+':'}$XDG_DATA_DIRS
export XDG_DATA_DIRS=$XDG_DATA_DIRS${XDG_DATA_DIRS:+':'}'/nix/store/n0m4p38g16xkgd6jx5j8901si5py6blk-adwaita-icon-theme-3.32.0/share'
exec "/nix/store/r9v2m05990vr3v58g4lgafix1p3sknyh-firefox-unwrapped-66.0.3/bin/firefox"  "${extraFlagsArray[@]}" "$@"

$ ls /nix/store/9r49sclrw78m8v133kyrqq0dvlflz8v1-firefox-66.0.3/lib/mozilla/native-messaging-hosts
com.dannyvankooten.browserpass.json
com.github.browserpass.native.json
tridactyl.json

Do you know what the problem could be?

(I did restart firefox)

@timokau
Copy link
Member Author

timokau commented May 25, 2019

Did you have tridactyl with the native messenger installed before?

I initially ran into a problem because the user manifest in ~/.mozilla/native-messaging-hosts overrides the system one (tridactyl/tridactyl#1555).

@infinisil
Copy link
Member

Nope, never used tridactyl before and ~/.mozilla/native-messaging-hosts only contains an old browserpass one.

@infinisil
Copy link
Member

I'm not using the latest FF though, but rather 66.0.3, I only applied this PR's patch on my systems nixpkgs.

I'll try with a firefox from this PR's commit directly

@infinisil
Copy link
Member

:# Native messenger is correctly installed, version 0.1.10

That seemed to do it :D. Yay for reproducibility. Not sure why it didn't work with the older FF though, oh well.

@@ -67,6 +68,7 @@ let
([ ]
++ lib.optional (cfg.enableBrowserpass or false) (lib.getBin browserpass)
++ lib.optional (cfg.enableBukubrow or false) bukubrow
++ lib.optional (cfg.enableTridactylNative or false) tridactyl-native
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing though: I think the Native part can be dropped, it's also not used for all other packages. Same for the package attribute tridactyl-native -> tridactyl, package path and name too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree: if we ever get firefox plugin support in nixpkgs, it would be confusing to already have a package called tridactyl. It should be clear for the user what is being installed and what is not (they will have to install the actual plugin through other means).

Do you insist on the name change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, but then it's still the tridactyl package from the same repo, and we'd probably just make it have multiple outputs, one for the native part, one for the extension part.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But shouldn't we still separate it then? There is good reason firefox doesn't install native messengers itself, it basically sidesteps the whole permission mechanism.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usage with separate derivations for native and extension:

{ pkgs }: {
  nativePart = pkgs.tridactyl-native;
  extensionPart = pkgs.tridactyl-extension;
}

Usage with a single derivation using multiple outputs:

{ pkgs }: {
  nativePart = pkgs.tridactyl.native; # Or pkgs.tridactyl because it's the default output
  extensionPart = pkgs.tridactyl.extension;
}

I don't see how the latter could be a problem, they really only differ by s/-/..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but shouldn't extensionPart be the default? When I install tridactyl, I expect to be installing the plugin. I'd be surprised if it (only) installed the native messenger by default.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we ever do get support for packaging extensions, I'd guess we'd put it in browserExtensions.tridactyl or so anyways, and you could install the native one via pkgs.tridactyl. Anyways, if you really think we should leave the -native part in the name then so be it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still do think that the -native postfix reduces confusion and I don't see any drawbacks to using it, so I'd rather keep it.

Thanks a lot for the review :)

@timokau
Copy link
Member Author

timokau commented May 27, 2019

Not sure why it didn't work with the older FF though

Yeah that's weird, maybe there were some changes in how native plugins work.

@timokau timokau merged commit 53b08be into NixOS:master May 28, 2019
@timokau timokau deleted the tridactyl-native-init branch May 28, 2019 11:14
Kirens pushed a commit to kirens-dotfiles/nixpkgs that referenced this pull request Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants