2022-10-21 12:43:55 +00:00
|
|
|
{ disks ? [ "/dev/vdb" ], ... }: {
|
2022-08-29 09:45:19 +00:00
|
|
|
disk = {
|
2022-08-25 19:46:17 +00:00
|
|
|
vdb = {
|
2022-08-29 09:45:19 +00:00
|
|
|
type = "disk";
|
2022-09-30 10:55:28 +00:00
|
|
|
device = builtins.elemAt disks 0;
|
2022-08-29 09:45:19 +00:00
|
|
|
content = {
|
|
|
|
type = "table";
|
|
|
|
format = "gpt";
|
|
|
|
partitions = [
|
2022-09-30 10:55:28 +00:00
|
|
|
{
|
|
|
|
type = "partition";
|
|
|
|
name = "ESP";
|
|
|
|
start = "1MiB";
|
|
|
|
end = "128MiB";
|
|
|
|
fs-type = "fat32";
|
|
|
|
bootable = true;
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "vfat";
|
|
|
|
mountpoint = "/boot";
|
|
|
|
};
|
|
|
|
}
|
2022-08-29 09:45:19 +00:00
|
|
|
{
|
|
|
|
name = "root";
|
|
|
|
type = "partition";
|
2022-09-30 10:55:28 +00:00
|
|
|
start = "128MiB";
|
2022-08-29 09:45:19 +00:00
|
|
|
end = "100%";
|
|
|
|
content = {
|
|
|
|
type = "btrfs";
|
2023-02-14 08:58:37 +00:00
|
|
|
extraArgs = [ "-f" ]; # Override existing partition
|
2022-12-17 17:09:10 +00:00
|
|
|
subvolumes = {
|
|
|
|
# Subvolume name is different from mountpoint
|
|
|
|
"/rootfs" = {
|
|
|
|
mountpoint = "/";
|
|
|
|
};
|
|
|
|
# Mountpoints inferred from subvolume name
|
|
|
|
"/home" = {
|
2023-02-07 15:56:08 +00:00
|
|
|
mountOptions = [ "compress=zstd" ];
|
2022-12-17 17:09:10 +00:00
|
|
|
};
|
|
|
|
"/nix" = {
|
2023-02-07 15:56:08 +00:00
|
|
|
mountOptions = [ "compress=zstd" "noatime" ];
|
2022-12-17 17:09:10 +00:00
|
|
|
};
|
2023-02-07 15:56:08 +00:00
|
|
|
"/test" = { };
|
2022-12-17 17:09:10 +00:00
|
|
|
};
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2022-08-25 19:46:17 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|