machine/serverle: fix disko formatting file

This commit is contained in:
Felix Buehler 2023-11-04 13:03:19 +01:00
parent c958967e5b
commit 8f0a147cb3
2 changed files with 59 additions and 61 deletions

View file

@ -1,6 +1,7 @@
{ config, ... }: { config, ... }:
{ {
imports = [ imports = [
./disko-config.nix
./hardware-configuration.nix ./hardware-configuration.nix
./network.nix ./network.nix
./services.nix ./services.nix
@ -9,10 +10,6 @@
./wifi.nix ./wifi.nix
]; ];
disko.devices = import ./disko-config.nix {
disks = [ "/dev/disk/by-id/usb-Seagate_Expansion_2HC015KJ-0:0" ];
};
networking.hostName = "serverle"; networking.hostName = "serverle";
sops = { sops = {

View file

@ -1,71 +1,72 @@
{ disks ? [ "/dev/sda" ], ... }:
{ {
disk = { disko.devices = {
vdb = { disk = {
type = "disk"; vdb = {
device = builtins.head disks; type = "disk";
content = { device = "/dev/disk/by-id/usb-Seagate_Expansion_2HC015KJ-0:0";
type = "gpt"; content = {
partitions = { type = "gpt";
boot = { partitions = {
size = "1M"; boot = {
type = "EF02"; # for grub MBR size = "1M";
}; type = "EF02"; # for grub MBR
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
}; };
}; ESP = {
luks = { size = "512M";
size = "100%"; type = "EF00";
content = {
type = "luks";
name = "encrypted";
extraOpenArgs = [ "--allow-discards" ];
passwordFile = "/tmp/disk.key";
content = { content = {
type = "lvm_pv"; type = "filesystem";
vg = "pool"; 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 = {
lvm_vg = { pool = {
pool = { type = "lvm_vg";
type = "lvm_vg"; lvs = {
lvs = { root = {
root = { size = "50G";
size = "50G"; content = {
content = { type = "filesystem";
type = "filesystem"; format = "ext4";
format = "ext4"; mountpoint = "/";
mountpoint = "/"; };
}; };
}; data = {
data = { size = "400G";
size = "400G"; content = {
content = { type = "filesystem";
type = "filesystem"; format = "ext4";
format = "ext4"; mountpoint = "/data";
mountpoint = "/data"; };
}; };
}; swap = {
swap = { size = "4G";
size = "4G"; content = {
content = { type = "swap";
type = "swap"; randomEncryption = true;
randomEncryption = true; resumeDevice = true;
resumeDevice = true; };
}; };
}; };
}; };