From e717edc177cb52ded3a1684d5b2e7bf07b046dc1 Mon Sep 17 00:00:00 2001 From: Corwin Perren Date: Sun, 7 Dec 2025 16:37:20 -0800 Subject: [PATCH] Add cluster host definitions, cluster utilities, and admin, switch nixpkgs to stable --- flake.nix | 2 +- hosts/cap-clust-01/configuration.nix | 41 +++++++++++++++ hosts/cap-clust-01/hardware-configuration.nix | 52 +++++++++++++++++++ hosts/cap-clust-02/hardware-configuration.nix | 52 +++++++++++++++++++ hosts/cap-clust-03/hardware-configuration.nix | 52 +++++++++++++++++++ hosts/cap-clust-04/hardware-configuration.nix | 52 +++++++++++++++++++ hosts/cap-clust-05/hardware-configuration.nix | 52 +++++++++++++++++++ hosts/cap-clust-06/hardware-configuration.nix | 52 +++++++++++++++++++ hosts/cap-clust-07/hardware-configuration.nix | 52 +++++++++++++++++++ hosts/cap-clust-09/hardware-configuration.nix | 52 +++++++++++++++++++ hosts/cap-clust-10/hardware-configuration.nix | 52 +++++++++++++++++++ .../system-utilities-cluster.nix | 26 ++++++++++ modules/system/gpu-amd.nix | 8 ++- users/cluster-admin/cluster-admin.nix | 36 +++++++++++++ 14 files changed, 579 insertions(+), 2 deletions(-) create mode 100644 hosts/cap-clust-01/configuration.nix create mode 100644 hosts/cap-clust-01/hardware-configuration.nix create mode 100644 hosts/cap-clust-02/hardware-configuration.nix create mode 100644 hosts/cap-clust-03/hardware-configuration.nix create mode 100644 hosts/cap-clust-04/hardware-configuration.nix create mode 100644 hosts/cap-clust-05/hardware-configuration.nix create mode 100644 hosts/cap-clust-06/hardware-configuration.nix create mode 100644 hosts/cap-clust-07/hardware-configuration.nix create mode 100644 hosts/cap-clust-09/hardware-configuration.nix create mode 100644 hosts/cap-clust-10/hardware-configuration.nix create mode 100644 modules/application-groups/system-utilities-cluster.nix create mode 100644 users/cluster-admin/cluster-admin.nix diff --git a/flake.nix b/flake.nix index ecdf6c8..9492ad2 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Nixos config flake"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; home-manager = { diff --git a/hosts/cap-clust-01/configuration.nix b/hosts/cap-clust-01/configuration.nix new file mode 100644 index 0000000..9864e1b --- /dev/null +++ b/hosts/cap-clust-01/configuration.nix @@ -0,0 +1,41 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + imports = [ + # Hardware Scan + ./hardware-configuration.nix + + # Users + ../../users/cluster-admin/cluster-admin.nix + + + # System Configuration + ../../modules/system/cpu-amd.nix + ../../modules/system/fonts.nix + ../../modules/system/gpu-amd.nix + ../../modules/system/home-manager-settings.nix + ../../modules/system/internationalization.nix + ../../modules/system/networking.nix + ../../modules/system/nix-settings.nix + ../../modules/system/security.nix + ../../modules/system/systemd-boot.nix + + # Application Groups + ../../modules/application-groups/system-utilities-cluster.nix + ]; + + networking.hostName = "cap-clust-01"; + time.timeZone = "America/Los_Angeles"; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "25.11"; # Did you read the comment? +} diff --git a/hosts/cap-clust-01/hardware-configuration.nix b/hosts/cap-clust-01/hardware-configuration.nix new file mode 100644 index 0000000..0925162 --- /dev/null +++ b/hosts/cap-clust-01/hardware-configuration.nix @@ -0,0 +1,52 @@ +# 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 = [ + "xhci_pci" + "ahci" + "ehci_pci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ + "kvm-amd" + "amdgpu" + ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/0028a3af-8470-46c2-81ca-6d9be16a6236"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/C389-7B6B"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/2b063ac4-54ee-4b16-b766-9c470733995c"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/cap-clust-02/hardware-configuration.nix b/hosts/cap-clust-02/hardware-configuration.nix new file mode 100644 index 0000000..44763c6 --- /dev/null +++ b/hosts/cap-clust-02/hardware-configuration.nix @@ -0,0 +1,52 @@ +# 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 = [ + "xhci_pci" + "ahci" + "ehci_pci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ + "kvm-amd" + "amdgpu" + ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/9fcf291d-2576-44b4-bcba-98e40305e531"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/7727-439F"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/56f2d727-03c5-4aef-9871-217bf98cdbb4"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/cap-clust-03/hardware-configuration.nix b/hosts/cap-clust-03/hardware-configuration.nix new file mode 100644 index 0000000..2b3d738 --- /dev/null +++ b/hosts/cap-clust-03/hardware-configuration.nix @@ -0,0 +1,52 @@ +# 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 = [ + "xhci_pci" + "ahci" + "ehci_pci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ + "kvm-amd" + "amdgpu" + ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/c2cfd56f-0090-45eb-a239-068fdadd2fd4"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/C3CF-3854"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/e60a5ced-d01e-4613-afba-9b445bc43097"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/cap-clust-04/hardware-configuration.nix b/hosts/cap-clust-04/hardware-configuration.nix new file mode 100644 index 0000000..c866270 --- /dev/null +++ b/hosts/cap-clust-04/hardware-configuration.nix @@ -0,0 +1,52 @@ +# 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 = [ + "xhci_pci" + "ahci" + "ehci_pci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ + "kvm-amd" + "amdgpu" + ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/b9c79a2f-8c6a-4f86-8562-b2f882992e95"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/EF0B-C66E"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/9a123c08-cc9b-4516-a158-b274e9b399c3"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/cap-clust-05/hardware-configuration.nix b/hosts/cap-clust-05/hardware-configuration.nix new file mode 100644 index 0000000..1d5c3c7 --- /dev/null +++ b/hosts/cap-clust-05/hardware-configuration.nix @@ -0,0 +1,52 @@ +# 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 = [ + "xhci_pci" + "ahci" + "ehci_pci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ + "kvm-amd" + "amdgpu" + ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/51ce9236-fe8c-49bc-bb90-1e582d163d04"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/FF5C-EB30"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/1d24fd7d-c958-44ad-bb28-c394f3d56a6b"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/cap-clust-06/hardware-configuration.nix b/hosts/cap-clust-06/hardware-configuration.nix new file mode 100644 index 0000000..69ddb4b --- /dev/null +++ b/hosts/cap-clust-06/hardware-configuration.nix @@ -0,0 +1,52 @@ +# 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 = [ + "xhci_pci" + "ahci" + "ehci_pci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ + "kvm-amd" + "amdgpu" + ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/8cf14e41-2af7-4bbd-89e2-90f5d04601b8"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/33C3-BB59"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/262fa61f-4beb-4822-ace6-bb15c62b2cca"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/cap-clust-07/hardware-configuration.nix b/hosts/cap-clust-07/hardware-configuration.nix new file mode 100644 index 0000000..b826cb5 --- /dev/null +++ b/hosts/cap-clust-07/hardware-configuration.nix @@ -0,0 +1,52 @@ +# 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 = [ + "xhci_pci" + "ahci" + "ehci_pci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ + "kvm-amd" + "amdgpu" + ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/ad88a1b0-c98e-4a95-9fb3-3299169c952b"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/73CA-8E6D"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/c6139db9-2a9d-400a-b8a8-c8f77c5713ca"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/cap-clust-09/hardware-configuration.nix b/hosts/cap-clust-09/hardware-configuration.nix new file mode 100644 index 0000000..b35edaa --- /dev/null +++ b/hosts/cap-clust-09/hardware-configuration.nix @@ -0,0 +1,52 @@ +# 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 = [ + "xhci_pci" + "ahci" + "ehci_pci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ + "kvm-amd" + "amdgpu" + ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/30b3183d-8358-46aa-b565-70c7d30af7c7"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/BA04-7969"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/42aeb402-5b5a-4423-b2a5-2c08935c9f57"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/cap-clust-10/hardware-configuration.nix b/hosts/cap-clust-10/hardware-configuration.nix new file mode 100644 index 0000000..81bb55a --- /dev/null +++ b/hosts/cap-clust-10/hardware-configuration.nix @@ -0,0 +1,52 @@ +# 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 = [ + "xhci_pci" + "ahci" + "ehci_pci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ + "kvm-amd" + "amdgpu" + ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/affec1c2-bf7c-499e-80a6-6615fd163e1a"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/9E1A-C3DA"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/a17f3a16-78fb-494d-8319-89e31e1defae"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/application-groups/system-utilities-cluster.nix b/modules/application-groups/system-utilities-cluster.nix new file mode 100644 index 0000000..728ba64 --- /dev/null +++ b/modules/application-groups/system-utilities-cluster.nix @@ -0,0 +1,26 @@ +{ config, pkgs, ... }: +{ + + services.glances.enable = true; + services.openssh.enable = true; + + environment.systemPackages = with pkgs; [ + btop + dnsutils + git + htop + iftop + iotop + killall + kitty + ncdu + networkmanager + nmap + nvtopPackages.full + pciutils + unzip + usbutils + util-linux + wget + ]; +} diff --git a/modules/system/gpu-amd.nix b/modules/system/gpu-amd.nix index 80b1f66..d6f2f57 100644 --- a/modules/system/gpu-amd.nix +++ b/modules/system/gpu-amd.nix @@ -1,5 +1,11 @@ { config, pkgs, ... }: { - services.xserver.videoDrivers = [ "amdgpu" ]; + hardware.graphics = { + enable = true; + enable32Bit = true; + }; + nixpkgs.config.rocmSupport = true; + + services.xserver.videoDrivers = [ "amdgpu" ]; } diff --git a/users/cluster-admin/cluster-admin.nix b/users/cluster-admin/cluster-admin.nix new file mode 100644 index 0000000..16dac1e --- /dev/null +++ b/users/cluster-admin/cluster-admin.nix @@ -0,0 +1,36 @@ +{ config, pkgs, ... }: +{ + users.users.cluster-admin = { + initialPassword = "changeme"; + isNormalUser = true; + description = "Cluster Admin"; + extraGroups = [ + "networkmanager" + "wheel" + ]; + }; + + home-manager.users.cluster-admin = { + home.username = "cluster-admin"; + home.homeDirectory = "/home/cluster-admin"; + home.stateVersion = "25.05"; + + home.packages = with pkgs; [ ]; + + programs.bash.enable = true; + + programs.git = { + enable = true; + settings.user = { + name = "Corwin Perren"; + email = "caperren@gmail.com"; + }; + + }; + + programs.kitty = { + enable = true; + font.name = "JetBrains Mono"; + }; + }; +}