summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-07-31 21:10:45 -0400
committerGitHub <noreply@github.com>2019-07-31 21:10:45 -0400
commitba4e5a3f640a4a88a7d81d7a7ea84cfbdd31adf7 (patch)
treebc73c5d8639ce3f4eea0eada56d30b90d4b6ad58 /pkgs
parent06183c2a27e4374eb5f1a7a7abbb1bd96a63e156 (diff)
parentc73ff37cd5601c144138e1de57be3575bac8bb8e (diff)
downloadnixpkgs-ba4e5a3f640a4a88a7d81d7a7ea84cfbdd31adf7.tar
nixpkgs-ba4e5a3f640a4a88a7d81d7a7ea84cfbdd31adf7.tar.gz
nixpkgs-ba4e5a3f640a4a88a7d81d7a7ea84cfbdd31adf7.tar.bz2
nixpkgs-ba4e5a3f640a4a88a7d81d7a7ea84cfbdd31adf7.tar.lz
nixpkgs-ba4e5a3f640a4a88a7d81d7a7ea84cfbdd31adf7.tar.xz
nixpkgs-ba4e5a3f640a4a88a7d81d7a7ea84cfbdd31adf7.tar.zst
nixpkgs-ba4e5a3f640a4a88a7d81d7a7ea84cfbdd31adf7.zip
Merge pull request #65488 from arcnmx/pr-passff-manifest
passff-host: fix native messaging manifest path
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/security/passff-host/default.nix24
1 files changed, 19 insertions, 5 deletions
diff --git a/pkgs/tools/security/passff-host/default.nix b/pkgs/tools/security/passff-host/default.nix
index a97bc57ad45..59f03db0200 100644
--- a/pkgs/tools/security/passff-host/default.nix
+++ b/pkgs/tools/security/passff-host/default.nix
@@ -1,27 +1,41 @@
 { stdenv, fetchFromGitHub, python3, pass }:
 
 stdenv.mkDerivation rec {
-  name = "passff-host-${version}";
+  pname = "passff-host";
   version = "1.2.1";
 
   src = fetchFromGitHub {
     owner = "passff";
-    repo = "passff-host";
+    repo = pname;
     rev = version;
     sha256 = "0ydfwvhgnw5c3ydx2gn5d7ys9g7cxlck57vfddpv6ix890v21451";
   };
 
   buildInputs = [ python3 ];
+  makeFlags = [ "VERSION=${version}" ];
 
   patchPhase = ''
     sed -i 's#COMMAND = "pass"#COMMAND = "${pass}/bin/pass"#' src/passff.py
   '';
 
   installPhase = ''
-    install -D bin/testing/passff.py $out/share/passff-host/passff.py
-    cp bin/testing/passff.json $out/share/passff-host/passff.json
-    substituteInPlace $out/share/passff-host/passff.json \
+    substituteInPlace bin/${version}/passff.json \
       --replace PLACEHOLDER $out/share/passff-host/passff.py
+
+    install -Dt $out/share/passff-host \
+      bin/${version}/passff.{py,json}
+
+    nativeMessagingPaths=(
+      /lib/mozilla/native-messaging-hosts
+      /etc/opt/chrome/native-messaging-hosts
+      /etc/chromium/native-messaging-hosts
+      /etc/vivaldi/native-messaging-hosts
+    )
+
+    for manifestDir in "''${nativeMessagingPaths[@]}"; do
+      install -d $out$manifestDir
+      ln -s $out/share/passff-host/passff.json $out$manifestDir/
+    done
   '';
 
   meta = with stdenv.lib; {