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 [ {