{ lib, stdenv, fetchFromGitHub, autoreconfHook, smartmontools, makeWrapper, }: stdenv.mkDerivation (finalAttrs: { pname = "snapraid"; version = "14.9"; src = fetchFromGitHub { owner = "amadvance"; repo = "snapraid"; tag = "v${finalAttrs.version}"; hash = "sha256-z4ycepeh8ZKqJ9vUBhZMQImBmPAxRXMgtX/apgWXatI="; }; env.VERSION = finalAttrs.version; doCheck = true; nativeBuildInputs = [ autoreconfHook makeWrapper ]; # SMART is only supported on Linux and requires the smartmontools package postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' wrapProgram $out/bin/snapraid \ --prefix PATH : ${lib.makeBinPath [ smartmontools ]} ''; meta = { homepage = "http://www.snapraid.it/"; downloadPage = "https://github.com/amadvance/snapraid/releases"; changelog = "https://github.com/amadvance/snapraid/blob/v${finalAttrs.version}/HISTORY"; description = "Backup program for disk arrays"; license = lib.licenses.gpl3Plus; maintainers = [ lib.maintainers.makefu ]; platforms = lib.platforms.unix; mainProgram = "snapraid"; }; })