Move server to new hardware

This commit is contained in:
Bun 2025-03-10 22:08:35 -04:00
parent 643c6c9e9b
commit 145297af58
32 changed files with 129 additions and 321 deletions

View file

@ -14,7 +14,7 @@
};
# Network mounts
"/home/${config.sysusers.main}/KittyNFS" = {
"/home/${config.sysusers.main}/MidasNFS" = {
device = "10.100.0.1:/storage";
fsType = "nfs4";
options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ];

View file

@ -1,10 +0,0 @@
{ pkgs, ... }:
{
boot = {
kernelPackages = pkgs.linuxPackages_5_15;
swraid = {
enable = true;
mdadmConf = "MAILADDR contact@nixfox.ca";
};
};
}

View file

@ -1,31 +0,0 @@
{ ... }:
{
imports = [
./boot
./disko
./filesystems
./firewall
./hardware
./users
../../modules/system
];
networking = {
hostName = "kitty";
hostId = "38ba3f57";
};
system = {
server.enable = true;
fileserver.enable = true;
socialserver.enable = true;
wireguard.server.enable = true;
stateVersion = "24.05";
};
services.minecraft-servers.servers = {
velocity.enable = true;
cornworld.enable = true;
skyblock.enable = true;
};
}

View file

@ -1,75 +0,0 @@
{ config, disko, ... }:
{
imports = [ disko.nixosModules.disko ];
disko.devices = {
disk = {
"${config.networking.hostName}" = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
priority = 1;
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" "noatime" "ssd" ];
};
"/prev" = {
mountpoint = "/prev";
mountOptions = [ "compress=zstd" "noatime" "ssd" "noexec" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
};
};
};
swap = {
size = "4G";
content = {
type = "swap";
discardPolicy = "both";
};
};
};
};
};
};
# Needed for impermanence
fileSystems."/persist".neededForBoot = true;
}

View file

@ -1,9 +0,0 @@
{ ... }:
{
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/acf95700-8669-45c7-9a72-bf3215b3c325";
fsType = "btrfs";
neededForBoot = true;
options = [ "subvol=persist" "compress=zstd" "noatime" ];
};
}

View file

@ -1,8 +0,0 @@
{ config, lib, ... }:
{
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "nvme" "usbhid" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ "kvm-intel" ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

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

View file

@ -1,4 +0,0 @@
{ ... }:
{
imports = [ ./main ];
}

View file

@ -1,6 +0,0 @@
{ config, lib, ... }:
{
home-manager.users."${config.sysusers.main}".home = {
stateVersion = lib.mkForce config.system.stateVersion;
};
}

View file

@ -1,4 +1,7 @@
{ pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.swraid = {
enable = true;
mdadmConf = "MAILADDR contact@nixfox.ca";
};
}

View file

@ -1,40 +1,32 @@
{ pkgs, ... }:
{ ... }:
{
imports = [
./boot
./disko
./filesystems
./firewall
./hardware
./users
../../modules/system
];
networking.hostName = "midas";
networking = {
hostName = "midas";
hostId = "38ba3f57";
};
system = {
desktop.enable = true;
server.enable = true;
lanzaboote.enable = true;
fancyboot.enable = true;
libvirtd.enable = true;
fileserver.enable = true;
socialserver.enable = true;
wireguard.server.enable = true;
stateVersion = "24.11";
};
hardware.graphics = {
extraPackages = with pkgs; [
intel-media-driver
intel-ocl
intel-vaapi-driver
];
extraPackages32 = with pkgs.driversi686Linux; [
intel-media-driver
intel-vaapi-driver
];
services.minecraft-servers.servers = {
velocity.enable = true;
cornworld.enable = true;
skyblock.enable = true;
};
nixpkgs.allowUnfreePackages = [ "intel-ocl" ];
services.xserver.videoDrivers = [
"intel"
"i915"
];
}

View file

@ -61,15 +61,6 @@
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
# Impermanence
"/persist" = {
mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/persist/.snapshots" = { };
"/persist/home/${config.sysusers.main}" = { };
"/persist/home/${config.sysusers.main}/.snapshots" = { };
};
};
};

View file

@ -1,11 +1,9 @@
{ config, ... }:
{ ... }:
{
fileSystems = {
# Network mounts
"/home/${config.sysusers.main}/KittyNFS" = {
device = "${config.ips.server}:/storage";
fsType = "nfs4";
options = [ "x-systemd.automount" "noauto" "soft" "_netdev" ];
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/acf95700-8669-45c7-9a72-bf3215b3c325";
fsType = "btrfs";
neededForBoot = true;
options = [ "subvol=persist" "compress=zstd" "noatime" ];
};
}

View file

@ -1,4 +1,3 @@
# nixos-generate-config --root ./ --no-filesystems
{ config, lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];

View file

@ -1 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJzNzWYDUZ6PEzUPoGMA6I5t1ACUUwnucD8pNcAS1BeQ
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIFGHaxdTeC1xnTx2BY5LLR5LxhdSkmYoWuOeEuRIz0k

View file

@ -1,9 +1,6 @@
{ config, lib, ... }:
{
home-manager.users."${config.sysusers.main}".home = {
desktop.enable = true;
gaming.enable = true;
production.enable = true;
stateVersion = lib.mkForce config.system.stateVersion;
};
}

View file

@ -1,6 +1,6 @@
{ config, ... }:
{
fileSystems."/home/${config.sysusers.main}/KittyNFS" = {
fileSystems."/home/${config.sysusers.main}/MidasNFS" = {
device = "10.100.0.1:/storage";
fsType = "nfs4";
options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ];

View file

@ -5,7 +5,7 @@
device = "/dev/disk/by-uuid/582C6B802C6B57D0";
options = [ "nosuid" "nodev" ];
};
"/home/${config.sysusers.main}/KittyNFS" = {
"/home/${config.sysusers.main}/MidasNFS" = {
device = "10.100.0.1:/storage";
fsType = "nfs4";
options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ];

View file

@ -39,7 +39,7 @@
};
# Network mounts
"/home/${config.sysusers.main}/KittyNFS" = {
"/home/${config.sysusers.main}/MidasNFS" = {
device = "${config.ips.server}:/storage";
fsType = "nfs4";
options = [ "x-systemd.automount" "noauto" "soft" "_netdev" ];