summaryrefslogtreecommitdiff
path: root/hosts/surtr/zfs.nix
blob: 3a69fd96b852c4f30dd1f29e3a5cbb160517bdbe (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ pkgs, config, ... }:
{
  config = {
    fileSystems = {
      "/nix" =
        { device = "surtr/local/nix";
          fsType = "zfs";
        };

      "/root" =
        { device = "surtr/safe/home-root";
          fsType = "zfs";
          neededForBoot = true;
        };

      "/var/lib/systemd" =
        { device = "surtr/local/var-lib-systemd";
          fsType = "zfs";
          neededForBoot = true;
        };
      
      "/var/lib/nixos" =
        { device = "surtr/local/var-lib-nixos";
          fsType = "zfs";
          neededForBoot = true;
        };

      "/var/log" =
        { device = "surtr/local/var-log";
          fsType = "zfs";
        };

      "/home" =
        { device = "surtr/safe/home";
          fsType = "zfs";
        };

      "/srv" =
        { device = "surtr/safe/srv";
          fsType = "zfs";
          options = [ "zfsutil" ];
        };
    };

    services.zfssnap.enable = true;
    services.zfs.trim.enable = false;
    services.zfs.autoScrub = {
      enable = true;
      interval = "Sun *-*-1..7 04:00:00";
    };
    services.zfs.zed.settings = {
      ZED_SYSLOG_SUBCLASS_EXCLUDE = "history_event";
    };
  };
}