aboutsummaryrefslogtreecommitdiff
path: root/modules/profiles/zfs/default.nix
blob: 9a5e0a2d3a62d8c4a2c7d252578848635e1e1788 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# modules/profiles/zfs/default.nix
#
# Enabling the ZFS kernel module and configuring notifications for scrub
# results, which are run monthly.

{
  lib,
  pkgs,
  ...
}:
{
  boot = {
    zfs.forceImportRoot = false;
    supportedFilesystems.zfs = lib.mkForce true;
  };

  services.zfs = {
    autoScrub.enable = true;
    zed = {
      enableMail = false;
      settings = {
        ZED_DEBUG_LOG = "/tmp/zed.debug.log";
        ZED_EMAIL_ADDR = [ "root" ];
        ZED_EMAIL_PROG = "/run/current-system/sw/bin/pushover";
        ZED_EMAIL_OPTS = "-t '@SUBJECT@'";
        ZED_NOTIFY_INTERVAL_SECS = 3600;
        ZED_NOTIFY_VERBOSE = true;
        ZED_USE_ENCLOSURE_LEDS = true;
        ZED_SCRUB_AFTER_RESILVER = true;
      };
    };
  };

  environment.systemPackages = with pkgs; [ zfs ];
}