···1+{ lib, stdenv, fetchFromGitHub, libftdi }:
2+3+stdenv.mkDerivation rec {
4+ pname = "infnoise";
5+ version = "unstable-2019-08-12";
6+7+ src = fetchFromGitHub {
8+ owner = "13-37-org";
9+ repo = "infnoise";
10+ rev = "132683d4b5ce0902468b666cba63baea36e97f0c";
11+ sha256 = "1dzfzinyvhyy9zj32kqkl19fyhih6sy8r5sa3qahbbr4c30k7flp";
12+ };
13+14+ # Patch makefile so we can set defines from the command line instead of it depending on .git
15+ patches = [ ./makefile.patch ];
16+ GIT_COMMIT = src.rev;
17+ GIT_VERSION = version;
18+ GIT_DATE = "2019-08-12";
19+20+ buildInputs = [ libftdi ];
21+22+ sourceRoot = "source/software";
23+ makefile = "Makefile.linux";
24+ makeFlags = [ "PREFIX=$(out)" ];
25+ postPatch = ''
26+ substituteInPlace init_scripts/infnoise.service --replace "/usr/local" "$out"
27+ '';
28+29+ meta = with lib; {
30+ homepage = "https://github.com/13-37-org/infnoise";
31+ description = "Driver for the Infinite Noise TRNG";
32+ longDescription = ''
33+ The Infinite Noise TRNG is a USB key hardware true random number generator.
34+ It can either provide rng for userland applications, or provide rng for the OS entropy.
35+ Add the following to your system configuration for plug and play support, adding to the OS entropy:
36+ systemd.packages = [ pkgs.infnoise ];
37+ services.udev.packages = [ pkgs.infnoise ];
38+ '';
39+ license = licenses.cc0;
40+ maintainers = with maintainers; [ StijnDW ];
41+ platforms = platforms.linux;
42+ };
43+}