From 060f49bc44a4ba86417c3551a692645ee4aacab1 Mon Sep 17 00:00:00 2001 From: Matteo Pacini Date: Sat, 22 Jun 2024 23:58:46 +0100 Subject: [PATCH] snapraid: fix for SMART cmd error --- pkgs/tools/filesystems/snapraid/default.nix | 23 ++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/filesystems/snapraid/default.nix b/pkgs/tools/filesystems/snapraid/default.nix index 48a029dd1b06..83353394e009 100644 --- a/pkgs/tools/filesystems/snapraid/default.nix +++ b/pkgs/tools/filesystems/snapraid/default.nix @@ -1,4 +1,11 @@ -{ lib, stdenv, fetchFromGitHub, autoreconfHook }: +{ + lib, + stdenv, + fetchFromGitHub, + autoreconfHook, + smartmontools, + makeWrapper, +}: stdenv.mkDerivation rec { pname = "snapraid"; @@ -8,16 +15,26 @@ stdenv.mkDerivation rec { owner = "amadvance"; repo = "snapraid"; rev = "v${version}"; - sha256 = "sha256-pkLooA3JZV/rPlE5+JeJN1QW2xAdNu7c/iFFtT4M4vc="; + hash = "sha256-pkLooA3JZV/rPlE5+JeJN1QW2xAdNu7c/iFFtT4M4vc="; }; VERSION = version; doCheck = !(stdenv.isDarwin && stdenv.isx86_64); - nativeBuildInputs = [ autoreconfHook ]; + nativeBuildInputs = [ + autoreconfHook + makeWrapper + ]; + buildInputs = [ ]; + # SMART is only supported on Linux and requires the smartmontools package + postInstall = lib.optionalString stdenv.isLinux '' + wrapProgram $out/bin/snapraid \ + --prefix PATH : ${lib.makeBinPath [ smartmontools ]} + ''; + meta = { homepage = "http://www.snapraid.it/"; description = "Backup program for disk arrays";