git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #25565 from KaiHa/nitrokey-app-1.0

nitrokey-app: 0.6.3 -> 1.1

commit8ab0501865afc2b2a49ccf18bc107b85b4357540 authorFranz Pletz <fpletz@fnordicwalking.de> dateSat 27 May 2017, 02:43 (10 years ago) parent594829d839647e
7 files changed+78−36
nixos/modules/hardware/nitrokey.nix+41 nixos/modules/module-list.nix+1 pkgs/tools/security/nitrokey-app/FixInstallDestination.patch−11 pkgs/tools/security/nitrokey-app/HeaderPath.patch−13 pkgs/tools/security/nitrokey-app/default.nix+10−12 pkgs/tools/security/nitrokey-app/udev-rules.nix+25 pkgs/top-level/all-packages.nix+1
nixos/modules/hardware/nitrokey.nixnew file+41
@@ -0,0 +1,41 @@
1+{ config, lib, pkgs, ... }:
2+
3+with lib;
4+
5+let
6+
7+ cfg = config.hardware.nitrokey;
8+
9+in
10+
11+{
12+ options.hardware.nitrokey = {
13+ enable = mkOption {
14+ type = types.bool;
15+ default = false;
16+ description = ''
17+ Enables udev rules for Nitrokey devices. By default grants access
18+ to users in the "nitrokey" group. You may want to install the
19+ nitrokey-app package, depending on your device and needs.
20+ '';
21+ };
22+
23+ group = mkOption {
24+ type = types.str;
25+ default = "nitrokey";
26+ example = "wheel";
27+ description = ''
28+ Grant access to Nitrokey devices to users in this group.
29+ '';
30+ };
31+ };
32+
33+ config = mkIf cfg.enable {
34+ services.udev.packages = [
35+ (pkgs.nitrokey-udev-rules.override (attrs:
36+ { inherit (cfg) group; }
37+ ))
38+ ];
39+ users.extraGroups."${cfg.group}" = {};
40+ };
41+}
nixos/modules/module-list.nix+1
@@ -39,6 +39,7 @@
3939 ./hardware/network/intel-3945abg.nix
4040 ./hardware/network/ralink.nix
4141 ./hardware/network/rtl8192c.nix
42+ ./hardware/nitrokey.nix
4243 ./hardware/opengl.nix
4344 ./hardware/pcmcia.nix
4445 ./hardware/usb-wwan.nix
pkgs/tools/security/nitrokey-app/FixInstallDestination.patchdeleted−11
@@ -1,11 +0,0 @@
1−--- a/CMakeLists.txt
2−+++ b/CMakeLists.txt
3−@@ -273,7 +273,7 @@
4− # Install autocompletion scripts
5− install(FILES
6− ${CMAKE_SOURCE_DIR}/data/bash-autocomplete/nitrokey-app
7−- DESTINATION /etc/bash_completion.d
8−+ DESTINATION etc/bash_completion.d
9− )
10−
11− install(FILES
pkgs/tools/security/nitrokey-app/HeaderPath.patchdeleted−13
@@ -1,13 +0,0 @@
1−diff --git a/src/utils/hid_libusb.c b/src/utils/hid_libusb.c
2−index bd8c14e..537292d 100644
3−--- a/src/utils/hid_libusb.c
4−+++ b/src/utils/hid_libusb.c
5−@@ -44,7 +44,7 @@
6− #include <wchar.h>
7−
8− /* GNU / LibUSB */
9−-#include "libusb.h"
10−+#include "libusb-1.0/libusb.h"
11− #include "iconv.h"
12−
13− #include "hidapi.h"
pkgs/tools/security/nitrokey-app/default.nix+10−12
@@ -1,29 +1,27 @@
1−{ stdenv, cmake, fetchFromGitHub, libusb1, pkgconfig, qt5 }:
1+{ stdenv, cmake, fetchgit, hidapi, libusb1, pkgconfig, qt5 }:
22
33stdenv.mkDerivation rec {
44 name = "nitrokey-app";
5− version = "0.6.3";
5+ version = "1.1";
66
7− src = fetchFromGitHub {
8− owner = "Nitrokey";
9− repo = "nitrokey-app";
10− rev = "v${version}";
11− sha256 = "1l5l4lwxmyd3jrafw19g12sfc42nd43sv7h7i4krqxnkk6gfx11q";
7+ src = fetchgit {
8+ url = "https://github.com/Nitrokey/nitrokey-app.git";
9+ rev = "refs/tags/v${version}";
10+ sha256 = "11pz1p5qgghkr5f8s2wg34zqhxk2vq465i73w1h479j88x35rdp0";
1211 };
1312
1413 buildInputs = [
14+ hidapi
1515 libusb1
1616 qt5.qtbase
17+ qt5.qttranslations
1718 ];
1819 nativeBuildInputs = [
1920 cmake
2021 pkgconfig
2122 ];
22− patches = [
23− ./FixInstallDestination.patch
24− ./HeaderPath.patch
25− ];
2623 cmakeFlags = "-DHAVE_LIBAPPINDICATOR=NO";
24+
2725 meta = with stdenv.lib; {
2826 description = "Provides extra functionality for the Nitrokey Pro and Storage";
2927 longDescription = ''
@@ -34,6 +32,6 @@ stdenv.mkDerivation rec {
3432 homepage = https://github.com/Nitrokey/nitrokey-app;
3533 repositories.git = https://github.com/Nitrokey/nitrokey-app.git;
3634 license = licenses.gpl3;
37− maintainer = maintainers.kaiha;
35+ maintainers = with maintainers; [ kaiha fpletz ];
3836 };
3937}
pkgs/tools/security/nitrokey-app/udev-rules.nixnew file+25
@@ -0,0 +1,25 @@
1+{ stdenv, nitrokey-app
2+, group ? "nitrokey"
3+}:
4+
5+stdenv.mkDerivation {
6+ name = "nitrokey-udev-rules";
7+
8+ inherit (nitrokey-app) src;
9+
10+ dontBuild = true;
11+
12+ patchPhase = ''
13+ substituteInPlace data/41-nitrokey.rules --replace plugdev "${group}"
14+ '';
15+
16+ installPhase = ''
17+ mkdir -p $out/etc/udev/rules.d
18+ cp data/41-nitrokey.rules $out/etc/udev/rules.d
19+ '';
20+
21+ meta = {
22+ description = "udev rules for Nitrokeys";
23+ inherit (nitrokey-app.meta) homepage license maintainers;
24+ };
25+}
pkgs/top-level/all-packages.nix+1
@@ -18836,6 +18836,7 @@ with pkgs;
1883618836 xrq = callPackage ../applications/misc/xrq { };
1883718837
1883818838 nitrokey-app = callPackage ../tools/security/nitrokey-app { };
18839+ nitrokey-udev-rules = callPackage ../tools/security/nitrokey-app/udev-rules.nix { };
1883918840
1884018841 fpm2 = callPackage ../tools/security/fpm2 { };
1884118842