1 { lib, stdenv, fetchFromGitHub, python3, pass }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
11 sha256 = "sha256-P5h0B5ilwp3OVyDHIOQ23Zv4eLjN4jFkdZF293FQnNE=";
14 buildInputs = [ python3 ];
15 makeFlags = [ "VERSION=${version}" ];
18 sed -i 's#COMMAND = "pass"#COMMAND = "${pass}/bin/pass"#' src/passff.py
22 substituteInPlace bin/${version}/passff.json \
23 --replace PLACEHOLDER $out/share/passff-host/passff.py
25 install -Dt $out/share/passff-host \
26 bin/${version}/passff.{py,json}
28 nativeMessagingPaths=(
29 /lib/mozilla/native-messaging-hosts
30 /etc/opt/chrome/native-messaging-hosts
31 /etc/chromium/native-messaging-hosts
32 /etc/vivaldi/native-messaging-hosts
33 /lib/librewolf/native-messaging-hosts
36 for manifestDir in "''${nativeMessagingPaths[@]}"; do
37 install -d $out$manifestDir
38 ln -s $out/share/passff-host/passff.json $out$manifestDir/
43 description = "Host app for the WebExtension PassFF";
44 homepage = "https://github.com/passff/passff-host";
45 license = licenses.gpl2Only;