Make the disko config a module.

This commit is contained in:
2024-08-06 07:36:56 +01:00
parent 258b8e1fdf
commit bcd1a5c0d5
4 changed files with 101 additions and 79 deletions

View File

@@ -3,10 +3,16 @@
imports = [
../../common/global
../../common/base-node.nix
./disk-config.nix
../../common/encrypted-btrfs-layout.nix
./hardware.nix
];
diskLayout = {
mainDiskDevice = "/dev/disk/by-id/ata-FORESEE_512GB_SSD_MP15B03900928";
#keyDiskDevice = "/dev/disk/by-id/usb-Intenso_Micro_Line_22080777660586-0:0";
keyDiskDevice = "/dev/sdb";
};
networking.hostName = "chilly";
services.tailscaleAutoconnect.authkey = "tskey-auth-kRXS9oPyPm11CNTRL-BE6YnbP9J6ZZuV9dHkX17ZMnm1JGdu93";
services.consul.interface.advertise = lib.mkForce "enp1s0";

View File

@@ -1,77 +0,0 @@
{ lib, ... }:
{
disko.devices = {
disk.main = {
device = "/dev/disk/by-id/ata-FORESEE_512GB_SSD_MP15B03900928";
type = "disk";
content = {
type = "gpt";
partitions = {
esp = {
name = "ESP";
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
luksroot = {
end = "-8G";
content = {
type = "luks";
name = "luksroot";
settings = {
allowDiscards = true;
#keyFile = "/dev/disk/by-id/usb-Intenso_Micro_Line_22080777660586-0:0";
keyFile = "/dev/sdb";
keyFileSize = 4096;
};
content = {
type = "btrfs";
subvolumes = {
"root" = {
mountpoint = "/";
mountOptions = [
"compress=zstd"
"noatime"
];
};
"nix" = {
mountpoint = "/nix";
mountOptions = [
"compress=zstd"
"noatime"
];
};
"persist" = {
mountpoint = "/persist";
mountOptions = [
"compress=zstd"
"noatime"
];
};
"log" = {
mountpoint = "/var/log";
mountOptions = [
"compress=zstd"
"noatime"
];
};
};
};
};
};
swap = {
size = "8G";
content = {
type = "swap";
randomEncryption = true;
};
};
};
};
};
};
}