disko/example/zfs-with-vdevs.nix

114 lines
2.4 KiB
Nix
Raw Permalink Normal View History

{
disko.devices = {
disk = {
x = {
type = "disk";
device = "/dev/sdx";
content = {
type = "gpt";
partitions = {
ESP = {
size = "64M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
};
};
};
};
y = {
type = "disk";
device = "/dev/sdy";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
};
};
};
};
z = {
type = "disk";
device = "/dev/sdz";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
};
};
};
};
cache = {
type = "disk";
device = "/dev/vdc";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
};
};
};
};
};
zpool = {
zroot = {
type = "zpool";
2024-08-26 16:24:41 +00:00
mode = {
topology = {
2024-08-26 17:03:25 +00:00
type = "topology";
2024-08-26 16:24:41 +00:00
vdev = [
{
mode = "mirror";
members = [ "x" "y" ];
}
];
special = {
members = [ "z" ];
};
2024-08-26 18:00:44 +00:00
cache = [ "cache" ];
2024-08-26 16:24:41 +00:00
};
};
rootFsOptions = {
compression = "zstd";
"com.sun:auto-snapshot" = "false";
};
mountpoint = "/";
datasets = {
# See examples/zfs.nix for more comprehensive usage.
zfs_fs = {
type = "zfs_fs";
mountpoint = "/zfs_fs";
options."com.sun:auto-snapshot" = "true";
};
};
};
};
};
}