2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, pass, fetchFromGitHub, pythonPackages, makeWrapper, fetchpatch }:
|
2018-04-18 20:27:03 +01:00
|
|
|
|
|
|
|
let
|
2019-10-28 10:30:12 +00:00
|
|
|
pythonEnv = pythonPackages.python.withPackages (p: [
|
|
|
|
p.defusedxml
|
|
|
|
p.setuptools
|
|
|
|
p.pyaml
|
2020-12-04 21:29:47 +00:00
|
|
|
p.pykeepass
|
|
|
|
p.filemagic
|
|
|
|
p.cryptography
|
|
|
|
p.secretstorage
|
2019-10-28 10:30:12 +00:00
|
|
|
]);
|
2018-04-18 20:27:03 +01:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "pass-import";
|
2020-12-04 21:29:47 +00:00
|
|
|
version = "3.1";
|
2018-04-18 20:27:03 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "roddhjav";
|
|
|
|
repo = "pass-import";
|
|
|
|
rev = "v${version}";
|
2020-12-04 21:29:47 +00:00
|
|
|
sha256 = "sha256-nH2xAqWfMT+Brv3z9Aw6nbvYqArEZjpM28rKsRPihqA=";
|
2018-04-18 20:27:03 +01:00
|
|
|
};
|
|
|
|
|
2020-12-04 21:29:47 +00:00
|
|
|
patches = [ ./0001-Fix-installation-with-Nix.patch ];
|
|
|
|
|
2018-04-18 20:27:03 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildInputs = [ pythonEnv ];
|
|
|
|
|
2020-12-04 21:29:47 +00:00
|
|
|
makeFlags = [ "DESTDIR=${placeholder "out"}" ];
|
2018-04-18 20:27:03 +01:00
|
|
|
|
2020-12-04 21:29:47 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/pimport \
|
|
|
|
--prefix PATH : "${pythonEnv}/bin" \
|
|
|
|
--prefix PYTHONPATH : "$out/${pythonPackages.python.sitePackages}"
|
2018-04-18 20:27:03 +01:00
|
|
|
wrapProgram $out/lib/password-store/extensions/import.bash \
|
2018-06-01 19:14:12 +01:00
|
|
|
--prefix PATH : "${pythonEnv}/bin" \
|
2020-12-04 21:29:47 +00:00
|
|
|
--prefix PYTHONPATH : "$out/${pythonPackages.python.sitePackages}"
|
2018-04-18 20:27:03 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-04-18 20:27:03 +01:00
|
|
|
description = "Pass extension for importing data from existing password managers";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/roddhjav/pass-import";
|
2018-04-18 20:27:03 +01:00
|
|
|
license = licenses.gpl3Plus;
|
2020-05-09 10:25:07 +01:00
|
|
|
maintainers = with maintainers; [ lovek323 fpletz tadfisher ];
|
2018-04-18 20:27:03 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|