From 874e59315fca3b8d5c9ecf8f2f2d6389b327ffb7 Mon Sep 17 00:00:00 2001 From: serenity-F Date: Sun, 27 Sep 2026 20:17:37 +1000 Subject: [PATCH] tweak: testing out multi-host support --- modules/hosts/test/configuration.nix | 51 +++++++++++++++++ modules/hosts/test/default.nix | 39 +++++++++++++ modules/hosts/test/hardware.nix | 85 ++++++++++++++++++++++++++++ 3 files changed, 175 insertions(+) create mode 100644 modules/hosts/test/configuration.nix create mode 100644 modules/hosts/test/default.nix create mode 100644 modules/hosts/test/hardware.nix diff --git a/modules/hosts/test/configuration.nix b/modules/hosts/test/configuration.nix new file mode 100644 index 0000000..71cc902 --- /dev/null +++ b/modules/hosts/test/configuration.nix @@ -0,0 +1,51 @@ +{ self, inputs, ... }: + +{ + + # host module declaration + flake.nixosModules.test-configuration = + + { pkgs, lib, ... }: + + { + + # other modules to import + imports = [ ]; + + # set hostname + networking.hostName = "test"; + + # bootloader settings + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + # supported filesystems at boot + boot.supportedFilesystems = [ + "vfat" + "ext4" + #"ntfs" + ]; + + # enable printing support + services.printing.enable = true; + + # fstrim for ssd + services.fstrim.enable = true; + + # corsair mouse software + hardware.ckb-next.enable = true; + + # other packages for hades peripherals + environment.systemPackages = with pkgs; [ + + #input-remapper + #razergenie + #openrazer-daemon + #openrgb-with-all-plugins + + ]; + + }; +} diff --git a/modules/hosts/test/default.nix b/modules/hosts/test/default.nix new file mode 100644 index 0000000..1b08574 --- /dev/null +++ b/modules/hosts/test/default.nix @@ -0,0 +1,39 @@ +{ self, inputs, ... }: + +{ + + # defines the hades specific configuration + flake.nixosConfigurations.test = inputs.nixpkgs.lib.nixosSystem { + + # modules that comprise the host specific configuration + modules = with self.nixosModules; [ + + # shared system modules + core + + # host-specific options + test-configuration + test-hardware + + # extra modules to include on host + # in order of priority + terminal + desktop + multimedia + zfs-support + gaming + music + music-production + virtual-reality + network-proxy + #virtualisation + + # users to include on host + #user-options + serenity + + ]; + + }; + +} diff --git a/modules/hosts/test/hardware.nix b/modules/hosts/test/hardware.nix new file mode 100644 index 0000000..bff54b0 --- /dev/null +++ b/modules/hosts/test/hardware.nix @@ -0,0 +1,85 @@ +{ ... }: + +{ + + # hardware module declaration + flake.nixosModules.test-hardware = + + { + config, + lib, + modulesPath, + ... + }: + + { + + # important + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + # kernel modules to include + boot.initrd.availableKernelModules = [ + "ehci_pci" + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + + # enable amd radeon gpu drivers + # https://nixos.wiki/wiki/AMD_GPU + boot = { + # exposes gpu drivers + kernelModules = [ + "amdgpu" + "kvm-amd" + ]; + # gpu drivers during boot and pre boot + initrd.kernelModules = [ "amdgpu" ]; + }; + hardware = { + # discrete graphics support + graphics.enable = true; + # fixes early video issues + amdgpu.initrd.enable = true; + }; + + # luks device mapping + boot.initrd.luks.devices."luks-35440a88-293e-455b-a018-ee1086b07321".device = + "/dev/disk/by-uuid/35440a88-293e-455b-a018-ee1086b07321"; + boot.initrd.luks.devices."luks-55f7d546-fac9-4ea0-a21e-4c50ecc0d67d".device = + "/dev/disk/by-uuid/55f7d546-fac9-4ea0-a21e-4c50ecc0d67d"; + + # root partition + fileSystems."/" = { + device = "/dev/mapper/luks-35440a88-293e-455b-a018-ee1086b07321"; + fsType = "ext4"; + }; + + # boot partition + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/2C83-7F40"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + # swap + swapDevices = [ + { + device = "/dev/mapper/luks-55f7d546-fac9-4ea0-a21e-4c50ecc0d67d"; + } + ]; + + # specifies x64 uArch + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; + +}