2021-03-22 02:36:31 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, python3Packages
|
|
|
|
, gnupg
|
|
|
|
, pass
|
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication 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
|
|
|
};
|
|
|
|
|
2021-03-22 02:36:31 +00:00
|
|
|
# by default, tries to install scripts/pimport, which is a bash wrapper around "python -m pass_import ..."
|
|
|
|
# This is a better way to do the same, and takes advantage of the existing Nix python environments
|
|
|
|
patches = [
|
|
|
|
# from https://github.com/roddhjav/pass-import/pull/138
|
|
|
|
(fetchpatch {
|
|
|
|
name = "pass-import-pr-138-pimport-entrypoint.patch";
|
|
|
|
url = "https://github.com/roddhjav/pass-import/commit/ccdb6995bee6436992dd80d7b3101f0eb94c59bb.patch";
|
|
|
|
sha256 = "sha256-CO8PyWxa4eLuTQBB+jKTImFPlPn+1yt6NBsIp+SPk94=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
cryptography
|
|
|
|
defusedxml
|
|
|
|
pyaml
|
|
|
|
pykeepass
|
|
|
|
python_magic # similar API to "file-magic", but already in nixpkgs.
|
|
|
|
secretstorage
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
gnupg
|
|
|
|
pass
|
|
|
|
python3Packages.pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"test_import_gnome_keyring" # requires dbus, which pytest doesn't support
|
|
|
|
];
|
|
|
|
postCheck = ''
|
|
|
|
$out/bin/pimport --list-exporters --list-importers
|
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";
|
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;
|
|
|
|
};
|
|
|
|
}
|