2023-07-17 18:46:51 +02:00
|
|
|
{ disks ? [ "/dev/vdb" ], ... }: {
|
2023-07-17 16:50:07 +02:00
|
|
|
disko.devices = {
|
|
|
|
# {{{ Disks
|
|
|
|
disk = {
|
|
|
|
vdb = {
|
|
|
|
type = "disk";
|
|
|
|
device = builtins.elemAt disks 0;
|
|
|
|
content = {
|
|
|
|
type = "table";
|
|
|
|
format = "gpt";
|
|
|
|
partitions = [
|
|
|
|
{
|
|
|
|
name = "ESP";
|
|
|
|
start = "1MiB";
|
|
|
|
end = "100MiB";
|
|
|
|
bootable = true;
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "vfat";
|
|
|
|
mountpoint = "/boot";
|
2023-07-17 16:53:48 +02:00
|
|
|
mountOptions = [ "defaults" ];
|
2023-07-17 16:50:07 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
start = "100MiB";
|
|
|
|
end = "100%";
|
|
|
|
name = "primary";
|
|
|
|
content = {
|
|
|
|
type = "zfs";
|
|
|
|
pool = "zroot";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
# }}}
|
|
|
|
# {{{ zpools
|
|
|
|
zpool = {
|
|
|
|
zroot = {
|
|
|
|
type = "zpool";
|
2023-07-17 19:31:40 +02:00
|
|
|
mountpoint = "/";
|
2023-07-17 18:40:39 +02:00
|
|
|
|
2023-07-17 16:50:07 +02:00
|
|
|
postCreateHook = ''
|
|
|
|
zfs snapshot zroot@blank
|
|
|
|
zfs set keylocation="prompt" "zroot";
|
|
|
|
'';
|
2023-07-17 18:40:39 +02:00
|
|
|
|
2023-07-17 16:50:07 +02:00
|
|
|
rootFsOptions = {
|
|
|
|
compression = "lz4";
|
|
|
|
"com.sun:auto-snapshot" = "false";
|
|
|
|
encryption = "aes-256-gcm";
|
|
|
|
keyformat = "passphrase";
|
|
|
|
keylocation = "file:///tmp/secret.key";
|
|
|
|
};
|
|
|
|
|
|
|
|
# {{{ Datasets
|
|
|
|
datasets = {
|
|
|
|
"root/persist/data" = {
|
2023-07-17 18:54:31 +02:00
|
|
|
type = "zfs_fs";
|
2023-07-17 16:50:07 +02:00
|
|
|
mountpoint = "/persist/data";
|
|
|
|
options."com.sun:auto-snapshot" = "true";
|
|
|
|
};
|
|
|
|
"root/persist/state" = {
|
2023-07-17 18:54:31 +02:00
|
|
|
type = "zfs_fs";
|
2023-07-17 16:50:07 +02:00
|
|
|
mountpoint = "/persist/state";
|
|
|
|
options."com.sun:auto-snapshot" = "true";
|
|
|
|
};
|
2023-07-17 18:54:31 +02:00
|
|
|
"root/local/nix" = {
|
|
|
|
type = "zfs_fs";
|
|
|
|
mountpoint = "/nix";
|
|
|
|
};
|
2023-07-17 16:50:07 +02:00
|
|
|
"root/local/cache" = {
|
2023-07-17 18:54:31 +02:00
|
|
|
type = "zfs_fs";
|
2023-07-17 16:50:07 +02:00
|
|
|
mountpoint = "/persist/local/cache";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
# }}}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
# }}}
|
|
|
|
}
|