refactor: create glue/ and variants/ directories
- Add glue/ for fleet generation logic and common configuration - Add variants/ for hardware type modules - Improves separation of concerns and module organization
This commit is contained in:
67
variants/nix-ephemeral.nix
Normal file
67
variants/nix-ephemeral.nix
Normal file
@@ -0,0 +1,67 @@
|
||||
# ============================================================================
|
||||
# Ephemeral/Diskless System Configuration
|
||||
# ============================================================================
|
||||
# Configuration for systems that run entirely from RAM without persistent storage.
|
||||
# Suitable for kiosks, netboot clients, and stateless workstations.
|
||||
# All data is lost on reboot.
|
||||
|
||||
{ inputs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
# ========== Boot Configuration ==========
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci" # USB 3.0 support
|
||||
"nvme" # NVMe support
|
||||
"usb_storage" # USB storage devices
|
||||
"sd_mod" # SD card support
|
||||
"sdhci_pci" # SD card host controller
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ]; # Intel virtualization support
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.kernelParams = [
|
||||
"quiet" # Minimal boot messages
|
||||
"splash" # Show Plymouth boot splash
|
||||
"boot.shell_on_fail" # Emergency shell on boot failure
|
||||
"udev.log_priority=3" # Reduce udev logging
|
||||
"rd.systemd.show_status=auto" # Show systemd status during boot
|
||||
];
|
||||
|
||||
# ========== Ephemeral Configuration ==========
|
||||
# No persistent storage - everything runs from RAM
|
||||
athenix.host.filesystem.swapSize = lib.mkForce "0G";
|
||||
athenix.host.filesystem.device = lib.mkForce "/dev/null"; # Dummy device
|
||||
athenix.host.buildMethods = lib.mkDefault [
|
||||
"iso" # Live ISO image
|
||||
"ipxe" # Network boot
|
||||
];
|
||||
|
||||
# Disable disk management for RAM-only systems
|
||||
disko.enableConfig = lib.mkForce false;
|
||||
|
||||
# Define tmpfs root filesystem
|
||||
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;
|
||||
|
||||
athenix.sw.enable = lib.mkDefault true;
|
||||
athenix.sw.type = lib.mkDefault "stateless-kiosk";
|
||||
}
|
||||
Reference in New Issue
Block a user