2022-12-28 10:18:54 +00:00
|
|
|
{ lib, ... }:
|
|
|
|
{
|
|
|
|
disk = (lib.genAttrs [ "/dev/nvme0n1" "/dev/nvme1n1" ] (disk: {
|
|
|
|
type = "disk";
|
|
|
|
device = disk;
|
|
|
|
content = {
|
|
|
|
type = "table";
|
|
|
|
format = "gpt";
|
|
|
|
partitions = [
|
|
|
|
{
|
|
|
|
name = "boot";
|
|
|
|
start = "0";
|
|
|
|
end = "1M";
|
|
|
|
part-type = "primary";
|
|
|
|
flags = ["bios_grub"];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "ESP";
|
|
|
|
start = "1M";
|
|
|
|
end = "1GiB";
|
|
|
|
fs-type = "fat32";
|
|
|
|
bootable = true;
|
|
|
|
content = {
|
|
|
|
type = "mdraid";
|
|
|
|
name = "boot";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "zfs";
|
|
|
|
start = "1GiB";
|
|
|
|
end = "100%";
|
|
|
|
content = {
|
|
|
|
type = "zfs";
|
|
|
|
pool = "zroot";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
})) // {
|
|
|
|
hdd1 = {
|
|
|
|
type = "disk";
|
|
|
|
device = "/dev/sda";
|
|
|
|
content = {
|
|
|
|
type = "zfs";
|
|
|
|
pool = "tank";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
mdadm = {
|
|
|
|
boot = {
|
|
|
|
type = "mdadm";
|
|
|
|
level = 1;
|
|
|
|
metadata = "1.0";
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "vfat";
|
|
|
|
mountpoint = "/boot";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
zpool = {
|
|
|
|
zroot = {
|
|
|
|
type = "zpool";
|
|
|
|
mode = "mirror";
|
|
|
|
mountpoint = "/";
|
|
|
|
rootFsOptions = {
|
|
|
|
};
|
|
|
|
datasets.reserved = {
|
2023-07-08 15:03:28 +00:00
|
|
|
type = "zfs_fs";
|
2022-12-28 10:18:54 +00:00
|
|
|
options.refreservation = "1G";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
tank = {
|
|
|
|
type = "zpool";
|
|
|
|
datasets = {
|
|
|
|
reserved = {
|
2023-07-08 15:03:28 +00:00
|
|
|
type = "zfs_fs";
|
2022-12-28 10:18:54 +00:00
|
|
|
options.refreservation = "1G";
|
|
|
|
};
|
|
|
|
containers = {
|
2023-07-08 15:03:28 +00:00
|
|
|
type = "zfs_fs";
|
2022-12-28 10:18:54 +00:00
|
|
|
mountpoint = "/var/lib/containers";
|
2023-07-08 15:03:28 +00:00
|
|
|
options = {
|
|
|
|
canmount = "noauto";
|
|
|
|
};
|
2022-12-28 10:18:54 +00:00
|
|
|
};
|
|
|
|
home = {
|
2023-07-08 15:03:28 +00:00
|
|
|
type = "zfs_fs";
|
2022-12-28 10:18:54 +00:00
|
|
|
mountpoint = "/home";
|
2023-07-08 15:03:28 +00:00
|
|
|
options = {
|
|
|
|
canmount = "noauto";
|
|
|
|
};
|
2022-12-28 10:18:54 +00:00
|
|
|
};
|
|
|
|
srv = {
|
2023-07-08 15:03:28 +00:00
|
|
|
type = "zfs_fs";
|
2022-12-28 10:18:54 +00:00
|
|
|
mountpoint = "/srv";
|
2023-07-08 15:03:28 +00:00
|
|
|
options = {
|
|
|
|
canmount = "noauto";
|
|
|
|
};
|
2022-12-28 10:18:54 +00:00
|
|
|
};
|
|
|
|
libvirt = {
|
2023-07-08 15:03:28 +00:00
|
|
|
type = "zfs_fs";
|
2022-12-28 10:18:54 +00:00
|
|
|
mountpoint = "/var/lib/libvirt";
|
2023-07-08 15:03:28 +00:00
|
|
|
options = {
|
|
|
|
canmount = "noauto";
|
|
|
|
};
|
2022-12-28 10:18:54 +00:00
|
|
|
};
|
|
|
|
# encrypted = {
|
2023-07-08 15:03:28 +00:00
|
|
|
# type = "zfs_fs";
|
2022-12-28 10:18:54 +00:00
|
|
|
# options = {
|
2023-07-08 15:03:28 +00:00
|
|
|
# canmount = "noauto";
|
2022-12-28 10:18:54 +00:00
|
|
|
# mountpoint = "none";
|
|
|
|
# encryption = "aes-256-gcm";
|
|
|
|
# keyformat = "passphrase";
|
|
|
|
# keylocation = "prompt";
|
|
|
|
# };
|
|
|
|
# };
|
|
|
|
# "encrypted/download" = {
|
2023-07-08 15:03:28 +00:00
|
|
|
# type = "zfs_fs";
|
2022-12-28 10:18:54 +00:00
|
|
|
# mountpoint = "/var/download";
|
2023-07-08 15:03:28 +00:00
|
|
|
# options = {
|
|
|
|
# canmount = "noauto";
|
|
|
|
# };
|
2022-12-28 10:18:54 +00:00
|
|
|
# };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|