Adds the L2 layer of the PXE pipeline test bed (docs/ARCHITECTURE.md
§L2) to rydiwo only — isolated private subnet, never touches LAN.
- modules/options.nix: options.pxe-infra.{enable, bridge, dhcp.*,
guests[]} — fully typed, default master toggle is off so the
existing rydiwo build is unchanged
- modules/pxe-infra/default.nix: umbrella that imports the two
sub-modules; inert when the master toggle is off
- modules/pxe-infra/bridge.nix: idempotent systemd oneshot that
creates the Linux bridge, assigns the lab host a private IPv4,
and is explicitly NetworkManager.unmanaged so NM does not
reconfigure it
- modules/pxe-infra/dhcp.nix: dnsmasq as DHCP-only on the bridge
only (bind-interfaces + interface=, port=0 disables DNS, no-resolv,
no-poll, cache-size=0); MAC-filtered via dhcp-host=…,set:known and
dhcp-ignore=tag:!known when authoritative=false
- configurations/mini-laptop.nix: adds modules/pxe-infra to
imports, plus a commented example showing how to enable for a
real guest
Sidesteps docs/OPEN-QUESTIONS.md Q21 (LAN-permission) by design:
a fully isolated bridge satisfies L2 without the lab node answering
DHCP on the real LAN. nix flake check passes for all six hosts.
Refs: docs/ARCHITECTURE.md §L2, docs/OPEN-QUESTIONS.md F20/F21/F23.
61 lines
1.7 KiB
Nix
61 lines
1.7 KiB
Nix
# Host: "rydiwo" (device: secondary)
|
|
#
|
|
# The host record lives in configurations/default.nix; this file is only the
|
|
# module body. `xlib` (identity, dirs, helpers) arrives as a module argument.
|
|
{
|
|
lib,
|
|
pkgs,
|
|
xlib,
|
|
inputs,
|
|
...
|
|
}:
|
|
{
|
|
imports = with inputs; [
|
|
nixos-hardware.nixosModules.chuwi-minibook-x
|
|
./hardware/mini-laptop.nix
|
|
self.nixosModules.default
|
|
../modules/pxe-infra
|
|
];
|
|
|
|
boot = {
|
|
kernelPackages = lib.mkDefault pkgs.linuxPackages_xanmod_stable;
|
|
loader = {
|
|
systemd-boot.enable = lib.mkDefault true;
|
|
efi.canTouchEfiVariables = lib.mkDefault true;
|
|
};
|
|
};
|
|
|
|
fileSystems = xlib.helpers.mkNtfsMount {
|
|
path = xlib.dirs.lamet-drive;
|
|
uuid = "DC76BD3576BD116E";
|
|
mask = "0000";
|
|
};
|
|
|
|
host.ssh.enable = true;
|
|
hardware.intel-gpu-tools.enable = true;
|
|
|
|
system.stateVersion = "26.05";
|
|
|
|
# --------------------------------------------------------------------------
|
|
# PXE infrastructure rig (L2 of docs/ARCHITECTURE.md).
|
|
# Uncomment to enable on rydiwo. The rig gives rydiwo an isolated Linux
|
|
# bridge (`pxe-infra.bridge.name`, default `pxe0`) plus a MAC-filtered
|
|
# dnsmasq DHCP server bound only to that bridge — the real LAN is not
|
|
# touched. See `modules/options.nix` (options.pxe-infra.*) for the
|
|
# full option surface and `modules/pxe-infra/` for the implementation.
|
|
#
|
|
# pxe-infra = {
|
|
# enable = true;
|
|
# bridge.address = "10.66.0.1";
|
|
# bridge.prefixLength = 24;
|
|
# dhcp.guests = [
|
|
# {
|
|
# mac = "52:54:00:12:34:56";
|
|
# ip = "10.66.0.10";
|
|
# hostname = "pxe-vm-01"; # optional
|
|
# }
|
|
# ];
|
|
# };
|
|
# --------------------------------------------------------------------------
|
|
}
|