2024-01-17 08:39:14 +01:00
|
|
|
{ disks ? [ "/dev/sda" ], ... }: {
|
2023-07-17 16:50:07 +02:00
|
|
|
disko.devices = {
|
|
|
|
# {{{ Disks
|
|
|
|
disk = {
|
2023-07-18 01:07:40 +02:00
|
|
|
x = {
|
2023-07-17 16:50:07 +02:00
|
|
|
type = "disk";
|
|
|
|
device = builtins.elemAt disks 0;
|
|
|
|
content = {
|
|
|
|
type = "table";
|
|
|
|
format = "gpt";
|
|
|
|
partitions = [
|
2024-01-17 08:31:33 +01:00
|
|
|
# {{{ Boot
|
2023-07-17 16:50:07 +02:00
|
|
|
{
|
|
|
|
name = "ESP";
|
2023-07-18 01:07:40 +02:00
|
|
|
start = "0";
|
2024-01-17 08:31:33 +01:00
|
|
|
end = "512MiB";
|
2023-07-18 01:06:27 +02:00
|
|
|
fs-type = "fat32";
|
2023-07-17 16:50:07 +02:00
|
|
|
bootable = true;
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
2023-07-18 01:06:27 +02:00
|
|
|
format = "vfat";
|
2023-07-17 16:50:07 +02:00
|
|
|
mountpoint = "/boot";
|
|
|
|
};
|
|
|
|
}
|
2024-01-17 08:31:33 +01:00
|
|
|
# }}}
|
|
|
|
# {{{ Main
|
2023-07-17 16:50:07 +02:00
|
|
|
{
|
2023-07-18 00:48:23 +02:00
|
|
|
name = "zfs";
|
2024-01-17 08:31:33 +01:00
|
|
|
start = "1GiB";
|
2023-07-17 16:50:07 +02:00
|
|
|
end = "100%";
|
|
|
|
content = {
|
|
|
|
type = "zfs";
|
|
|
|
pool = "zroot";
|
|
|
|
};
|
|
|
|
}
|
2024-01-17 08:31:33 +01:00
|
|
|
# }}}
|
2023-07-17 16:50:07 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
# }}}
|
|
|
|
# {{{ 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
|
|
|
|
'';
|
2023-07-17 18:40:39 +02:00
|
|
|
|
2023-07-17 16:50:07 +02:00
|
|
|
rootFsOptions = {
|
|
|
|
compression = "lz4";
|
|
|
|
"com.sun:auto-snapshot" = "false";
|
|
|
|
};
|
|
|
|
|
|
|
|
# {{{ Datasets
|
|
|
|
datasets = {
|
2024-01-18 02:24:34 +01:00
|
|
|
"secure" = {
|
2024-01-18 02:33:59 +01:00
|
|
|
type = "zfs_fs";
|
|
|
|
options = {
|
|
|
|
encryption = "aes-256-gcm";
|
|
|
|
keyformat = "passphrase";
|
|
|
|
keylocation = "file:///hermes/secrets/lapetus/disk.key";
|
|
|
|
};
|
2024-01-18 02:24:34 +01:00
|
|
|
};
|
|
|
|
"secure/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";
|
|
|
|
};
|
2024-01-18 02:24:34 +01:00
|
|
|
"secure/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";
|
|
|
|
};
|
2024-01-18 02:24:34 +01:00
|
|
|
"secure/local/nix" = {
|
2023-07-17 18:54:31 +02:00
|
|
|
type = "zfs_fs";
|
|
|
|
mountpoint = "/nix";
|
|
|
|
};
|
2024-01-18 02:24:34 +01:00
|
|
|
"secure/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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
# }}}
|
|
|
|
};
|
|
|
|
};
|
2023-07-17 19:35:34 +02:00
|
|
|
# }}}
|
2023-07-17 16:50:07 +02:00
|
|
|
};
|
|
|
|
}
|