pass: refactor extension packaging

This commit is contained in:
Tad Fisher
2018-05-04 10:53:17 -07:00
parent c68dc2212e
commit 0c2a7fa4dc
8 changed files with 205 additions and 92 deletions
@@ -0,0 +1,12 @@
{ pkgs, ... }:
with pkgs;
{
pass-import = callPackage ./import.nix {
pythonPackages = python3Packages;
};
pass-otp = callPackage ./otp.nix {};
pass-tomb = callPackage ./tomb.nix {};
pass-update = callPackage ./update.nix {};
}
@@ -0,0 +1,37 @@
{ stdenv, pass, fetchFromGitHub, pythonPackages, makeWrapper }:
let
pythonEnv = pythonPackages.python.withPackages (p: [ p.defusedxml ]);
in stdenv.mkDerivation rec {
name = "pass-import-${version}";
version = "2.2";
src = fetchFromGitHub {
owner = "roddhjav";
repo = "pass-import";
rev = "v${version}";
sha256 = "189wf2jz2j43k27930cnl53sm2drh1s0nq1nmh4is3rzn8cna6wq";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ pythonEnv ];
dontBuild = true;
installFlags = [ "PREFIX=$(out)" ];
postFixup = ''
wrapProgram $out/lib/password-store/extensions/import.bash \
--prefix PATH : "${pythonEnv}/bin"
'';
meta = with stdenv.lib; {
description = "Pass extension for importing data from existing password managers";
homepage = https://github.com/roddhjav/pass-import;
license = licenses.gpl3Plus;
maintainers = with maintainers; [ lovek323 the-kenny fpletz tadfisher ];
platforms = platforms.unix;
};
}
@@ -0,0 +1,31 @@
{ stdenv, fetchFromGitHub, oathToolkit }:
stdenv.mkDerivation rec {
name = "pass-otp-${version}";
version = "1.1.0";
src = fetchFromGitHub {
owner = "tadfisher";
repo = "pass-otp";
rev = "v${version}";
sha256 = "1cgj4zc8fq88n3h6c0vkv9i5al785mdprpgpbv5m22dz9p1wqvbb";
};
buildInputs = [ oathToolkit ];
dontBuild = true;
patchPhase = ''
sed -i -e 's|OATH=\$(which oathtool)|OATH=${oathToolkit}/bin/oathtool|' otp.bash
'';
installFlags = [ "PREFIX=$(out)" ];
meta = with stdenv.lib; {
description = "A pass extension for managing one-time-password (OTP) tokens";
homepage = https://github.com/tadfisher/pass-otp;
license = licenses.gpl3;
maintainers = with maintainers; [ jwiegley tadfisher ];
platforms = platforms.unix;
};
}
@@ -0,0 +1,32 @@
{ stdenv, fetchFromGitHub, tomb }:
stdenv.mkDerivation rec {
name = "pass-tomb-${version}";
version = "1.1";
src = fetchFromGitHub {
owner = "roddhjav";
repo = "pass-tomb";
rev = "v${version}";
sha256 = "0wxa673yyzasjlkpd5f3yl5zf7bhsw7h1jbhf6sdjz65bypr2596";
};
buildInputs = [ tomb ];
dontBuild = true;
installFlags = [ "PREFIX=$(out)" ];
postFixup = ''
substituteInPlace $out/lib/password-store/extensions/tomb.bash \
--replace 'TOMB="''${PASSWORD_STORE_TOMB:-tomb}"' 'TOMB="''${PASSWORD_STORE_TOMB:-${tomb}/bin/tomb}"'
'';
meta = with stdenv.lib; {
description = "Pass extension that keeps the password store encrypted inside a tomb";
homepage = https://github.com/roddhjav/pass-tomb;
license = licenses.gpl3Plus;
maintainers = with maintainers; [ lovek323 the-kenny fpletz tadfisher ];
platforms = platforms.unix;
};
}
@@ -0,0 +1,25 @@
{ stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
name = "pass-update-${version}";
version = "2.0";
src = fetchFromGitHub {
owner = "roddhjav";
repo = "pass-update";
rev = "v${version}";
sha256 = "0a81q0jfni185zmbislzbcv0qr1rdp0cgr9wf9riygis2xv6rs6k";
};
dontBuild = true;
installFlags = [ "PREFIX=$(out)" ];
meta = with stdenv.lib; {
description = "Pass extension that provides an easy flow for updating passwords";
homepage = https://github.com/roddhjav/pass-update;
license = licenses.gpl3Plus;
maintainers = with maintainers; [ lovek323 the-kenny fpletz tadfisher ];
platforms = platforms.unix;
};
}