2021-03-22 02:36:31 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, python3Packages
|
|
|
|
, gnupg
|
|
|
|
, pass
|
2021-04-15 01:41:17 +01:00
|
|
|
, makeWrapper
|
2021-03-22 02:36:31 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "pass-import";
|
2021-06-13 00:03:38 +01:00
|
|
|
version = "3.2";
|
2018-04-18 20:27:03 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "roddhjav";
|
|
|
|
repo = "pass-import";
|
|
|
|
rev = "v${version}";
|
2021-06-13 00:03:38 +01:00
|
|
|
sha256 = "0hrpg7yiv50xmbajfy0zdilsyhbj5iv0qnlrgkfv99q1dvd5qy56";
|
2018-04-18 20:27:03 +01:00
|
|
|
};
|
|
|
|
|
2021-03-22 02:36:31 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
cryptography
|
|
|
|
defusedxml
|
|
|
|
pyaml
|
|
|
|
pykeepass
|
2021-06-13 00:03:38 +01:00
|
|
|
python_magic # similar API to "file-magic", but already in nixpkgs.
|
2021-03-22 02:36:31 +00:00
|
|
|
secretstorage
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
gnupg
|
|
|
|
pass
|
|
|
|
python3Packages.pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"test_import_gnome_keyring" # requires dbus, which pytest doesn't support
|
|
|
|
];
|
2018-04-18 20:27:03 +01:00
|
|
|
|
2021-04-15 01:41:17 +01:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/lib/password-store/extensions
|
2021-06-13 00:03:38 +01:00
|
|
|
cp ${src}/import.bash $out/lib/password-store/extensions/import.bash
|
2021-04-15 01:41:17 +01:00
|
|
|
wrapProgram $out/lib/password-store/extensions/import.bash \
|
2021-06-13 00:03:38 +01:00
|
|
|
--prefix PATH : "${python3Packages.python.withPackages (_: propagatedBuildInputs)}/bin" \
|
2021-04-15 01:41:17 +01:00
|
|
|
--prefix PYTHONPATH : "$out/${python3Packages.python.sitePackages}" \
|
|
|
|
--run "export PREFIX"
|
|
|
|
cp -r ${src}/share $out/
|
|
|
|
'';
|
|
|
|
|
2021-06-13 00:03:38 +01:00
|
|
|
postCheck = ''
|
|
|
|
$out/bin/pimport --list-exporters --list-importers
|
|
|
|
'';
|
|
|
|
|
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";
|
2021-03-22 02:36:31 +00:00
|
|
|
changelog = "https://github.com/roddhjav/pass-import/blob/v${version}/CHANGELOG.rst";
|
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;
|
|
|
|
};
|
|
|
|
}
|