tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
New hdapsd module
Emery
10 years ago
b16dc8dc
838805f5
+34
-2
4 changed files
expand all
collapse all
unified
split
nixos
modules
module-list.nix
services
monitoring
hdaps.nix
pkgs
os-specific
linux
hdapsd
default.nix
postInstall.sh
+1
nixos/modules/module-list.nix
···
257
257
./services/monitoring/dd-agent.nix
258
258
./services/monitoring/grafana.nix
259
259
./services/monitoring/graphite.nix
260
260
+
./services/monitoring/hdaps.nix
260
261
./services/monitoring/heapster.nix
261
262
./services/monitoring/longview.nix
262
263
./services/monitoring/monit.nix
+22
nixos/modules/services/monitoring/hdaps.nix
···
1
1
+
{ config, lib, pkgs, ... }:
2
2
+
3
3
+
with lib;
4
4
+
5
5
+
let
6
6
+
cfg = config.services.hdapsd;
7
7
+
hdapsd = [ pkgs.hdapsd ];
8
8
+
in
9
9
+
{
10
10
+
options = {
11
11
+
services.hdapsd.enable = mkEnableOption
12
12
+
''
13
13
+
Hard Drive Active Protection System Daemon,
14
14
+
devices are detected and managed automatically by udev and systemd
15
15
+
'';
16
16
+
};
17
17
+
18
18
+
config = mkIf cfg.enable {
19
19
+
services.udev.packages = hdapsd;
20
20
+
systemd.packages = hdapsd;
21
21
+
};
22
22
+
}
+4
-2
pkgs/os-specific/linux/hdapsd/default.nix
···
2
2
3
3
let version = "20141203"; in
4
4
stdenv.mkDerivation rec {
5
5
-
name = "ldapsd-"+version;
5
5
+
name = "hdapsd-"+version;
6
6
7
7
src = fetchurl {
8
8
url = "https://github.com/evgeni/hdapsd/releases/download/${version}/hdapsd-${version}.tar.gz";
9
9
sha256 = "0ppgrfabd0ivx9hyny3c3rv4rphjyxcdsd5svx5pgfai49mxnl36";
10
10
};
11
11
12
12
+
postInstall = builtins.readFile ./postInstall.sh;
13
13
+
12
14
meta = with stdenv.lib;
13
15
{ description = "Hard Drive Active Protection System Daemon";
14
16
hompage = "http://hdaps.sf.net/";
···
16
18
platforms = platforms.linux;
17
19
maintainers = [ maintainers.ehmry ];
18
20
};
19
19
-
}
21
21
+
}
+7
pkgs/os-specific/linux/hdapsd/postInstall.sh
···
1
1
+
mkdir -p $out/lib/udev/rules.d $out/lib/systemd/system
2
2
+
cp misc/hdapsd.rules $out/lib/udev/rules.d
3
3
+
SBIN_REWRITE="s|@sbindir@|$out/bin|g"
4
4
+
for i in misc/*.service.in
5
5
+
do sed $SBIN_REWRITE "$i" > "$out/lib/systemd/system/$(basename ${i%.in})"
6
6
+
done
7
7
+