types: init swap

This commit is contained in:
David Arnold 2022-11-05 15:17:35 -05:00 committed by lassulus
parent aca927667a
commit efc80d7d89
4 changed files with 131 additions and 3 deletions

52
example/swap.nix Normal file
View file

@ -0,0 +1,52 @@
{ disks ? [ "/dev/vdb" ], ... }: {
disk = {
vdb = {
device = builtins.elemAt disks 0;
type = "disk";
content = {
type = "table";
format = "gpt";
partitions = [
{
type = "partition";
name = "ESP";
start = "1MiB";
end = "100MiB";
bootable = true;
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
}
{
name = "root";
type = "partition";
start = "100MiB";
end = "-1G";
part-type = "primary";
bootable = true;
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
}
{
name = "root";
type = "partition";
start = "-1G";
end = "100%";
part-type = "primary";
bootable = true;
content = {
type = "swap";
randomEncryption = true;
};
}
];
};
};
};
}