nixos-anywhere-example/disk-configs/zfs.nix

106 lines
2.2 KiB
Nix
Raw Normal View History

2023-08-15 13:29:21 +02:00
{
networking.hostId = "8425e349"; # needed for ZFS
disko.devices = {
disk = {
disk1 = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
};
ESP = {
size = "500M";
type = "EF00";
content = {
type = "mdraid";
name = "boot";
};
};
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
};
};
};
};
disk2 = {
type = "disk";
device = "/dev/nvme1n1";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
};
ESP = {
size = "500M";
type = "EF00";
content = {
type = "mdraid";
name = "boot";
};
};
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
};
};
};
};
};
zpool = {
zroot = {
type = "zpool";
mode = "mirror";
rootFsOptions = {
compression = "lz4";
"com.sun:auto-snapshot" = "true";
};
rootFsOptions = {
mountpoint = "none";
};
datasets = {
"root" = {
type = "zfs_fs";
mountpoint = null;
};
"root/nixos" = {
type = "zfs_fs";
mountpoint = "/";
};
"root/home" = {
type = "zfs_fs";
mountpoint = "/home";
};
};
};
};
mdadm = {
boot = {
type = "mdadm";
level = 1;
metadata = "1.0";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
};
};
}