mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 21:13:28 +01:00
Five coupled changes that must land together because they form one
atomic refactor of disko's test-option surface:
- Define `installTestEval` in the let-block via
`nixos-lib.evalTest`, importing `./lib/install-test.nix` and
threading `diskoLib`, `diskoDevices` (and indirectly `pkgs` via
`hostPkgs`) into the test eval's module args. Propagate the
host-level `networking.hostId` to every node via the framework's
native `defaults` hook — single source of truth, so
`lib/install-test.nix` drops its per-node hostId setter on
`nodes.formatter` (the host eval's hostId now flows to formatter
and machine identically).
- Declare `options.disko.test` as a submodule whose type is borrowed
from `installTestEval.type` — i.e. the full NixOS-test option tree
(`nodes`, `testScript`, `defaults`, `globalTimeout`, …) plus the
seven disko knobs declared in `./lib/install-test.nix`. Add
`diskoTest = lib.mkDefault config.disko.test.test;` to the
`system.build` attrset next to the existing
`installTest = makeDiskoTest { … };` (the legacy definition stays
for this commit).
- Delete the flat `disko.tests.{bootCommands,efi,enableOCR,extraChecks,extraConfig}`
declarations from the `options.disko` block. Drop the now-deleted
`config.disko.tests.extraConfig` import from `vmVariantWithDisko`'s
`extendModules` call.
- Add migration modules to the imports list:
- `mkRemovedOptionModule` for `disko.tests.extraConfig` with a
message pointing users at `disko.test.defaults` /
`virtualisation.vmVariantWithDisko = { imports = [ … ]; };`.
- 8 × `mkRenamedOptionModule` redirecting flat knobs into the
`disko.test` submodule. Existing user configs keep working with
one deprecation warning per renamed setter.
- Update `lib/interactive-vm.nix:66`: `config.disko.tests.efi` →
`config.disko.test.efi`. The legacy path would still resolve via
the rename but emit a deprecation warning on every interactive-VM
eval — update the callsite to be quiet.
The legacy `installTest = makeDiskoTest { … };` in the `system.build`
attrset is left in place but its read of `cfg.tests.extraConfig` is
dropped (the option no longer exists; the other reads forward through
`mkRenamedOptionModule`). The next commit replaces its RHS with
`lib.mkDefault config.disko.test.test` so both attrset entries point at
the same drv.