Merge pull request #25565 from KaiHa/nitrokey-app-1.0

nitrokey-app: 0.6.3 -> 1.1
This commit is contained in:
Franz Pletz 2017-05-27 02:43:22 +02:00 committed by GitHub
commit 8ab0501865
7 changed files with 78 additions and 36 deletions

View file

@ -0,0 +1,41 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.hardware.nitrokey;
in
{
options.hardware.nitrokey = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Enables udev rules for Nitrokey devices. By default grants access
to users in the "nitrokey" group. You may want to install the
nitrokey-app package, depending on your device and needs.
'';
};
group = mkOption {
type = types.str;
default = "nitrokey";
example = "wheel";
description = ''
Grant access to Nitrokey devices to users in this group.
'';
};
};
config = mkIf cfg.enable {
services.udev.packages = [
(pkgs.nitrokey-udev-rules.override (attrs:
{ inherit (cfg) group; }
))
];
users.extraGroups."${cfg.group}" = {};
};
}

View file

@ -39,6 +39,7 @@
./hardware/network/intel-3945abg.nix
./hardware/network/ralink.nix
./hardware/network/rtl8192c.nix
./hardware/nitrokey.nix
./hardware/opengl.nix
./hardware/pcmcia.nix
./hardware/usb-wwan.nix

View file

@ -1,11 +0,0 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -273,7 +273,7 @@
# Install autocompletion scripts
install(FILES
${CMAKE_SOURCE_DIR}/data/bash-autocomplete/nitrokey-app
- DESTINATION /etc/bash_completion.d
+ DESTINATION etc/bash_completion.d
)
install(FILES

View file

@ -1,13 +0,0 @@
diff --git a/src/utils/hid_libusb.c b/src/utils/hid_libusb.c
index bd8c14e..537292d 100644
--- a/src/utils/hid_libusb.c
+++ b/src/utils/hid_libusb.c
@@ -44,7 +44,7 @@
#include <wchar.h>
/* GNU / LibUSB */
-#include "libusb.h"
+#include "libusb-1.0/libusb.h"
#include "iconv.h"
#include "hidapi.h"

View file

@ -1,29 +1,27 @@
{ stdenv, cmake, fetchFromGitHub, libusb1, pkgconfig, qt5 }:
{ stdenv, cmake, fetchgit, hidapi, libusb1, pkgconfig, qt5 }:
stdenv.mkDerivation rec {
name = "nitrokey-app";
version = "0.6.3";
version = "1.1";
src = fetchFromGitHub {
owner = "Nitrokey";
repo = "nitrokey-app";
rev = "v${version}";
sha256 = "1l5l4lwxmyd3jrafw19g12sfc42nd43sv7h7i4krqxnkk6gfx11q";
src = fetchgit {
url = "https://github.com/Nitrokey/nitrokey-app.git";
rev = "refs/tags/v${version}";
sha256 = "11pz1p5qgghkr5f8s2wg34zqhxk2vq465i73w1h479j88x35rdp0";
};
buildInputs = [
hidapi
libusb1
qt5.qtbase
qt5.qttranslations
];
nativeBuildInputs = [
cmake
pkgconfig
];
patches = [
./FixInstallDestination.patch
./HeaderPath.patch
];
cmakeFlags = "-DHAVE_LIBAPPINDICATOR=NO";
meta = with stdenv.lib; {
description = "Provides extra functionality for the Nitrokey Pro and Storage";
longDescription = ''
@ -34,6 +32,6 @@ stdenv.mkDerivation rec {
homepage = https://github.com/Nitrokey/nitrokey-app;
repositories.git = https://github.com/Nitrokey/nitrokey-app.git;
license = licenses.gpl3;
maintainer = maintainers.kaiha;
maintainers = with maintainers; [ kaiha fpletz ];
};
}

View file

@ -0,0 +1,25 @@
{ stdenv, nitrokey-app
, group ? "nitrokey"
}:
stdenv.mkDerivation {
name = "nitrokey-udev-rules";
inherit (nitrokey-app) src;
dontBuild = true;
patchPhase = ''
substituteInPlace data/41-nitrokey.rules --replace plugdev "${group}"
'';
installPhase = ''
mkdir -p $out/etc/udev/rules.d
cp data/41-nitrokey.rules $out/etc/udev/rules.d
'';
meta = {
description = "udev rules for Nitrokeys";
inherit (nitrokey-app.meta) homepage license maintainers;
};
}

View file

@ -18836,6 +18836,7 @@ with pkgs;
xrq = callPackage ../applications/misc/xrq { };
nitrokey-app = callPackage ../tools/security/nitrokey-app { };
nitrokey-udev-rules = callPackage ../tools/security/nitrokey-app/udev-rules.nix { };
fpm2 = callPackage ../tools/security/fpm2 { };