nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, python3Packages, fetchPypi, nrfutil, libnitrokey }:
2
3with python3Packages;
4
5buildPythonApplication rec {
6 pname = "pynitrokey";
7 version = "0.4.37";
8 format = "flit";
9
10 src = fetchPypi {
11 inherit pname version;
12 hash = "sha256-KoZym1b+E0P3kRt0PTm9wCX4nO31isDIwEq38xMgDDU=";
13 };
14
15 propagatedBuildInputs = [
16 certifi
17 cffi
18 click
19 cryptography
20 ecdsa
21 frozendict
22 fido2
23 intelhex
24 nkdfu
25 nrfutil
26 python-dateutil
27 pyusb
28 requests
29 spsdk
30 tqdm
31 urllib3
32 tlv8
33 typing-extensions
34 ];
35
36 nativeBuildInputs = [
37 pythonRelaxDepsHook
38 ];
39
40 pythonRelaxDeps = [
41 "cryptography"
42 "protobuf"
43 "python-dateutil"
44 "spsdk"
45 "typing_extensions"
46 ];
47
48 # libnitrokey is not propagated to users of pynitrokey
49 # It is only usable from the wrapped bin/nitropy
50 makeWrapperArgs = [
51 "--set LIBNK_PATH ${lib.makeLibraryPath [ libnitrokey ]}"
52 ];
53
54 # no tests
55 doCheck = false;
56
57 pythonImportsCheck = [ "pynitrokey" ];
58
59 meta = with lib; {
60 description = "Python client for Nitrokey devices";
61 homepage = "https://github.com/Nitrokey/pynitrokey";
62 license = with licenses; [ asl20 mit ];
63 maintainers = with maintainers; [ frogamic ];
64 mainProgram = "nitropy";
65 };
66}