newton: use disko

This commit is contained in:
Felix Buehler 2023-09-02 17:42:43 +02:00
parent 2a713beab2
commit 4b389828ad
4 changed files with 81 additions and 31 deletions

View file

@ -0,0 +1,74 @@
{ disks ? [ "/dev/sda" ], ... }:
{
disk = {
vdb = {
type = "disk";
device = builtins.head disks;
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
};
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "encrypted";
extraOpenArgs = [ "--allow-discards" ];
passwordFile = "/tmp/disk.key";
content = {
type = "lvm_pv";
vg = "pool";
};
};
};
};
};
};
};
lvm_vg = {
pool = {
type = "lvm_vg";
lvs = {
root = {
size = "100G";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
srv = {
size = "350G";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/srv";
};
};
swap = {
size = "4G";
content = {
type = "swap";
randomEncryption = true;
resumeDevice = true;
};
};
};
};
};
}