nixos/test-driver: fix duplicate names in type check

ignore the NixOS configuration's hostname and only use the test driver
attribute for the type hints. This allows for setting a different host
name than the node name in the test without trigggering type errors in
the typecheck phase.

co-authored-by: phanirithvij <phanirithvij2000@gmail.com>
This commit is contained in:
Jacek Galowicz
2026-05-02 15:40:03 +02:00
committed by Jacek Galowicz
co-authored by phanirithvij
parent 6323489f80
commit 79100aff14
+1 -1
View File
@@ -36,7 +36,7 @@ let
theOnlyMachine =
let
exactlyOneMachine = lib.length (lib.attrValues config.nodes) == 1;
allMachineNames = map (c: c.system.name) (lib.attrValues config.allMachines);
allMachineNames = lib.attrNames config.allMachines;
in
lib.optional (exactlyOneMachine && !lib.elem "machine" allMachineNames) "machine";