This repository has been archived on 2026-09-17. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
nixos-config/tests/tnix-boot.nix
pijukka 48fbb6c012 tests: add tnix VM boot check
First nixosTest in this repo: boots the real tnix configuration in a
VM and waits for multi-user.target, extending the existing verify
chain (eval/dry-activate) with an actual boot check. Deliberately
narrow — no service, network, firewall, or desktop-session assertions.

nixosTest supplies pkgs externally, so nixpkgs.config must be forced
empty on the test node (configuration.nix's own allowUnfree/
allowUnsupportedSystems would otherwise trip nixpkgs.nix's "externally
created instance" assertion); the check's own pkgs is constructed with
that config baked in instead. Per-node specialArgs go through
_module.args, not node.specialArgs (rejected by testers.nixosTest's
makeTest wrapper).

Verified by building checks.x86_64-linux.tnix-boot on eu.nixbuild.net
(tnix's full closure, including Hyprland/TeXLive, is too large for
local iteration on blunix's disk) -- the run completed successfully.

flake.lock: routine input bump (home-manager, nixos-hardware, nixpkgs)
alongside this work.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CAtPBFEBx3C2QJy6sKGyqd
2026-09-05 09:24:52 +02:00

21 lines
585 B
Nix

{ pkgs, tnixModules, nodeSpecialArgs }:
pkgs.testers.nixosTest {
name = "tnix-boot";
nodes.tnix = {
_module.args = nodeSpecialArgs;
imports = tnixModules;
# nixosTest supplies pkgs externally (already carrying the config
# above); configuration.nix's own nixpkgs.config.* then trips
# nixpkgs.nix's "externally created instance" assertion regardless of
# whether the values agree, so it must be forced empty here only.
nixpkgs.config = pkgs.lib.mkForce { };
};
testScript = ''
start_all()
tnix.wait_for_unit("multi-user.target")
'';
}