Merge pull request #223242 from panicgh/nitrokey-libnitrokey

libnitrokey: init at 3.8
This commit is contained in:
Ryan Lahfa 2023-03-27 22:07:24 +02:00 committed by GitHub
commit 16f67c4afc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 101 additions and 36 deletions

View File

@ -22,6 +22,6 @@ in
};
config = mkIf cfg.enable {
services.udev.packages = [ pkgs.nitrokey-udev-rules ];
services.udev.packages = [ pkgs.libnitrokey ];
};
}

View File

@ -0,0 +1,31 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cppcodec";
version = "0.2";
src = fetchFromGitHub {
owner = "tplgy";
repo = finalAttrs.pname;
rev = "v${finalAttrs.version}";
hash = "sha256-k4EACtDOSkTXezTeFtVdM1EVJjvGga/IQSrvDzhyaXw=";
};
nativeBuildInputs = [ cmake ];
meta = with lib; {
description = "Header-only C++11 library for encode/decode functions as in RFC 4648";
longDescription = ''
Header-only C++11 library to encode/decode base64, base64url, base32,
base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus
Crockford's base32.
'';
homepage = "https://github.com/tplgy/cppcodec";
license = licenses.mit;
maintainers = with maintainers; [ panicgh raitobezarius ];
};
})

View File

@ -0,0 +1,41 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, hidapi
, libusb1
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libnitrokey";
version = "3.8";
src = fetchFromGitHub {
owner = "Nitrokey";
repo = "libnitrokey";
rev = "v${finalAttrs.version}";
hash = "sha256-9ZMR1g04gNzslax6NpD6KykfUfjpKFIizaMMn06iJa0=";
};
nativeBuildInputs = [
cmake
pkg-config
];
cmakeFlags = [
"-DADD_GIT_INFO=OFF"
"-DCMAKE_INSTALL_UDEVRULESDIR=etc/udev/rules.d"
];
buildInputs = [ libusb1 ];
propagatedBuildInputs = [ hidapi ];
meta = with lib; {
description = "Communicate with Nitrokey devices in a clean and easy manner";
homepage = "https://github.com/Nitrokey/libnitrokey";
license = licenses.lgpl3;
maintainers = with maintainers; [ panicgh raitobezarius ];
};
})

View File

@ -1,5 +1,13 @@
{ lib, stdenv, bash-completion, cmake, fetchFromGitHub, hidapi, libusb1, pkg-config
, qtbase, qttranslations, qtsvg, wrapQtAppsHook }:
{ lib
, stdenv
, cmake
, fetchFromGitHub
, pkg-config
, qttranslations
, wrapQtAppsHook
, libnitrokey
, cppcodec
}:
stdenv.mkDerivation rec {
pname = "nitrokey-app";
@ -9,24 +17,25 @@ stdenv.mkDerivation rec {
owner = "Nitrokey";
repo = "nitrokey-app";
rev = "v${version}";
sha256 = "1k0w921hfrya4q2r7bqn7kgmwvwb7c15k9ymlbnksmfc9yyjyfcv";
fetchSubmodules = true;
hash = "sha256-c6EC5uuMna07xVHDRFq0UDwuSeopZTmZGZ9ZD5zaq8Y=";
};
buildInputs = [
bash-completion
hidapi
libusb1
qtbase
qttranslations
qtsvg
];
nativeBuildInputs = [
cmake
pkg-config
wrapQtAppsHook
qttranslations
];
cmakeFlags = [
"-DADD_GIT_INFO=OFF"
"-DBASH_COMPLETION_PATH=share/bash-completion/completions"
];
buildInputs = [
libnitrokey
cppcodec
];
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ];
meta = with lib; {
description = "Provides extra functionality for the Nitrokey Pro and Storage";
@ -37,6 +46,6 @@ stdenv.mkDerivation rec {
'';
homepage = "https://github.com/Nitrokey/nitrokey-app";
license = licenses.gpl3;
maintainers = with maintainers; [ kaiha ];
maintainers = with maintainers; [ kaiha panicgh ];
};
}

View File

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

View File

@ -1073,6 +1073,7 @@ mapAliases ({
nfsUtils = throw "'nfsUtils' has been renamed to/replaced by 'nfs-utils'"; # Converted to throw 2022-02-22
nginxUnstable = throw "'nginxUnstable' has been renamed to/replaced by 'nginxMainline'"; # Converted to throw 2022-02-22
nilfs_utils = throw "'nilfs_utils' has been renamed to/replaced by 'nilfs-utils'"; # Converted to throw 2022-02-22
nitrokey-udev-rules = libnitrokey; # Added 2023-03-25
nix-direnv-flakes = nix-direnv;
nix-review = nixpkgs-review; # Added 2019-12-22
nixFlakes = nixVersions.stable; # Added 2021-05-21

View File

@ -19608,6 +19608,8 @@ with pkgs;
cppcms = callPackage ../development/libraries/cppcms { };
cppcodec = callPackage ../development/libraries/cppcodec { };
cppunit = callPackage ../development/libraries/cppunit { };
cpputest = callPackage ../development/libraries/cpputest { };
@ -21611,6 +21613,8 @@ with pkgs;
libnice = callPackage ../development/libraries/libnice { };
libnitrokey = callPackage ../development/libraries/libnitrokey { };
libnsl = callPackage ../development/libraries/libnsl { };
liboping = callPackage ../development/libraries/liboping { };
@ -39309,7 +39313,6 @@ with pkgs;
pynitrokey = callPackage ../tools/security/pynitrokey { };
nitrokey-app = libsForQt5.callPackage ../tools/security/nitrokey-app { };
nitrokey-udev-rules = callPackage ../tools/security/nitrokey-app/udev-rules.nix { };
fpm2 = callPackage ../tools/security/fpm2 { };