New hdapsd module
This commit is contained in:
parent
838805f5c8
commit
b16dc8dcc5
|
@ -257,6 +257,7 @@
|
||||||
./services/monitoring/dd-agent.nix
|
./services/monitoring/dd-agent.nix
|
||||||
./services/monitoring/grafana.nix
|
./services/monitoring/grafana.nix
|
||||||
./services/monitoring/graphite.nix
|
./services/monitoring/graphite.nix
|
||||||
|
./services/monitoring/hdaps.nix
|
||||||
./services/monitoring/heapster.nix
|
./services/monitoring/heapster.nix
|
||||||
./services/monitoring/longview.nix
|
./services/monitoring/longview.nix
|
||||||
./services/monitoring/monit.nix
|
./services/monitoring/monit.nix
|
||||||
|
|
22
nixos/modules/services/monitoring/hdaps.nix
Normal file
22
nixos/modules/services/monitoring/hdaps.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.hdapsd;
|
||||||
|
hdapsd = [ pkgs.hdapsd ];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
services.hdapsd.enable = mkEnableOption
|
||||||
|
''
|
||||||
|
Hard Drive Active Protection System Daemon,
|
||||||
|
devices are detected and managed automatically by udev and systemd
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
services.udev.packages = hdapsd;
|
||||||
|
systemd.packages = hdapsd;
|
||||||
|
};
|
||||||
|
}
|
|
@ -2,13 +2,15 @@
|
||||||
|
|
||||||
let version = "20141203"; in
|
let version = "20141203"; in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "ldapsd-"+version;
|
name = "hdapsd-"+version;
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://github.com/evgeni/hdapsd/releases/download/${version}/hdapsd-${version}.tar.gz";
|
url = "https://github.com/evgeni/hdapsd/releases/download/${version}/hdapsd-${version}.tar.gz";
|
||||||
sha256 = "0ppgrfabd0ivx9hyny3c3rv4rphjyxcdsd5svx5pgfai49mxnl36";
|
sha256 = "0ppgrfabd0ivx9hyny3c3rv4rphjyxcdsd5svx5pgfai49mxnl36";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
postInstall = builtins.readFile ./postInstall.sh;
|
||||||
|
|
||||||
meta = with stdenv.lib;
|
meta = with stdenv.lib;
|
||||||
{ description = "Hard Drive Active Protection System Daemon";
|
{ description = "Hard Drive Active Protection System Daemon";
|
||||||
hompage = "http://hdaps.sf.net/";
|
hompage = "http://hdaps.sf.net/";
|
||||||
|
@ -16,4 +18,4 @@ stdenv.mkDerivation rec {
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
maintainers = [ maintainers.ehmry ];
|
maintainers = [ maintainers.ehmry ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
7
pkgs/os-specific/linux/hdapsd/postInstall.sh
Normal file
7
pkgs/os-specific/linux/hdapsd/postInstall.sh
Normal 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
|
||||||
|
|
Loading…
Reference in a new issue