New hdapsd module

This commit is contained in:
Emery
2016-02-24 21:43:38 +01:00
parent 838805f5c8
commit b16dc8dcc5
4 changed files with 34 additions and 2 deletions

View File

@@ -2,13 +2,15 @@
let version = "20141203"; in
stdenv.mkDerivation rec {
name = "ldapsd-"+version;
name = "hdapsd-"+version;
src = fetchurl {
url = "https://github.com/evgeni/hdapsd/releases/download/${version}/hdapsd-${version}.tar.gz";
sha256 = "0ppgrfabd0ivx9hyny3c3rv4rphjyxcdsd5svx5pgfai49mxnl36";
};
postInstall = builtins.readFile ./postInstall.sh;
meta = with stdenv.lib;
{ description = "Hard Drive Active Protection System Daemon";
hompage = "http://hdaps.sf.net/";
@@ -16,4 +18,4 @@ stdenv.mkDerivation rec {
platforms = platforms.linux;
maintainers = [ maintainers.ehmry ];
};
}
}

View File

@@ -0,0 +1,7 @@
mkdir -p $out/lib/udev/rules.d $out/lib/systemd/system
cp misc/hdapsd.rules $out/lib/udev/rules.d
SBIN_REWRITE="s|@sbindir@|$out/bin|g"
for i in misc/*.service.in
do sed $SBIN_REWRITE "$i" > "$out/lib/systemd/system/$(basename ${i%.in})"
done