From 6748641a85094b9a99572ab5b8a20ffeaeac9e7f Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Tue, 5 May 2026 15:22:34 +0000 Subject: [PATCH] Add initial configuration for new quadcore system --- .../configuration.nix | 43 ++++++++++ .../amd-legacy-quadcore-292465/default.nix | 6 ++ .../disk-config.nix | 78 +++++++++++++++++++ .../hardware-configuration.nix | 25 ++++++ .../amd-legacy-quadcore-292465/network.nix | 39 ++++++++++ 5 files changed, 191 insertions(+) create mode 100644 host/nocix/amd-legacy-quadcore-292465/configuration.nix create mode 100644 host/nocix/amd-legacy-quadcore-292465/default.nix create mode 100644 host/nocix/amd-legacy-quadcore-292465/disk-config.nix create mode 100644 host/nocix/amd-legacy-quadcore-292465/hardware-configuration.nix create mode 100644 host/nocix/amd-legacy-quadcore-292465/network.nix diff --git a/host/nocix/amd-legacy-quadcore-292465/configuration.nix b/host/nocix/amd-legacy-quadcore-292465/configuration.nix new file mode 100644 index 0000000..203486a --- /dev/null +++ b/host/nocix/amd-legacy-quadcore-292465/configuration.nix @@ -0,0 +1,43 @@ +{ + lib, + modulesPath, + pkgs, + ... +} @ args: +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + (modulesPath + "/profiles/qemu-guest.nix") + ./disk-config.nix + ./network.nix + ]; + boot.loader.grub = { + # no need to set devices, disko will add all devices that have a EF02 partition to the list already + # devices = [ ]; + efiSupport = true; + efiInstallAsRemovable = true; + }; + environment.systemPackages = map lib.lowPrio [ + pkgs.curl + pkgs.dig + pkgs.gitMinimal + ]; + myModules = { + nidus-sync = { + domainNameReport = "staging-report.mosquitoes.online"; + domainNameSync = "staging-sync.nidus.cloud"; + environment = "staging"; + }; + tegola = { + domainName = "staging-tegola.nidus.cloud"; + }; + }; + services.openssh.enable = true; + users.users.root.openssh.authorizedKeys.keys = + [ + # change this to your ssh key + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBvhtF6nRWlA6PVs71Eek7p0p2PxTd3P6ZEGFV2t75MB eliribble@nixos" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHL1SpT3KR8XeXtH19muncYVrKxWzWdWtJYNTwoJGTm3 eliribble@Elis-Mac-mini.local" + ] ++ (args.extraPublicKeys or []); # this is used for unit-testing this module and can be removed if not needed + system.stateVersion = "25.11"; +} diff --git a/host/nocix/amd-legacy-quadcore-292465/default.nix b/host/nocix/amd-legacy-quadcore-292465/default.nix new file mode 100644 index 0000000..246ffea --- /dev/null +++ b/host/nocix/amd-legacy-quadcore-292465/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./configuration.nix + ./hardware-configuration.nix + ]; +} diff --git a/host/nocix/amd-legacy-quadcore-292465/disk-config.nix b/host/nocix/amd-legacy-quadcore-292465/disk-config.nix new file mode 100644 index 0000000..275cc9b --- /dev/null +++ b/host/nocix/amd-legacy-quadcore-292465/disk-config.nix @@ -0,0 +1,78 @@ +# Example to create a bios compatible gpt partition +{ lib, ... }: +{ + disko.devices = { + disk = { + root = { + device = "/dev/sdb"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + MBR = { + size = "1M"; + type = "EF02"; # for grub MBR + }; + boot = { + size = "500M"; + type = "EF00"; # for grub MBR + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "defaults" + ]; + }; + }; + root = { + size = "100%"; + content = { + type = "lvm_pv"; + vg = "pool"; + }; + }; + }; + }; + }; + data = { + device = "/dev/sda"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + bigdisk = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/mnt/bigdisk"; + mountOptions = [ + "defaults" + ]; + }; + }; + }; + }; + }; + }; + lvm_vg = { + pool = { + type = "lvm_vg"; + lvs = { + root = { + size = "100%FREE"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + mountOptions = [ + "defaults" + ]; + }; + }; + }; + }; + }; + }; +} diff --git a/host/nocix/amd-legacy-quadcore-292465/hardware-configuration.nix b/host/nocix/amd-legacy-quadcore-292465/hardware-configuration.nix new file mode 100644 index 0000000..aa109de --- /dev/null +++ b/host/nocix/amd-legacy-quadcore-292465/hardware-configuration.nix @@ -0,0 +1,25 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "ahci" "ohci_pci" "ehci_pci" "pata_atiixp" "floppy" "sd_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/host/nocix/amd-legacy-quadcore-292465/network.nix b/host/nocix/amd-legacy-quadcore-292465/network.nix new file mode 100644 index 0000000..136586c --- /dev/null +++ b/host/nocix/amd-legacy-quadcore-292465/network.nix @@ -0,0 +1,39 @@ +{ lib, ... }: +{ + networking = { + defaultGateway = { + address = "107.150.42.1"; + interface = "enp2s0"; + }; + defaultGateway6 = { + address = "2604:4300:a:30::"; + interface = "enp2s0"; + }; + domain = "gleipnir.technology"; + firewall = { + allowedUDPPorts = [ 22 80 443 7000 16652 ]; + allowedTCPPorts = [ 22 80 443 7000 16652 ]; + enable = false; + /*interfaces.enp2s0 = { + allowedUDPPorts = [ 22 80 443 7000 16652 ]; + allowedTCPPorts = [ 22 80 443 7000 16652 ]; + };*/ + }; + hostName = "nocix-amd-legacy-quadcore"; + interfaces.enp2s0 = { + ipv4.addresses = [{ + address = "107.150.42.2"; + prefixLength = 29; + }]; + ipv6.addresses = [{ + address = "2604:4300:a:30::2"; + prefixLength = 64; + }]; + }; + nameservers = ["8.8.8.8"]; + networkmanager.enable = false; + nftables.enable = true; + useNetworkd = true; + search = ["nocix.net"]; + }; +}