2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
|
|
bech32,
|
|
|
|
buildPythonPackage,
|
|
|
|
cryptography,
|
|
|
|
ed25519,
|
|
|
|
ecdsa,
|
|
|
|
gnupg,
|
|
|
|
semver,
|
|
|
|
mnemonic,
|
|
|
|
unidecode,
|
|
|
|
mock,
|
|
|
|
pytest,
|
|
|
|
backports-shutil-which,
|
|
|
|
configargparse,
|
|
|
|
python-daemon,
|
|
|
|
pymsgbox,
|
|
|
|
pynacl,
|
2022-08-12 12:06:08 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
# When changing this package, please test packages {keepkey,ledger,onlykey,trezor}-agent
|
2021-08-22 07:53:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "libagent";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "0.14.8";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
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}";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-tcVott/GlHsICQf640Gm5jx89fZWsCdcYnBxi/Kh2oc=";
|
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
|
|
|
|
2024-06-05 15:53:02 +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 ];
|
|
|
|
};
|
|
|
|
}
|