mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 21:13:28 +01:00
Three new files that will replace the manual-merging body of
`makeDiskoTest` in lib/tests.nix:
- lib/install-test.nix: pure NixOS test module declaring
the 7 disko convenience knobs
(extraChecks, bootCommands, boot,
efi, postDisko, enableCanokey, mode)
alongside the config that consumes
them. Owns the nodes.{formatter,
machine} blocks and the testScript.
The formatter's `../module.nix`
import is gated on
`config.mode == "module"` —
`direct` mode uses pre-built
standalone CLI scripts and doesn't
need the module's
`system.build.{format,mount,…}`
derivations.
- lib/install-test-formatter.nix: per-node base for the formatter VM
(test-instrumentation + qemu-guest +
swraid + nix.settings tweaks).
Disko module + `disko.enableConfig =
false`/`checkScripts = true` /
forced `disko.devices` are set by
`install-test.nix` only in
`mode = "module"`.
- lib/install-test-machine.nix: per-node base for the booted system
being tested. Imports the disko
module unconditionally (the booted
system always needs disko's
generated fileSystems/boot/swapDevices).
Nothing imports these yet; the files are inert until the next commit
wires `disko.test` as the host eval's submodule pointing at them.
Part of the makeDiskoTest -> evalModules refactor outlined in
`~/.claude/plans/disko-test-refactor.md`.
48 lines
868 B
Nix
48 lines
868 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
modulesPath,
|
|
...
|
|
}:
|
|
{
|
|
imports = [
|
|
"${modulesPath}/testing/test-instrumentation.nix"
|
|
"${modulesPath}/profiles/qemu-guest.nix"
|
|
];
|
|
|
|
boot.supportedFilesystems = [
|
|
"btrfs"
|
|
"cifs"
|
|
"f2fs"
|
|
"jfs"
|
|
"ntfs"
|
|
"reiserfs"
|
|
"vfat"
|
|
"xfs"
|
|
]
|
|
++ lib.optional (
|
|
config.networking.hostId != null
|
|
&& lib.meta.availableOn pkgs.stdenv.hostPlatform config.boot.zfs.package
|
|
) "zfs";
|
|
|
|
boot.swraid.enable = true;
|
|
# silence warning about unset mail
|
|
boot.swraid.mdadmConf = "PROGRAM ${pkgs.coreutils}/bin/true";
|
|
|
|
systemd.services.mdmonitor.enable = false; # silence some weird warnings
|
|
|
|
environment.systemPackages = [
|
|
pkgs.jq
|
|
];
|
|
|
|
# speed-up eval
|
|
documentation.enable = false;
|
|
|
|
nix.settings = {
|
|
substituters = lib.mkForce [ ];
|
|
hashed-mirrors = null;
|
|
connect-timeout = 1;
|
|
};
|
|
}
|