summary refs log tree commit diff
path: root/nixos/modules/services/monitoring/hdaps.nix
blob: 2cad3b84d847c048876afced797716238a1a3bb6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ 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 {
    boot.kernelModules = [ "hdapsd" ];
    services.udev.packages = hdapsd;
    systemd.packages = hdapsd;
  };
}