mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 21:13:28 +01:00
Internal-only refactor. The function's argument shape is unchanged so
the 45 in-repo `tests/*.nix` callers don't need to be touched (yet) —
they keep calling `makeDiskoTest { name = …; disko-config = …; … }`
and get equivalent derivations back.
The new body is a thin wrapper around nixpkgs's
`nixos/lib/eval-config.nix`. `module.nix` is a NixOS module — it
writes to `system.build`, `fileSystems`, `boot`, `swapDevices`,
`networking.hostId`, `assertions`, `warnings` — so the host eval has
to be a NixOS eval. The result is identical to what
`nixosConfigurations.X.config.system.build.diskoTest` would have
produced; we just construct that NixOS eval inline rather than
requiring callers to wire it themselves.
Arg-to-option mapping:
- `extraSystemConfig` → `disko.test.nodes.machine`
- `extraInstallerConfig` → `disko.test.nodes.formatter`
- `bootCommands`, `efi`, `enableOCR`, `postDisko`, `enableCanokey`,
`name` → `disko.test.<same>`
- `extraTestScript` → `disko.test.extraChecks`
- `testBoot` → `disko.test.boot`
- `testMode` → `disko.test.mode` (enum `[ "module" "direct" ]`; the
`"cli"` enum value mentioned in the old doc comment was a synonym
for `"direct"` that hasn't been branched on in years — dropped.)
The manual-merging machinery (`installed-system`, `installedTopLevel`,
in-body `prepareDiskoConfig` calls, the entire raw `testScript` Python
block) is gone — that logic now lives in `lib/install-test.nix` and
runs as part of the test eval inside `module.nix`'s `installTestEval`.
`diskoLib.testLib.prepareDiskoConfig` and `diskoLib.testLib.devices`
stay exported — still used by `lib/interactive-vm.nix` and the new
`lib/install-test.nix`.
`extendModules` is kept in the signature (with default null) but
unused — the legacy callsite in `module.nix` already stopped passing
it in the previous commit, but external callers might still.