1

System/Nixinator: Configure disko partition layout

This commit is contained in:
2025-07-15 14:54:33 +02:00
parent 366f3750dc
commit cae39c8ca8
3 changed files with 104 additions and 1 deletions

View File

@ -29,7 +29,7 @@ with mylib.networking; {
if headless
then "grub"
else "systemd-boot";
systemd-boot.bootDevice = "/boot/efi";
systemd-boot.bootDevice = "/boot";
grub.bootDevice = "/dev/sda";
};

View File

@ -8,6 +8,7 @@
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
./disks.nix
../modules
];

102
system/nixinator/disks.nix Normal file
View File

@ -0,0 +1,102 @@
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/disk/by-id/nvme-WD_BLACK_SN850X_2000GB_231623801519";
content = {
type = "gpt";
partitions = {
ESP = {
label = "EFI";
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["defaults"];
};
};
luks = {
label = "LUKS";
size = "100%";
content = {
type = "luks";
name = "crypted";
extraOpenArgs = [
"--perf-no_read_workqueue"
"--perf-no_write_workqueue"
];
settings = {
allowDiscards = true;
crypttabExtraOpts = ["fido2-device=auto" "token-timeout=10"];
# Disable for interactive password entry
# keyFile = "/tmp/secret.key";
};
# additionalKeyFiles = ["/tmp/additionalSecret.key"];
content = {
type = "btrfs";
extraArgs = ["-L" "NIXOS" "-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [
"subvol=root"
"compress=zstd"
"noatime"
];
};
"/home" = {
mountpoint = "/home";
mountOptions = [
"subvol=home"
"compress=zstd"
"noatime"
];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [
"subvol=nix"
"compress=zstd"
"noatime"
];
};
"/persist" = {
mountpoint = "/persist";
mountOptions = [
"subvol=persist"
"compress=zstd"
"noatime"
];
};
"/log" = {
mountpoint = "/var/log";
mountOptions = [
"subvol=log"
"compress=zstd"
"noatime"
];
};
"/swap" = {
mountpoint = "/swap";
swap.swapfile.size = "16G";
};
};
};
};
};
};
};
};
};
};
fileSystems."/persist".neededForBoot = true;
fileSystems."/var/log".neededForBoot = true;
}