2021-08-22 07:53:02 +00:00
|
|
|
{ lib
|
|
|
|
, python3Packages
|
2023-07-15 17:15:38 +00:00
|
|
|
, fetchPypi
|
2021-08-22 07:53:02 +00:00
|
|
|
, onlykey-cli
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2022-06-16 17:23:12 +00:00
|
|
|
bech32 = with python3Packages; buildPythonPackage rec {
|
|
|
|
pname = "bech32";
|
|
|
|
version = "1.2.0";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "sha256-fW24IUYDvXhx/PpsCCbvaLhbCr2Q+iHChanF4h0r2Jk=";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
# onlykey requires a patched version of libagent
|
|
|
|
lib-agent = with python3Packages; libagent.overridePythonAttrs (oa: rec{
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "1.0.6";
|
2021-08-22 07:53:02 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit version;
|
|
|
|
pname = "lib-agent";
|
2023-10-19 13:55:26 +00:00
|
|
|
sha256 = "sha256-IrJizIHDIPHo4tVduUat7u31zHo3Nt8gcMOyUUqkNu0=";
|
2021-08-22 07:53:02 +00:00
|
|
|
};
|
|
|
|
propagatedBuildInputs = oa.propagatedBuildInputs or [ ] ++ [
|
2022-06-16 17:23:12 +00:00
|
|
|
bech32
|
|
|
|
cryptography
|
2021-08-22 07:53:02 +00:00
|
|
|
docutils
|
|
|
|
pycryptodome
|
2022-06-16 17:23:12 +00:00
|
|
|
pynacl
|
2021-08-22 07:53:02 +00:00
|
|
|
wheel
|
|
|
|
];
|
|
|
|
|
|
|
|
# turn off testing because I can't get it to work
|
|
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "libagent" ];
|
|
|
|
|
|
|
|
meta = oa.meta // {
|
|
|
|
description = "Using OnlyKey as hardware SSH and GPG agent";
|
|
|
|
homepage = "https://github.com/trustcrypto/onlykey-agent/tree/ledger";
|
2023-01-11 07:51:40 +00:00
|
|
|
maintainers = with lib.maintainers; [ kalbasit ];
|
2021-08-22 07:53:02 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
in
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "onlykey-agent";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "1.1.15";
|
2021-08-22 07:53:02 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchPypi {
|
2021-08-22 07:53:02 +00:00
|
|
|
inherit pname version;
|
2023-10-19 13:55:26 +00:00
|
|
|
sha256 = "sha256-SbGb7CjcD7cFPvASZtip56B4uxRiFKZBvbsf6sb8fds=";
|
2021-08-22 07:53:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [ lib-agent onlykey-cli ];
|
|
|
|
|
|
|
|
# move the python library into the sitePackages.
|
|
|
|
postInstall = ''
|
|
|
|
mkdir $out/${python3Packages.python.sitePackages}/onlykey_agent
|
|
|
|
mv $out/bin/onlykey_agent.py $out/${python3Packages.python.sitePackages}/onlykey_agent/__init__.py
|
|
|
|
chmod a-x $out/${python3Packages.python.sitePackages}/onlykey_agent/__init__.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
# no tests
|
|
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "onlykey_agent" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = " The OnlyKey agent is essentially middleware that lets you use OnlyKey as a hardware SSH/GPG device.";
|
|
|
|
homepage = "https://github.com/trustcrypto/onlykey-agent";
|
|
|
|
license = licenses.lgpl3Only;
|
|
|
|
maintainers = with maintainers; [ kalbasit ];
|
|
|
|
};
|
|
|
|
}
|