From cf6c20c730c605adce09c7769adcbcd1e485a6f3 Mon Sep 17 00:00:00 2001 From: DerGrumpf Date: Mon, 13 Apr 2026 11:38:59 +0200 Subject: [PATCH] Added cyper-controller --- flake.nix | 6 +++ hosts/cyper-controller/configuration.nix | 46 ++++++++++++++++ .../hardware-configuration.nix | 53 +++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 hosts/cyper-controller/configuration.nix create mode 100644 hosts/cyper-controller/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 207d6a2..d58e4e4 100644 --- a/flake.nix +++ b/flake.nix @@ -145,6 +145,12 @@ system = "x86_64-linux"; }; + "cyper-controller" = mkSystem { + hostName = "cyper-controller"; + system = "x86_64-linux"; + isServer = true; + }; + "cyper-node-1" = mkSystem { hostName = "cyper-node-1"; system = "x86_64-linux"; diff --git a/hosts/cyper-controller/configuration.nix b/hosts/cyper-controller/configuration.nix new file mode 100644 index 0000000..68a7598 --- /dev/null +++ b/hosts/cyper-controller/configuration.nix @@ -0,0 +1,46 @@ +{ + imports = [ + ./hardware-configuration.nix + ../../nixos/roles/monitoring.nix + ../../nixos/roles/matrix.nix + ../../nixos/roles/postgresql.nix + ../../nixos/roles/wyl.nix + ../../nixos/roles/adguard.nix + ../../nixos/roles/unifi.nix + ../../nixos/roles/searxng.nix + ../../nixos/roles/filebrowser.nix + ../../nixos/roles/gitea.nix + ../../nixos/roles/vaultwarden.nix + ../../nixos/roles/frontpage + ]; + + networking = { + useNetworkd = true; + useDHCP = false; + firewall.enable = true; + }; + + systemd.network = { + enable = true; + networks."10-ethernet" = { + matchConfig.Name = "enp1s0"; + networkConfig = { + Address = "192.168.2.2/24"; + Gateway = "192.168.2.1"; + DNS = "192.168.2.2"; + DHCP = "no"; + }; + }; + }; + + boot.loader = { + systemd-boot = { + enable = true; + configurationLimit = 10; + editor = false; + }; + efi.canTouchEfiVariables = true; + }; + + system.stateVersion = "26.05"; +} diff --git a/hosts/cyper-controller/hardware-configuration.nix b/hosts/cyper-controller/hardware-configuration.nix new file mode 100644 index 0000000..8b4ed8d --- /dev/null +++ b/hosts/cyper-controller/hardware-configuration.nix @@ -0,0 +1,53 @@ +{ + config, + lib, + modulesPath, + ... +}: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot = { + initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "usb_storage" + "sd_mod" + ]; + initrd.kernelModules = [ ]; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + }; + fileSystems = { + "/" = { + device = "/dev/disk/by-label/NIXROOT"; + fsType = "ext4"; + }; + + "/boot" = { + device = "/dev/disk/by-label/NIXBOOT"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + # TODO: Add External Devices as by-label with no necessity for boot + }; + + swapDevices = [ + { + device = "/swapfile"; + size = 4096; + } + ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}