Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libnitrokey: init at 3.8 #223242

Merged
merged 5 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nixos/modules/hardware/nitrokey.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ in
};

config = mkIf cfg.enable {
services.udev.packages = [ pkgs.nitrokey-udev-rules ];
services.udev.packages = [ pkgs.libnitrokey ];
};
}
31 changes: 31 additions & 0 deletions pkgs/development/libraries/cppcodec/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
})
41 changes: 41 additions & 0 deletions pkgs/development/libraries/libnitrokey/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, hidapi
, libusb1
}:

stdenv.mkDerivation (finalAttrs: {
RaitoBezarius marked this conversation as resolved.
Show resolved Hide resolved
pname = "libnitrokey";
version = "3.8";

src = fetchFromGitHub {
owner = "Nitrokey";
repo = "libnitrokey";
rev = "v${finalAttrs.version}";
RaitoBezarius marked this conversation as resolved.
Show resolved Hide resolved
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 ];
};
})
35 changes: 22 additions & 13 deletions pkgs/tools/security/nitrokey-app/default.nix
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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";
Expand Down
20 changes: 0 additions & 20 deletions pkgs/tools/security/nitrokey-app/udev-rules.nix

This file was deleted.

1 change: 1 addition & 0 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,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
Expand Down
5 changes: 4 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19603,6 +19603,8 @@ with pkgs;

cppcms = callPackage ../development/libraries/cppcms { };

cppcodec = callPackage ../development/libraries/cppcodec { };

cppunit = callPackage ../development/libraries/cppunit { };

cpputest = callPackage ../development/libraries/cpputest { };
Expand Down Expand Up @@ -21594,6 +21596,8 @@ with pkgs;

libnice = callPackage ../development/libraries/libnice { };

libnitrokey = callPackage ../development/libraries/libnitrokey { };

libnsl = callPackage ../development/libraries/libnsl { };

liboping = callPackage ../development/libraries/liboping { };
Expand Down Expand Up @@ -39266,7 +39270,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 { };

Expand Down