web-01: create partionning scheme

This commit is contained in:
mdebray 2023-05-12 00:59:03 +00:00
parent a46aa18e36
commit 871f8e1e6a
3 changed files with 90 additions and 1 deletions

71
machines/web-01/disko.nix Normal file
View file

@ -0,0 +1,71 @@
{...}: {
disko.devices = {
disk = {
vdb = {
device = "/dev/vdb";
type = "disk";
content = {
type = "table";
format = "gpt";
partitions = [
{
name = "ESP";
start = "1MiB";
end = "512MiB";
fs-type = "fat32";
bootable = true;
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
}
{
name = "luks";
start = "512MiB";
end = "-4GiB";
content = rec {
type = "luks";
name = "mainfs";
extraOpenArgs = [ "--keyfile-size=1" ];
extraFormatArgs = extraOpenArgs;
keyFile = "/dev/zero";
content = {
type = "btrfs";
mountpoint = "/mnt/btrfs-root";
subvolumes = {
"/rootfs" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" ];
};
"/home" = {
mountOptions = [ "compress=zstd" ];
mountpoint = "/home";
};
"/var-log" = {
mountOptions = [ "compress=zstd" ];
mountpoint = "/var/log";
};
"/nix" = {
mountOptions = [ "noatime" "compress=zstd" ];
mountpoint = "/nix";
};
};
};
};
}
{
name = "swap";
start = "-4GiB";
end = "100%";
content = {
type = "swap";
randomEncryption = true;
};
}
];
};
};
};
};
}