2022-10-23 09:30:50 +00:00
|
|
|
{ disks ? [ "/dev/vdb" "/dev/vdc" "/dev/vdd" ], ... }: {
|
2023-03-03 07:09:13 +00:00
|
|
|
disko.devices = {
|
|
|
|
disk = {
|
|
|
|
disk0 = {
|
|
|
|
type = "disk";
|
|
|
|
device = builtins.elemAt disks 0;
|
|
|
|
content = {
|
2023-07-01 22:17:48 +00:00
|
|
|
type = "gpt";
|
|
|
|
partitions = {
|
|
|
|
ESP = {
|
2023-03-03 07:09:13 +00:00
|
|
|
start = "1MiB";
|
|
|
|
end = "128MiB";
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "vfat";
|
|
|
|
mountpoint = "/boot";
|
|
|
|
};
|
2023-07-01 22:17:48 +00:00
|
|
|
};
|
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
};
|
2022-09-30 10:55:28 +00:00
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
disk1 = {
|
|
|
|
type = "disk";
|
|
|
|
device = builtins.elemAt disks 1;
|
|
|
|
content = {
|
2023-07-01 22:17:48 +00:00
|
|
|
type = "gpt";
|
|
|
|
partitions = {
|
|
|
|
luks = {
|
2023-03-03 07:09:13 +00:00
|
|
|
start = "1M";
|
2023-07-01 22:17:48 +00:00
|
|
|
size = "100%";
|
2022-08-29 09:45:19 +00:00
|
|
|
content = {
|
2023-03-03 07:09:13 +00:00
|
|
|
type = "luks";
|
|
|
|
name = "crypted1";
|
2023-07-10 15:23:05 +00:00
|
|
|
settings.keyFile = "/tmp/secret.key";
|
2023-07-06 18:33:44 +00:00
|
|
|
additionalKeyFiles = ["/tmp/additionalSecret.key"];
|
2023-03-03 07:09:13 +00:00
|
|
|
extraFormatArgs = [
|
2023-07-10 15:23:05 +00:00
|
|
|
"--iter-time 1" # unsecure but fast for tests
|
2023-03-03 07:09:13 +00:00
|
|
|
];
|
|
|
|
content = {
|
|
|
|
type = "lvm_pv";
|
|
|
|
vg = "pool";
|
|
|
|
};
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
2023-07-01 22:17:48 +00:00
|
|
|
};
|
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
disk2 = {
|
|
|
|
type = "disk";
|
|
|
|
device = builtins.elemAt disks 2;
|
|
|
|
content = {
|
2023-07-01 22:17:48 +00:00
|
|
|
type = "gpt";
|
|
|
|
partitions = {
|
|
|
|
luks = {
|
2023-03-03 07:09:13 +00:00
|
|
|
start = "1M";
|
2023-07-01 22:17:48 +00:00
|
|
|
size = "100%";
|
2023-03-03 07:09:13 +00:00
|
|
|
content = {
|
|
|
|
type = "luks";
|
|
|
|
name = "crypted2";
|
2023-07-10 15:23:05 +00:00
|
|
|
settings.keyFile = "/tmp/secret.key";
|
2023-03-03 07:09:13 +00:00
|
|
|
extraFormatArgs = [
|
2023-07-10 15:23:05 +00:00
|
|
|
"--iter-time 1" # unsecure but fast for tests
|
2023-03-03 07:09:13 +00:00
|
|
|
];
|
|
|
|
content = {
|
|
|
|
type = "lvm_pv";
|
|
|
|
vg = "pool";
|
|
|
|
};
|
|
|
|
};
|
2023-07-01 22:17:48 +00:00
|
|
|
};
|
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
};
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
mdadm = {
|
|
|
|
raid1 = {
|
|
|
|
type = "mdadm";
|
|
|
|
level = 1;
|
|
|
|
content = {
|
2023-07-01 22:17:48 +00:00
|
|
|
type = "gpt";
|
|
|
|
partitions = {
|
|
|
|
bla = {
|
2023-03-03 07:09:13 +00:00
|
|
|
start = "1MiB";
|
2023-07-01 22:17:48 +00:00
|
|
|
size = "100%";
|
2022-08-29 09:45:19 +00:00
|
|
|
content = {
|
2023-03-03 07:09:13 +00:00
|
|
|
type = "filesystem";
|
|
|
|
format = "ext4";
|
|
|
|
mountpoint = "/ext4_mdadm_lvm";
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
2023-07-01 22:17:48 +00:00
|
|
|
};
|
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
};
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
lvm_vg = {
|
|
|
|
pool = {
|
|
|
|
type = "lvm_vg";
|
|
|
|
lvs = {
|
|
|
|
root = {
|
|
|
|
size = "10M";
|
|
|
|
lvm_type = "mirror";
|
2022-08-29 09:45:19 +00:00
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
2022-09-30 10:55:28 +00:00
|
|
|
format = "ext4";
|
2023-03-03 07:09:13 +00:00
|
|
|
mountpoint = "/ext4_on_lvm";
|
|
|
|
mountOptions = [
|
|
|
|
"defaults"
|
|
|
|
];
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
raid1 = {
|
|
|
|
size = "30M";
|
|
|
|
lvm_type = "raid0";
|
|
|
|
content = {
|
|
|
|
type = "mdraid";
|
|
|
|
name = "raid1";
|
|
|
|
};
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
raid2 = {
|
|
|
|
size = "30M";
|
|
|
|
lvm_type = "raid0";
|
|
|
|
content = {
|
|
|
|
type = "mdraid";
|
|
|
|
name = "raid1";
|
|
|
|
};
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
zfs1 = {
|
|
|
|
size = "128M";
|
|
|
|
lvm_type = "raid0";
|
|
|
|
content = {
|
|
|
|
type = "zfs";
|
|
|
|
pool = "zroot";
|
|
|
|
};
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
zfs2 = {
|
|
|
|
size = "128M";
|
|
|
|
lvm_type = "raid0";
|
|
|
|
content = {
|
|
|
|
type = "zfs";
|
|
|
|
pool = "zroot";
|
|
|
|
};
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
zpool = {
|
|
|
|
zroot = {
|
|
|
|
type = "zpool";
|
|
|
|
mode = "mirror";
|
|
|
|
rootFsOptions = {
|
|
|
|
compression = "lz4";
|
|
|
|
"com.sun:auto-snapshot" = "false";
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
mountpoint = "/";
|
|
|
|
|
|
|
|
datasets = {
|
|
|
|
zfs_fs = {
|
2023-04-07 16:29:48 +00:00
|
|
|
type = "zfs_fs";
|
2023-03-03 07:09:13 +00:00
|
|
|
mountpoint = "/zfs_fs";
|
|
|
|
options."com.sun:auto-snapshot" = "true";
|
|
|
|
};
|
|
|
|
zfs_unmounted_fs = {
|
2023-04-07 16:29:48 +00:00
|
|
|
type = "zfs_fs";
|
2023-03-03 07:09:13 +00:00
|
|
|
options.mountpoint = "none";
|
|
|
|
};
|
|
|
|
zfs_legacy_fs = {
|
2023-04-07 16:29:48 +00:00
|
|
|
type = "zfs_fs";
|
2023-03-03 07:09:13 +00:00
|
|
|
options.mountpoint = "legacy";
|
|
|
|
mountpoint = "/zfs_legacy_fs";
|
|
|
|
};
|
|
|
|
zfs_testvolume = {
|
2023-04-07 16:29:48 +00:00
|
|
|
type = "zfs_volume";
|
2023-03-03 07:09:13 +00:00
|
|
|
size = "10M";
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "ext4";
|
|
|
|
mountpoint = "/ext4onzfs";
|
|
|
|
};
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|