infrastructure/machines/web01/disko.nix
sinavir 30e13a116f
All checks were successful
build configuration / build_vault01 (push) Successful in 1m5s
build configuration / build_rescue01 (push) Successful in 1m5s
build configuration / build_web02 (push) Successful in 1m7s
build configuration / build_storage01 (push) Successful in 1m8s
build configuration / build_compute01 (push) Successful in 1m15s
lint / check (push) Successful in 22s
build configuration / build_web01 (push) Successful in 1m42s
fix(web01): Fix disko config
2024-03-13 23:53:01 +01:00

82 lines
2.2 KiB
Nix

_:
let
luksName = "mainfs";
in
{
boot.initrd.luks.devices.${luksName} = {
keyFile = "/dev/zero";
keyFileSize = 1;
};
disko.devices = {
disk = {
vdb = {
device = "/dev/vdb";
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
start = "1MiB";
label = "ESP";
end = "512MiB";
type = "EF00";
priority = 1;
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
luks = {
start = "512MiB";
end = "-4GiB";
content = rec {
type = "luks";
name = luksName;
extraOpenArgs = [ "--keyfile-size=1" ];
extraFormatArgs = extraOpenArgs;
settings.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";
};
};
};
};
};
swap = {
label = "swap";
start = "-4GiB";
end = "100%";
priority = 3;
content = {
type = "swap";
randomEncryption = true;
};
};
};
};
};
};
};
}