Files
nixos/configurations/mini-laptop.nix
T
oqyude d416816632
test-runner / smoke (push) Successful in 0s
config(rydiwo): use ipxe.efi (universal) for kernel 6.18.57 PCI match regression (T14)
snp.efi (SNP-only, 310K) was the right choice on linux-virt 6.18.56
because the universal ipxe.efi (1.2 MB) hit a deterministic crash at
iPXE offset 0x35FC with RAX=0xAF..AF (uninit-memory fill) — root
cause not OOM, not NIC driver (virtio-net works in both), but a
buffer-path bug in the universal binary. Switching to snp.efi
sidestepped it (commit 687d6d1, 2026-10-13).

On 2026-10-17 an e2e test on rydiwo found that snp.efi broke the
PXE chain after the kernel upgrade: iPXE chain
snp.efi → autoexec.ipxe → boot.ipxe → sanboot registers the SAN
device 0x80, the kernel (linux-virt 6.18.57) boots, but PCI
enumeration shows only the NIC — no `pci 0000:00:03.0 [1af4:1001]`
virtio-blk endpoint. Rootfs mount fails:
`UUID=...: Can't lookup blockdev` → `Mounting root: failed.`

Bisecting aports identified upstream c967b365 (`PCI: Make
pci_match_one_device() match on ID instead of device`) in
patch-6.18.57.xz, delivered via aports 2b1f5137
(`main/linux-lts: upgrade to 6.18.57`, 2026-10-16T11:11:20Z).
The new drivers/pci/search.c match_pci_dev_by_id() uses
pci_match_one_id()+pci_id_from_device(); the IDs that snp.efi's
SAN hook reports to the kernel for the virtio-blk device are not
full device IDs, so the new matching fails. The universal
ipxe.efi presents the SAN device through a different code path
whose IDs are full device IDs and match cleanly.

Direct-mode boot (`bootMode=direct`, QEMU virtio drive) is not
affected — there the kernel sees the device through a proper PCI
attach and the IDs are complete. Only the iPXE-SAN-presentation
path regressed.

Switch back to the universal binary. The original 687d6d1 crash
bug is not present in the current ipxe.efi (a different upstream
build was involved) — verified by two independent e2e runs on
rydiwo 2026-10-17 with explicit bootMode=pxe, both verdict=PASS
(20261017T180654Z, 20261017T180730Z). The ~290K extra TFTP volume
per boot vs snp.efi is negligible.

This permanently encodes the runtime-only change that was applied
to /etc/nixos/configurations/mini-laptop.nix on rydiwo on
2026-10-17 20:48 MSK during the T14 closure session. Without this
commit, a fresh nixos-rebuild switch from origin/dev would
silently revert to snp.efi and re-trigger the regression.

Closes T14 (P1, opened 2026-10-17 in session
pxe-infra-e2e-2026-10-17). Full RCA and verification evidence:
https://github.com/oqyude/pxe-infra-automation/blob/dev/.agent/tasks/manifest.json
(grep T14).
2026-10-18 19:38:00 +03:00

126 lines
5.5 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
../modules/server/engipy-backend.nix
];
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;
# engipy webapp backend на rydiwo: uvicorn + FastAPI + ONNX-SBERT.
# Python-окружение через pip-venv на rydiwo (см. modules/server/engipy-backend.nix).
# Sapphira проксирует engipy.zeroq.su/api/* на 192.168.1.102:8000.
#
# model = путь к локальной ONNX-папке (экспорт `cointegrated/rubert-tiny2`
# сделан в WSL nixos и разложен на rydiwo). HF Hub id
# `cointegrated/rubert-tiny2` НЕ должен здесь стоять — это
# триггерит optimum через from_pretrained() скачивать с HF и
# конвертировать через torch, что падает в
# `RuntimeError: could not create a primitive` в GELU activation.
#
# T-MULTI-MODEL-REGISTRY (commit cd64a8e, 2026-10-18): 3 модели
# (rubert-tiny2 default + BAAI/bge-m3 + intfloat/multilingual-e5-large)
# лежат на /mnt/lamet/engipy-models/. `model` указывает на default
# (rubert-tiny2), `ENGIPY_MODELS_DIR` (`modelsDir`) — корень для всех
# трёх (см. modules/server/engipy-backend.nix). Старая папка
# /var/lib/engipy/model/cointegrated__rubert-tiny2/ больше не
# используется и может быть удалена вручную после успешного deploy.
host.engipy-backend = {
enable = true;
bindAddress = "0.0.0.0";
# Default ONNX-чекпойнт rubert-tiny2 теперь лежит на /mnt/lamet/
# (в ENGIPY_MODELS_DIR — см. engipy-backend.nix). Имя подпапки
# фиксировано в `app/services/models.py:build_default_registry`.
model = "/mnt/lamet/engipy-models/rubert-tiny2";
# `modelsDir` остаётся дефолтным (/mnt/lamet/engipy-models).
};
# Не засыпать при закрытии крышки: rydiwo используется как
# headless-сервер для engipy (sapphira проксирует /api/* на него).
# Если пользователь берёт ноутбук в руки — пусть остаётся правило
# по умолчанию (suspend); но для unattended-режима нужно ignore.
services.logind.lidSwitch = "ignore";
services.logind.lidSwitchDocked = "ignore";
system.stateVersion = "26.05";
# --------------------------------------------------------------------------
# PXE infrastructure rig (L2 of docs/ARCHITECTURE.md).
# 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. The QEMU guest (L4) is configured but NOT
# autostarted: start it by hand with
# systemctl start pxe-infra-vm
# when a test session needs it, and stop it the same way. Set
# `vm.autostart = true` here to bring the VM up on every boot
# (e.g. for a long unattended test run). 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;
# ipxe.efi (universal, ~600K) instead of snp.efi (SNP-only, 310K).
# snp.efi worked on linux-virt 6.18.56 but breaks on 6.18.57
# (delivered via aports 2b1f5137, 2026-10-16, kernel commit
# c967b365 — `PCI: Make pci_match_one_device() match on ID
# instead of device`). The new drivers/pci/search.c
# `match_pci_dev_by_id()` (uses pci_match_one_id()+pci_id_from_device())
# fails to match the virtio-blk PCI device that snp.efi
# presents through its SAN hook (the IDs reported by the SAN
# path are not full device IDs). The kernel boots, but rootfs
# fails to mount: `UUID=...: Can't lookup blockdev` →
# `Mounting root: failed.` The universal `ipxe.efi` presents
# the SAN device through a different code path that
# successfully matches against the new pci_match machinery.
# Verified end-to-end on rydiwo 2026-10-17 with explicit
# `bootMode=pxe`: two independent verdict=PASS reports
# (20261017T180654Z, 20261017T180730Z). See pxe-infra-automation
# T14 in .agent/tasks/manifest.json for full RCA. The ~290K
# extra TFTP volume vs snp.efi is negligible.
bootloader.ipxeBinary = "ipxe.efi";
vm = {
enable = true;
autostart = false; # start manually when testing
memory = "4G"; # iPXE needs 2G+ heap to sanboot a 2G raw image
};
dhcp.guests = [
{
mac = "52:54:00:12:34:56";
ip = "10.66.0.10";
hostname = "pxe-vm-01"; # optional
}
];
};
# --------------------------------------------------------------------------
}