biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / security / passff-host / default.nix
blobd5cf2f8267e2ba40614a13b6d8ef83704240f6fb
1 { lib, stdenv, fetchFromGitHub, python3, pass }:
3 stdenv.mkDerivation rec {
4   pname = "passff-host";
5   version = "1.2.4";
7   src = fetchFromGitHub {
8     owner = "passff";
9     repo = pname;
10     rev = version;
11     sha256 = "sha256-P5h0B5ilwp3OVyDHIOQ23Zv4eLjN4jFkdZF293FQnNE=";
12   };
14   buildInputs = [ python3 ];
15   makeFlags = [ "VERSION=${version}" ];
17   patchPhase = ''
18     sed -i 's#COMMAND = "pass"#COMMAND = "${pass}/bin/pass"#' src/passff.py
19   '';
21   installPhase = ''
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
34     )
36     for manifestDir in "''${nativeMessagingPaths[@]}"; do
37       install -d $out$manifestDir
38       ln -s $out/share/passff-host/passff.json $out$manifestDir/
39     done
40   '';
42   meta = with lib; {
43     description = "Host app for the WebExtension PassFF";
44     homepage = "https://github.com/passff/passff-host";
45     license = licenses.gpl2Only;
46     maintainers = [ ];
47   };