nixpkgs-suyu/pkgs/tools/security/pass/extensions/import.nix

43 lines
1.1 KiB
Nix
Raw Normal View History

2018-04-18 21:27:03 +02:00
{ stdenv, pass, fetchFromGitHub, pythonPackages, makeWrapper }:
let
pythonEnv = pythonPackages.python.withPackages (p: [ p.defusedxml ]);
in stdenv.mkDerivation rec {
name = "pass-import-${version}";
version = "2.3";
2018-04-18 21:27:03 +02:00
src = fetchFromGitHub {
owner = "roddhjav";
repo = "pass-import";
rev = "v${version}";
sha256 = "1209aqkiqqbir5yzwk5jvyk8c1fyrsj9igr3n4banf347rlwmzfv";
2018-04-18 21:27:03 +02:00
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ pythonEnv ];
patchPhase = ''
sed -i -e 's|$0|${pass}/bin/pass|' import.bash
'';
2018-04-18 21:27:03 +02:00
dontBuild = true;
installFlags = [ "PREFIX=$(out)" ];
postFixup = ''
wrapProgram $out/lib/password-store/extensions/import.bash \
--prefix PATH : "${pythonEnv}/bin" \
--run "export PREFIX"
2018-04-18 21:27:03 +02:00
'';
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;
};
}