stockholm/lass/1systems/neoprism/disk.nix

119 lines
2.4 KiB
Nix
Raw Normal View History

2022-12-28 10:18:54 +00:00
{ lib, ... }:
{
disk = (lib.genAttrs [ "/dev/nvme0n1" "/dev/nvme1n1" ] (disk: {
type = "disk";
device = disk;
content = {
2023-07-23 21:02:02 +00:00
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02";
};
ESP = {
size = "1G";
2022-12-28 10:18:54 +00:00
content = {
type = "mdraid";
name = "boot";
};
2023-07-23 21:02:02 +00:00
};
zfs = {
size = "100%";
2022-12-28 10:18:54 +00:00
content = {
type = "zfs";
pool = "zroot";
};
2023-07-23 21:02:02 +00:00
};
};
2022-12-28 10:18:54 +00:00
};
})) // {
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
# };
};
};
};
}