enable zfs settings by default

This commit is contained in:
Jörg Thalheim
2024-09-15 12:46:09 +02:00
parent ae3849ce00
commit 3969f63d56
3 changed files with 1 additions and 2 deletions

View File

@@ -18,5 +18,6 @@
./vm.nix
./wayland-proxy-virtwl.nix
./zerotier
./zfs.nix
];
}

View File

@@ -0,0 +1,16 @@
{ lib, config, ... }:
{
# Use the same default hostID as the NixOS install ISO and nixos-anywhere.
# This allows us to import zfs pool without using a force import.
# ZFS has this as a safety mechanism for networked block storage (ISCSI), but
# in practice we found it causes more breakages like unbootable machines,
# while people using ZFS on ISCSI is quite rare.
networking.hostId = lib.mkDefault "8425e349";
services.zfs = lib.mkIf (config.boot.zfs.enabled) {
autoSnapshot.enable = true;
# defaults to 12, which is a bit much given how much data is written
autoSnapshot.monthly = lib.mkDefault 1;
autoScrub.enable = true;
};
}