1
Fork 0
satellite/hosts/nixos/lapetus/filesystems/partitions.nix
2024-01-18 02:24:34 +01:00

89 lines
2 KiB
Nix

{ disks ? [ "/dev/sda" ], ... }: {
disko.devices = {
# {{{ Disks
disk = {
x = {
type = "disk";
device = builtins.elemAt disks 0;
content = {
type = "table";
format = "gpt";
partitions = [
# {{{ Boot
{
name = "ESP";
start = "0";
end = "512MiB";
fs-type = "fat32";
bootable = true;
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
}
# }}}
# {{{ Main
{
name = "zfs";
start = "1GiB";
end = "100%";
content = {
type = "zfs";
pool = "zroot";
};
}
# }}}
];
};
};
};
# }}}
# {{{ zpools
zpool = {
zroot = {
type = "zpool";
mountpoint = "/";
postCreateHook = ''
zfs snapshot zroot@blank
'';
rootFsOptions = {
compression = "lz4";
"com.sun:auto-snapshot" = "false";
};
# {{{ Datasets
datasets = {
"secure" = {
encryption = "aes-256-gcm";
keyformat = "passphrase";
keylocation = "file:///hermes/secrets/lapetus/disk.key";
};
"secure/persist/data" = {
type = "zfs_fs";
mountpoint = "/persist/data";
options."com.sun:auto-snapshot" = "true";
};
"secure/persist/state" = {
type = "zfs_fs";
mountpoint = "/persist/state";
options."com.sun:auto-snapshot" = "true";
};
"secure/local/nix" = {
type = "zfs_fs";
mountpoint = "/nix";
};
"secure/local/cache" = {
type = "zfs_fs";
mountpoint = "/persist/local/cache";
};
};
# }}}
};
};
# }}}
};
}