From 79100aff14e76a791c9bb2de0741fb629e887adc Mon Sep 17 00:00:00 2001 From: Jacek Galowicz Date: Tue, 21 Apr 2026 13:02:55 +0000 Subject: [PATCH] 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 --- nixos/lib/testing/driver.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/lib/testing/driver.nix b/nixos/lib/testing/driver.nix index 3b082140e935..7421c25b2fbd 100644 --- a/nixos/lib/testing/driver.nix +++ b/nixos/lib/testing/driver.nix @@ -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";