Files
nixpkgs/pkgs/by-name/in/infnoise/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

76 lines
1.8 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
libftdi,
testers,
udevCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "infnoise";
version = "0.3.3";
src = fetchFromGitHub {
owner = "leetronics";
repo = "infnoise";
rev = "19bb69894724d87b32b7b9b86022bb4b26c919f8";
sha256 = "sha256-O2P4uOwO7wKLYLufdW3KQeyuFBoQPdSepnTUeq0CSJY=";
};
patches = [
# Patch providing version info at compile time
(fetchpatch {
url = "https://github.com/leetronics/infnoise/commit/04d52a975bf78d2aff2bb4c176c286715e1948ba.patch";
sha256 = "sha256-vtPAR6gCyny9UP+U6/7X8CPEUuMDl7RIyICIwiaWyfc=";
})
];
GIT_COMMIT = finalAttrs.src.rev;
GIT_VERSION = finalAttrs.version;
GIT_DATE = "2023-02-14";
buildInputs = [ libftdi ];
nativeBuildInputs = [
udevCheckHook
];
doInstallCheck = true;
makefile = "Makefile.linux";
makeFlags = [ "PREFIX=$(out)" ];
postPatch = ''
cd software
substituteInPlace init_scripts/infnoise.service --replace "/usr/local" "$out"
'';
postInstall = ''
make -C tools
# 2e6cfbe made findlongest executable, but it's a C file
chmod -x tools/*.c
find ./tools/ -executable -type f -exec \
sh -c "install -Dm755 {} $out/bin/infnoise-\$(basename {})" \;
'';
passthru = {
tests.version = testers.testVersion { package = finalAttrs.finalPackage; };
};
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.
'';
license = licenses.cc0;
maintainers = with maintainers; [
StijnDW
zhaofengli
];
platforms = platforms.linux;
};
})