This commit is contained in:
2026-03-24 17:00:49 +01:00
commit da32fc7529
8 changed files with 772 additions and 0 deletions

28
modules/zfs-root.nix Normal file
View File

@@ -0,0 +1,28 @@
{ ... }:
{
boot.supportedFilesystems = [ "zfs" ];
boot.zfs.devNodes = "/dev/disk/by-id";
boot.initrd.systemd.enable = true;
boot.initrd.luks.devices.cryptroot = {
device = "/dev/disk/by-partlabel/cryptroot";
allowDiscards = true;
crypttabExtraOpts = [
"tpm2-device=auto"
"tpm2-pcrs=7"
];
};
security.tpm2 = {
enable = true;
pkcs11.enable = true;
tctiEnvironment.enable = true;
};
services.zfs = {
autoScrub.enable = true;
trim.enable = true;
autoSnapshot.enable = true;
};
services.fstrim.enable = false;
}