From d5fa86dbc7738f025da4a74de46ddb88b8c3f3ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ryan4yin=20=7C=20=E4=BA=8C=E8=8A=B1?= Date: Sat, 3 Oct 2026 12:18:46 +0800 Subject: [PATCH] fix(qemu-guest): let the NixOS test framework override serial-getty@ttyS0 (#362) test-instrumentation.nix sets serial-getty@ttyS0.enable = false at normal priority to keep ttyS0 free for the test backdoor console, while qemu-guest.nix set it to true at normal priority. Two conflicting normal-priority definitions made `nix flake check` fail while evaluating packages.x86_64-linux.ruby-nixos-tests. Use lib.mkDefault so the test framework wins in tests while ordinary QEMU guests still enable the serial getty. --- modules/nixos/server/qemu-guest.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/nixos/server/qemu-guest.nix b/modules/nixos/server/qemu-guest.nix index 27eb56b3..ac5aed2c 100644 --- a/modules/nixos/server/qemu-guest.nix +++ b/modules/nixos/server/qemu-guest.nix @@ -33,6 +33,8 @@ services.openssh.enable = true; # we configure the host via nixos itself, so we don't need the cloud-init services.cloud-init.enable = lib.mkForce false; - systemd.services."serial-getty@ttyS0".enable = true; + # Default so the NixOS test framework can override it: test-instrumentation + # disables this getty to keep ttyS0 free for its backdoor console. + systemd.services."serial-getty@ttyS0".enable = lib.mkDefault true; }; }