feat: Add support for ipxe boot ephemeral systems

This commit is contained in:
UGA Innovation Factory
2025-12-10 14:42:22 -05:00
committed by Hunter Halloran
parent 1412529b0f
commit 8a4e574b90
11 changed files with 307 additions and 6 deletions

View File

@@ -25,8 +25,8 @@
};
buildMethods = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ "iso" ];
description = "List of allowed build methods (iso, lxc, proxmox).";
default = [ "installer-iso" ];
description = "List of allowed build methods (installer-iso, iso, ipxe, lxc, proxmox).";
};
};
@@ -102,7 +102,7 @@
# Hide the OS choice for bootloaders.
# It's still possible to open the bootloader list by pressing any key
# It will just not appear on screen unless a key is pressed
loader.timeout = 0;
loader.timeout = lib.mkDefault 0;
};
# Set your time zone.

View File

@@ -30,6 +30,7 @@
host.filesystem.swapSize = lib.mkDefault "16G";
host.filesystem.device = lib.mkDefault "/dev/nvme0n1";
host.buildMethods = lib.mkDefault [ "installer-iso" ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

View File

@@ -0,0 +1,54 @@
{ inputs, ... }:
[
(
{
config,
lib,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"nvme"
"usb_storage"
"sd_mod"
"sdhci_pci"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.kernelParams = [
"quiet"
"splash"
"boot.shell_on_fail"
"udev.log_priority=3"
"rd.systemd.show_status=auto"
];
# Ephemeral setup: No swap, no disk
host.filesystem.swapSize = lib.mkForce "0G";
host.filesystem.device = lib.mkForce "/dev/null"; # Dummy device
host.buildMethods = lib.mkDefault [ "iso" "ipxe" ];
# Disable Disko config since we are running from RAM/ISO
disko.enableConfig = lib.mkForce false;
# Define a dummy root filesystem to satisfy assertions
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = [ "defaults" "size=50%" "mode=755" ];
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
)
{
modules.sw.enable = true;
modules.sw.type = "stateless-kiosk";
}
]

View File

@@ -37,6 +37,7 @@
host.filesystem.device = lib.mkDefault "/dev/nvme0n1";
host.filesystem.swapSize = lib.mkDefault "34G";
host.buildMethods = lib.mkDefault [ "installer-iso" ];
# Suspend / logind behavior
services.upower.enable = lib.mkDefault true;

View File

@@ -45,6 +45,7 @@
host.filesystem.swapSize = lib.mkDefault "8G";
host.filesystem.device = lib.mkDefault "/dev/mmcblk0";
host.buildMethods = lib.mkDefault [ "installer-iso" ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;