Add two new servers

This commit is contained in:
Bun 2025-06-06 14:54:14 -04:00
parent 26fd8569fe
commit 51044e15eb
25 changed files with 208 additions and 78 deletions

View file

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
boot = {
kernelPackages = pkgs.linuxPackages_hardened;
kernelParams = [
"amdgpu.si_support=1"
"radeon.si_support=0"
];
loader.grub.enable = true;
};
}

20
hosts/elder/default.nix Normal file
View file

@ -0,0 +1,20 @@
{ ... }:
{
imports = [
./boot
./disko
./filesystems
./hardware
];
system = {
nixos.tags = [ "server" ];
stateVersion = "25.05";
};
deployment.targetHost = "570:3651:7f2:c26b:bccd:725b:be00:8a18";
networking.hostId = "447645a9";
services.nfs.server.enable = true;
}

View file

@ -0,0 +1,100 @@
{ config, disko, ... }:
{
imports = [ disko.nixosModules.disko ];
disko.devices = {
disk = {
"${config.networking.hostName}" = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02";
};
ESP = {
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
main = {
size = "100%";
content = {
type = "lvm_pv";
vg = "${config.networking.hostName}";
};
};
};
};
};
};
lvm_vg = {
"${config.networking.hostName}" = {
type = "lvm_vg";
lvs = {
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [
"compress=zstd"
"ssd"
];
};
"/prev" = {
mountpoint = "/prev";
mountOptions = [
"compress=zstd"
"noexec"
"ssd"
];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [
"compress=zstd"
"ssd"
];
};
# Impermanence
"/persist" = {
mountpoint = "/persist";
mountOptions = [
"compress=zstd"
"ssd"
];
};
"/persist/.snapshots" = { };
"/persist/home" = { };
"/persist/home/.snapshots" = { };
};
};
};
swap = {
size = "8G";
content = {
type = "swap";
discardPolicy = "both";
};
};
};
};
};
};
# Needed for impermanence
fileSystems."/persist".neededForBoot = true;
}

View file

@ -0,0 +1,16 @@
{ ... }:
{
fileSystems = {
"/persist/storage" = {
device = "/dev/disk/by-uuid/5c3c533b-1c70-4411-854a-37fa794fc17c";
fsType = "btrfs";
options = [
"nofail"
"nosuid"
"subvol=storage"
];
};
"elder".enable = false;
};
}

View file

@ -0,0 +1,23 @@
{ modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {
availableKernelModules = [
"ahci"
"ehci_pci"
"sd_mod"
"sr_mod"
"uhci_hcd"
"usbhid"
];
kernelModules = [ "dm-snapshot" ];
};
kernelModules = [ "kvm-intel" ];
};
hardware.cpu.intel.updateMicrocode = true;
nixpkgs.hostPlatform = "x86_64-linux";
}