···11+{ lib, stdenv, fetchFromGitHub, libftdi }:
22+33+stdenv.mkDerivation rec {
44+ pname = "infnoise";
55+ version = "unstable-2019-08-12";
66+77+ src = fetchFromGitHub {
88+ owner = "13-37-org";
99+ repo = "infnoise";
1010+ rev = "132683d4b5ce0902468b666cba63baea36e97f0c";
1111+ sha256 = "1dzfzinyvhyy9zj32kqkl19fyhih6sy8r5sa3qahbbr4c30k7flp";
1212+ };
1313+1414+ # Patch makefile so we can set defines from the command line instead of it depending on .git
1515+ patches = [ ./makefile.patch ];
1616+ GIT_COMMIT = src.rev;
1717+ GIT_VERSION = version;
1818+ GIT_DATE = "2019-08-12";
1919+2020+ buildInputs = [ libftdi ];
2121+2222+ sourceRoot = "source/software";
2323+ makefile = "Makefile.linux";
2424+ makeFlags = [ "PREFIX=$(out)" ];
2525+ postPatch = ''
2626+ substituteInPlace init_scripts/infnoise.service --replace "/usr/local" "$out"
2727+ '';
2828+2929+ meta = with lib; {
3030+ homepage = "https://github.com/13-37-org/infnoise";
3131+ description = "Driver for the Infinite Noise TRNG";
3232+ longDescription = ''
3333+ The Infinite Noise TRNG is a USB key hardware true random number generator.
3434+ It can either provide rng for userland applications, or provide rng for the OS entropy.
3535+ Add the following to your system configuration for plug and play support, adding to the OS entropy:
3636+ systemd.packages = [ pkgs.infnoise ];
3737+ services.udev.packages = [ pkgs.infnoise ];
3838+ '';
3939+ license = licenses.cc0;
4040+ maintainers = with maintainers; [ StijnDW ];
4141+ platforms = platforms.linux;
4242+ };
4343+}