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

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

View file

@ -5,13 +5,16 @@
./disko
./filesystems
./hardware
./user
];
system = {
nixos.tags = [ "pc" ];
nixos.tags = [ "server" ];
stateVersion = "25.05";
};
deployment.targetHost = "";
deployment.targetHost = "5dd:9cd7:f286:e2c7:4c3b:c2e1:7832:97a3";
networking.hostId = "0917a5c1";
services.nfs.server.enable = true;
}

View file

@ -24,17 +24,11 @@
mountOptions = [ "umask=0077" ];
};
};
luks = {
main = {
size = "100%";
content = {
type = "luks";
name = "${config.networking.hostName}-disk";
settings.allowDiscards = true;
passwordFile = "/tmp/secret.key";
content = {
type = "lvm_pv";
vg = "${config.networking.hostName}";
};
type = "lvm_pv";
vg = "${config.networking.hostName}";
};
};
};
@ -78,7 +72,7 @@
# Impermanence
"/persist" = {
mountpoint = "/persist";
mountOptions = [
mountOptions = [
"compress=zstd"
"ssd"
];
@ -90,7 +84,7 @@
};
};
swap = {
size = "8G";
size = "2G";
content = {
type = "swap";
discardPolicy = "both";

View file

@ -11,9 +11,6 @@
];
};
# Network mounts
"kitty".enable = true;
"midas".enable = true;
"prophet".enable = true;
"detritus".enable = false;
};
}

View file

@ -1 +0,0 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBQE+a1E88+ELJ5cDOMPlc9lnV1ysVndchgJ4MxCjeWd

View file

@ -1,11 +0,0 @@
{ config, pkgs, ... }:
{
home-manager.users."${config.vars.mainUser}" = {
home = {
desktop.enable = true;
gaming.enable = true;
};
wayland.windowManager.sway.package = pkgs.swayfx;
};
}

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";
}

View file

@ -3,7 +3,6 @@
imports = [
./boot
./disko
./filesystems
./hardware
./user
];

View file

@ -1,9 +0,0 @@
{ ... }:
{
fileSystems = {
# Network mounts
"kitty".enable = true;
"midas".enable = true;
"prophet".enable = true;
};
}

View file

@ -9,10 +9,5 @@
"nosuid"
];
};
# Network mounts
"kitty".enable = !config.system.steamdeck.enable;
"midas".enable = !config.system.steamdeck.enable;
"prophet".enable = !config.system.steamdeck.enable;
};
}

View file

@ -10,8 +10,6 @@
];
};
# Network mounts
"midas".enable = true;
"prophet".enable = true;
"kitty".enable = false;
};
}

View file

@ -1 +0,0 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDOBa+Wz1FqFEnMeXflP0CPt2wnN819T+FdSCIwFLJjN

View file

@ -11,8 +11,6 @@
];
};
# Network mounts
"kitty".enable = true;
"prophet".enable = true;
"midas".enable = false;
};
}

View file

@ -1 +0,0 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIFGHaxdTeC1xnTx2BY5LLR5LxhdSkmYoWuOeEuRIz0k

View file

@ -10,8 +10,6 @@
];
};
# Network mounts
"kitty".enable = true;
"midas".enable = true;
"prophet".enable = false;
};
}

View file

@ -1 +0,0 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDXU+mo+lkFaGBV7wuzrGnlII15YS3/MkkG3KmGJRT0j

View file

@ -37,10 +37,5 @@
"subvol=libvirt"
];
};
# Network mounts
"kitty".enable = true;
"midas".enable = true;
"prophet".enable = true;
};
}