2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, bech32
|
|
|
|
, buildPythonPackage
|
|
|
|
, cryptography
|
|
|
|
, ed25519
|
|
|
|
, ecdsa
|
2023-03-04 12:14:45 +00:00
|
|
|
, gnupg
|
2022-08-12 12:06:08 +00:00
|
|
|
, semver
|
|
|
|
, mnemonic
|
|
|
|
, unidecode
|
|
|
|
, mock
|
|
|
|
, pytest
|
|
|
|
, backports-shutil-which
|
|
|
|
, configargparse
|
|
|
|
, python-daemon
|
|
|
|
, pymsgbox
|
|
|
|
, pynacl
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
# XXX: when changing this package, please test the package onlykey-agent.
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "libagent";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "0.14.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "romanz";
|
|
|
|
repo = "trezor-agent";
|
|
|
|
rev = "v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-RISAy0efdatr9u4CWNRGnlffkC8ksw1NyRpJWKwqz+s=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
# hardcode the path to gpgconf in the libagent library
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace libagent/gpg/keyring.py \
|
|
|
|
--replace "util.which('gpgconf')" "'${gnupg}/bin/gpgconf'" \
|
|
|
|
--replace "'gpg-connect-agent'" "'${gnupg}/bin/gpg-connect-agent'"
|
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
unidecode
|
|
|
|
backports-shutil-which
|
|
|
|
configargparse
|
|
|
|
python-daemon
|
|
|
|
pymsgbox
|
|
|
|
ecdsa
|
|
|
|
ed25519
|
|
|
|
mnemonic
|
|
|
|
semver
|
|
|
|
pynacl
|
|
|
|
bech32
|
|
|
|
cryptography
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ mock pytest ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
py.test libagent/tests
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Using hardware wallets as SSH/GPG agent";
|
|
|
|
homepage = "https://github.com/romanz/trezor-agent";
|
2021-03-20 04:20:00 +00:00
|
|
|
license = licenses.lgpl3Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ np ];
|
|
|
|
};
|
|
|
|
}
|