From 9cff1cca05114447083dcd3eb121beddf94c1eff Mon Sep 17 00:00:00 2001 From: nikstur Date: Thu, 9 Oct 2025 22:03:33 +0200 Subject: [PATCH] nixos/test-instrumentation: add backdoor option This allows using the test-instrumentation without the backdoor. This is useful for example for bashless tests. --- nixos/modules/testing/test-instrumentation.nix | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix index 9fb3ad6ab774..8461a7472d2b 100644 --- a/nixos/modules/testing/test-instrumentation.nix +++ b/nixos/modules/testing/test-instrumentation.nix @@ -85,6 +85,9 @@ in { options.testing = { + backdoor = lib.mkEnableOption "backdoor service in stage 2" // { + default = true; + }; initrdBackdoor = lib.mkEnableOption '' backdoor.service in initrd. Requires @@ -107,12 +110,14 @@ in } ]; - systemd.services.backdoor = lib.mkMerge [ - backdoorService - { - wantedBy = [ "multi-user.target" ]; - } - ]; + systemd.services.backdoor = lib.mkIf cfg.backdoor ( + lib.mkMerge [ + backdoorService + { + wantedBy = [ "multi-user.target" ]; + } + ] + ); boot.initrd.systemd = lib.mkMerge [ {