nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 python3,
5 fetchFromGitHub,
6 wrapQtAppsHook,
7 qtbase,
8 qtwayland,
9 qtsvg,
10}:
11
12python3.pkgs.buildPythonApplication rec {
13 pname = "nitrokey-app2";
14 version = "2.3.3";
15 pyproject = true;
16
17 disabled = python3.pythonOlder "3.9";
18
19 src = fetchFromGitHub {
20 owner = "Nitrokey";
21 repo = "nitrokey-app2";
22 tag = "v${version}";
23 hash = "sha256-BbgP4V0cIctY/oR4/1r1MprkIn+5oyHeFiOQQQ71mNU=";
24 };
25
26 nativeBuildInputs = with python3.pkgs; [
27 poetry-core
28 wrapQtAppsHook
29 ];
30
31 buildInputs = [
32 qtbase
33 ]
34 ++ lib.optionals stdenv.hostPlatform.isLinux [
35 qtwayland
36 qtsvg
37 ];
38
39 propagatedBuildInputs = with python3.pkgs; [
40 nitrokey
41 pyside6
42 usb-monitor
43 ];
44
45 pythonRelaxDeps = [ "nitrokey" ];
46
47 pythonImportsCheck = [
48 "nitrokeyapp"
49 ];
50
51 postInstall = ''
52 install -Dm755 meta/com.nitrokey.nitrokey-app2.desktop $out/share/applications/com.nitrokey.nitrokey-app2.desktop
53 install -Dm755 meta/nk-app2.png $out/share/icons/hicolor/128x128/apps/com.nitrokey.nitrokey-app2.png
54 '';
55
56 meta = with lib; {
57 description = "This application allows to manage Nitrokey 3 devices";
58 homepage = "https://github.com/Nitrokey/nitrokey-app2";
59 changelog = "https://github.com/Nitrokey/nitrokey-app2/releases/tag/v${version}";
60 license = licenses.asl20;
61 maintainers = with maintainers; [
62 _999eagle
63 panicgh
64 ];
65 mainProgram = "nitrokeyapp";
66 };
67}