nixpkgs/pkgs/tools/security/pynitrokey/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

83 lines
1.5 KiB
Nix
Raw Normal View History

2023-06-12 10:32:32 +00:00
{ lib
, python3Packages
, fetchPypi
, nrfutil
, libnitrokey
, nix-update-script
}:
2022-01-12 09:08:14 +00:00
with python3Packages;
buildPythonApplication rec {
pname = "pynitrokey";
version = "0.4.40";
2023-09-09 22:52:03 +00:00
format = "pyproject";
2022-01-12 09:08:14 +00:00
src = fetchPypi {
inherit pname version;
hash = "sha256-Hu+8UooDzv4GhkWt0sCckQQyHjWn4V/zt2ADlVCoHmk=";
2022-01-12 09:08:14 +00:00
};
propagatedBuildInputs = [
2023-02-18 12:52:31 +00:00
certifi
cffi
2022-01-12 09:08:14 +00:00
click
2023-06-12 10:32:32 +00:00
click-aliases
2022-01-12 09:08:14 +00:00
cryptography
ecdsa
2023-02-18 12:52:31 +00:00
frozendict
2022-01-12 09:08:14 +00:00
fido2
intelhex
2023-02-18 12:52:31 +00:00
nkdfu
2022-07-27 12:10:26 +00:00
nrfutil
2023-02-18 12:52:31 +00:00
python-dateutil
2022-01-12 09:08:14 +00:00
pyusb
requests
2023-06-12 10:32:32 +00:00
semver
2022-07-27 12:10:26 +00:00
spsdk
2023-02-18 12:52:31 +00:00
tqdm
2022-01-12 09:08:14 +00:00
urllib3
2022-12-04 08:56:07 +00:00
tlv8
2023-02-18 12:52:31 +00:00
typing-extensions
importlib-metadata
2022-01-12 09:08:14 +00:00
];
2023-01-04 09:27:07 +00:00
nativeBuildInputs = [
2023-09-09 22:52:03 +00:00
flit-core
2023-01-04 09:27:07 +00:00
pythonRelaxDepsHook
];
2023-09-09 22:52:03 +00:00
# FIXME: does pythonRelaxDepsHook not work for pypaBuildHook + flit-core?
pypaBuildFlags = [ "--skip-dependency-check" ];
2023-01-04 09:27:07 +00:00
pythonRelaxDeps = [
2023-08-14 19:59:50 +00:00
"click"
2023-01-04 09:27:07 +00:00
"cryptography"
2023-04-13 06:02:32 +00:00
"protobuf"
2023-02-18 12:52:31 +00:00
"python-dateutil"
2023-01-04 09:27:07 +00:00
"spsdk"
2023-02-18 12:52:31 +00:00
"typing_extensions"
2023-01-04 09:27:07 +00:00
];
2022-07-27 12:10:26 +00:00
2023-06-12 10:32:32 +00:00
# libnitrokey is not propagated to users of the pynitrokey Python package.
# It is only usable from the wrapped bin/nitropy
makeWrapperArgs = [
"--set LIBNK_PATH ${lib.makeLibraryPath [ libnitrokey ]}"
];
2022-01-12 09:08:14 +00:00
# no tests
doCheck = false;
pythonImportsCheck = [ "pynitrokey" ];
2023-06-12 10:32:32 +00:00
passthru.updateScript = nix-update-script { };
2022-01-12 09:08:14 +00:00
meta = with lib; {
description = "Python client for Nitrokey devices";
homepage = "https://github.com/Nitrokey/pynitrokey";
license = with licenses; [ asl20 mit ];
maintainers = with maintainers; [ frogamic ];
mainProgram = "nitropy";
};
}