Unverified Commit 16f67c4a authored by Ryan Lahfa's avatar Ryan Lahfa Committed by GitHub
Browse files

Merge pull request #223242 from panicgh/nitrokey-libnitrokey

libnitrokey: init at 3.8
parents f39c23ad c42fe31f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,6 +22,6 @@ in
  };

  config = mkIf cfg.enable {
    services.udev.packages = [ pkgs.nitrokey-udev-rules ];
    services.udev.packages = [ pkgs.libnitrokey ];
  };
}
+31 −0
Original line number Diff line number Diff line
{ 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 −0
Original line number Diff line number Diff line
{ 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 ];
  };
})
+23 −14
Original line number Diff line number Diff line
{ 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 ];
  };
}
+0 −20
Original line number Diff line number Diff line
{ 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;
  };
}
Loading