feat: Add support for ipxe boot ephemeral systems
This commit is contained in:
committed by
Hunter Halloran
parent
1412529b0f
commit
8a4e574b90
@@ -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;
|
||||
|
||||
54
hosts/types/nix-ephemeral.nix
Normal file
54
hosts/types/nix-ephemeral.nix
Normal 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";
|
||||
}
|
||||
]
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user