49 lines
1.5 KiB
Nix
49 lines
1.5 KiB
Nix
{ lib, stdenv, fetchFromGitHub, libftdi
|
|
, infnoise, testers }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "infnoise";
|
|
version = "0.3.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "leetronics";
|
|
repo = "infnoise";
|
|
rev = "e80ddd78085abf3d06df2e0d8c08fd33dade78eb";
|
|
sha256 = "sha256-9MKG1InkV+yrQPBTgi2gZJ3y9Fokb6WbxuAnM7n7FyA=";
|
|
};
|
|
|
|
# Patch makefile so we can set defines from the command line instead of it depending on .git
|
|
patches = [ ./makefile.patch ];
|
|
GIT_COMMIT = src.rev;
|
|
GIT_VERSION = version;
|
|
GIT_DATE = "2019-08-12";
|
|
|
|
buildInputs = [ libftdi ];
|
|
|
|
sourceRoot = "source/software";
|
|
makefile = "Makefile.linux";
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
postPatch = ''
|
|
substituteInPlace init_scripts/infnoise.service --replace "/usr/local" "$out"
|
|
'';
|
|
|
|
passthru = {
|
|
tests.version = testers.testVersion { package = infnoise; };
|
|
};
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/leetronics/infnoise";
|
|
description = "Driver for the Infinite Noise TRNG";
|
|
longDescription = ''
|
|
The Infinite Noise TRNG is a USB key hardware true random number generator.
|
|
It can either provide rng for userland applications, or provide rng for the OS entropy.
|
|
Add the following to your system configuration for plug and play support, adding to the OS entropy:
|
|
systemd.packages = [ pkgs.infnoise ];
|
|
services.udev.packages = [ pkgs.infnoise ];
|
|
'';
|
|
license = licenses.cc0;
|
|
maintainers = with maintainers; [ StijnDW zhaofengli ];
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|