summary refs log tree commit diff
path: root/pkgs/tools/security/pass
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2019-10-28 10:30:12 +0000
committerJörg Thalheim <joerg@thalheim.io>2019-10-28 10:36:02 +0000
commit22b2ccf87641a52299d18296e5a24ef4e5b35a4e (patch)
tree16f9c1fc0636b2a53c383ecc5ad676960b404e74 /pkgs/tools/security/pass
parent443f1a43ef629f1d0394641d769ef0c97f583404 (diff)
passExtensions.pass-import: 2.3 -> 2.6
Diffstat (limited to 'pkgs/tools/security/pass')
-rw-r--r--pkgs/tools/security/pass/extensions/import.nix29
1 files changed, 23 insertions, 6 deletions
diff --git a/pkgs/tools/security/pass/extensions/import.nix b/pkgs/tools/security/pass/extensions/import.nix
index 9d9d36fd0d909..90e3105bbd804 100644
--- a/pkgs/tools/security/pass/extensions/import.nix
+++ b/pkgs/tools/security/pass/extensions/import.nix
@@ -1,34 +1,51 @@
-{ stdenv, pass, fetchFromGitHub, pythonPackages, makeWrapper }:
+{ stdenv, pass, fetchFromGitHub, pythonPackages, makeWrapper, fetchpatch }:
 
 let
-  pythonEnv = pythonPackages.python.withPackages (p: [ p.defusedxml ]);
+  pythonEnv = pythonPackages.python.withPackages (p: [
+    p.defusedxml
+    p.setuptools
+    p.pyaml
+  ]);
 
 in stdenv.mkDerivation rec {
   pname = "pass-import";
-  version = "2.3";
+  version = "2.6";
 
   src = fetchFromGitHub {
     owner = "roddhjav";
     repo = "pass-import";
     rev = "v${version}";
-    sha256 = "1209aqkiqqbir5yzwk5jvyk8c1fyrsj9igr3n4banf347rlwmzfv";
+    sha256 = "1q8rln4djh2z8j2ycm654df5y6anm5iv2r19spgy07c3fnisxlac";
   };
 
   nativeBuildInputs = [ makeWrapper ];
 
   buildInputs = [ pythonEnv ];
 
-  patchPhase = ''
+  patches = [
+    # https://github.com/roddhjav/pass-import/pull/91
+    (fetchpatch {
+      url = "https://github.com/roddhjav/pass-import/commit/6ccaf639e92df45bd400503757ae4aa2c5c030d7.patch";
+      sha256 = "0lw9vqvbqcy96s7v7nz0i1bdx93x7qr13azymqypcdhjwmq9i63h";
+    })
+  ];
+
+  postPatch = ''
     sed -i -e 's|$0|${pass}/bin/pass|' import.bash
   '';
 
   dontBuild = true;
 
-  installFlags = [ "PREFIX=$(out)" ];
+  installFlags = [
+    "PREFIX=$(out)"
+    "BASHCOMPDIR=$(out)/etc/bash_completion.d"
+  ];
 
   postFixup = ''
+    install -D pass_import.py $out/${pythonPackages.python.sitePackages}/pass_import.py
     wrapProgram $out/lib/password-store/extensions/import.bash \
       --prefix PATH : "${pythonEnv}/bin" \
+      --prefix PYTHONPATH : "$out/${pythonPackages.python.sitePackages}" \
       --run "export PREFIX"
   '';