diff --git a/nixos/tests/amazon-init-shell.nix b/nixos/tests/amazon-init-shell.nix index 3c040841b6d2..da4480ed5778 100644 --- a/nixos/tests/amazon-init-shell.nix +++ b/nixos/tests/amazon-init-shell.nix @@ -18,16 +18,21 @@ makeTest { meta = with maintainers; { maintainers = [ urbas ]; }; - nodes.machine = { ... }: + nodes.machine = { lib, pkgs, ... }: { imports = [ ../modules/profiles/headless.nix ../modules/virtualisation/amazon-init.nix ]; services.openssh.enable = true; + system.switch.enable = true; networking.hostName = ""; environment.etc."ec2-metadata/user-data" = { text = '' #!/usr/bin/bash echo successful > /tmp/evidence + + # Emulate running nixos-rebuild switch, just without any building. + # https://github.com/nixos/nixpkgs/blob/4c62505847d88f16df11eff3c81bf9a453a4979e/nixos/modules/virtualisation/amazon-init.nix#L55 + /run/current-system/bin/switch-to-configuration test ''; }; };