summary refs log tree commit diff
path: root/pkgs/tools/security/pass
diff options
context:
space:
mode:
authorJake Waksbaum <jake.waksbaum@gmail.com>2018-06-01 13:57:19 -0400
committerJake Waksbaum <jake.waksbaum@gmail.com>2018-06-01 21:48:15 -0400
commitfea0215ec0ce159cb776421d0b5eb07890818a96 (patch)
tree4b445e2dad169153729d68fa9ae9d06ff0537c81 /pkgs/tools/security/pass
parente126a8c8a5a45fc42822a2d90131c8cae1e4357d (diff)
downloadnixlib-fea0215ec0ce159cb776421d0b5eb07890818a96.tar
nixlib-fea0215ec0ce159cb776421d0b5eb07890818a96.tar.gz
nixlib-fea0215ec0ce159cb776421d0b5eb07890818a96.tar.bz2
nixlib-fea0215ec0ce159cb776421d0b5eb07890818a96.tar.lz
nixlib-fea0215ec0ce159cb776421d0b5eb07890818a96.tar.xz
nixlib-fea0215ec0ce159cb776421d0b5eb07890818a96.tar.zst
nixlib-fea0215ec0ce159cb776421d0b5eb07890818a96.zip
pass: Add pass-audit extension
Diffstat (limited to 'pkgs/tools/security/pass')
-rw-r--r--pkgs/tools/security/pass/extensions/audit.nix42
-rw-r--r--pkgs/tools/security/pass/extensions/default.nix3
2 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/tools/security/pass/extensions/audit.nix b/pkgs/tools/security/pass/extensions/audit.nix
new file mode 100644
index 000000000000..79dd1fadb01c
--- /dev/null
+++ b/pkgs/tools/security/pass/extensions/audit.nix
@@ -0,0 +1,42 @@
+{ stdenv, pass, fetchFromGitHub, pythonPackages, makeWrapper }:
+
+let
+  pythonEnv = pythonPackages.python.withPackages (p: [ p.requests ]);
+
+in stdenv.mkDerivation rec {
+  name = "pass-audit-${version}";
+  version = "0.1";
+
+  src = fetchFromGitHub {
+    owner = "roddhjav";
+    repo = "pass-audit";
+    rev = "v${version}";
+    sha256 = "0v0db8bzpcaa7zqz17syn3c78mgvw4mpg8qg1gh5rmbjsjfxw6sm";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  buildInputs = [ pythonEnv ];
+
+  patchPhase = ''
+    sed -i -e "s|/usr/lib|$out/lib|" audit.bash
+    sed -i -e 's|$0|${pass}/bin/pass|' audit.bash
+  '';
+
+  dontBuild = true;
+
+  installFlags = [ "PREFIX=$(out)" ];
+
+  postFixup = ''
+    wrapProgram $out/lib/password-store/extensions/audit.bash \
+      --prefix PATH : "${pythonEnv}/bin" \
+      --run "export PREFIX"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Pass extension for auditing your password repository.";
+    homepage = https://github.com/roddhjav/pass-audit;
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/tools/security/pass/extensions/default.nix b/pkgs/tools/security/pass/extensions/default.nix
index dfb853c0a0bf..f69687e512b8 100644
--- a/pkgs/tools/security/pass/extensions/default.nix
+++ b/pkgs/tools/security/pass/extensions/default.nix
@@ -3,6 +3,9 @@
 with pkgs;
 
 {
+  pass-audit = callPackage ./audit.nix {
+    pythonPackages = python3Packages;
+  };
   pass-import = callPackage ./import.nix {
     pythonPackages = python3Packages;
   };