replace with real hardware configs

This commit is contained in:
Lars Nolden
2026-06-26 17:01:28 +02:00
parent 7579d4dcf5
commit 30b325393a
9 changed files with 144 additions and 29 deletions
@@ -0,0 +1,28 @@
{ lib, ... }:
# Second disk for db-host: the Postgres data directory lives on /dev/sdb, kept
# separate from the OS disk (/dev/sda). The whole disk is one GPT partition,
# ext4, mounted at /var/lib/postgresql — so the cluster data dir
# (/var/lib/postgresql/17, the upstream NixOS default) sits on this drive and
# survives an OS-disk rebuild.
{
disko.devices.disk.disk2 = {
device = lib.mkDefault "/dev/sdb";
type = "disk";
content = {
type = "gpt";
partitions = {
data = {
name = "data";
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/var/lib/postgresql";
mountOptions = [ "defaults" ];
};
};
};
};
};
}
@@ -0,0 +1,55 @@
{ lib, ... }:
{
disko.devices = {
disk.disk1 = {
device = lib.mkDefault "/dev/sda";
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "1M";
type = "EF02";
};
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
name = "root";
size = "100%";
content = {
type = "lvm_pv";
vg = "pool";
};
};
};
};
};
lvm_vg = {
pool = {
type = "lvm_vg";
lvs = {
root = {
size = "100%FREE";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [
"defaults"
];
};
};
};
};
};
};
}
@@ -0,0 +1,14 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}