2023-07-15 18:42:37 +00:00
|
|
|
{
|
2023-03-03 07:09:13 +00:00
|
|
|
disko.devices = {
|
|
|
|
disk = {
|
|
|
|
x = {
|
|
|
|
type = "disk";
|
2023-07-15 18:42:37 +00:00
|
|
|
device = "/dev/sdx";
|
2023-03-03 07:09:13 +00:00
|
|
|
content = {
|
2023-07-15 18:42:37 +00:00
|
|
|
type = "gpt";
|
|
|
|
partitions = {
|
|
|
|
ESP = {
|
|
|
|
size = "64M";
|
2023-07-20 16:03:59 +00:00
|
|
|
type = "EF00";
|
2023-03-03 07:09:13 +00:00
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "vfat";
|
|
|
|
mountpoint = "/boot";
|
|
|
|
};
|
2023-07-15 18:42:37 +00:00
|
|
|
};
|
|
|
|
zfs = {
|
|
|
|
size = "100%";
|
2023-03-03 07:09:13 +00:00
|
|
|
content = {
|
|
|
|
type = "zfs";
|
|
|
|
pool = "zroot";
|
|
|
|
};
|
2023-07-15 18:42:37 +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
|
|
|
y = {
|
|
|
|
type = "disk";
|
2023-07-15 18:42:37 +00:00
|
|
|
device = "/dev/sdy";
|
2023-03-03 07:09:13 +00:00
|
|
|
content = {
|
2023-07-15 18:42:37 +00:00
|
|
|
type = "gpt";
|
|
|
|
partitions = {
|
|
|
|
zfs = {
|
|
|
|
size = "100%";
|
2023-03-03 07:09:13 +00:00
|
|
|
content = {
|
|
|
|
type = "zfs";
|
|
|
|
pool = "zroot";
|
|
|
|
};
|
2023-07-15 18:42:37 +00:00
|
|
|
};
|
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
};
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
2022-08-25 13:08:26 +00:00
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
zpool = {
|
|
|
|
zroot = {
|
|
|
|
type = "zpool";
|
|
|
|
mode = "mirror";
|
|
|
|
rootFsOptions = {
|
2023-09-04 21:02:07 +00:00
|
|
|
compression = "zstd";
|
2023-03-03 07:09:13 +00:00
|
|
|
"com.sun:auto-snapshot" = "false";
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
mountpoint = "/";
|
2024-03-12 03:22:46 +00:00
|
|
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank";
|
2023-03-03 07:09:13 +00:00
|
|
|
|
|
|
|
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";
|
2022-08-25 13:08:26 +00:00
|
|
|
};
|
2023-03-03 07:09:13 +00:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
encrypted = {
|
2023-04-07 16:29:48 +00:00
|
|
|
type = "zfs_fs";
|
2023-03-03 07:09:13 +00:00
|
|
|
options = {
|
|
|
|
mountpoint = "none";
|
|
|
|
encryption = "aes-256-gcm";
|
|
|
|
keyformat = "passphrase";
|
|
|
|
keylocation = "file:///tmp/secret.key";
|
|
|
|
};
|
2023-07-11 07:29:28 +00:00
|
|
|
# use this to read the key during boot
|
|
|
|
# postCreateHook = ''
|
|
|
|
# zfs set keylocation="prompt" "zroot/$name";
|
|
|
|
# '';
|
2023-03-03 07:09:13 +00:00
|
|
|
};
|
|
|
|
"encrypted/test" = {
|
2023-04-07 16:29:48 +00:00
|
|
|
type = "zfs_fs";
|
2023-03-03 07:09:13 +00:00
|
|
|
mountpoint = "/zfs_crypted";
|
2022-12-26 16:46:05 +00:00
|
|
|
};
|
|
|
|
};
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
2022-08-25 13:08:26 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|