1 import ./make-test-python.nix ({ pkgs, systemdStage1 ? false, ...} : let
2 msg = "Shutting down NixOS";
4 name = "systemd-shutdown";
5 meta = with pkgs.lib.maintainers; {
6 maintainers = [ das_j ];
10 imports = [ ../modules/profiles/minimal.nix ];
11 systemd.shutdownRamfs.contents."/etc/systemd/system-shutdown/shutdown-message".source = pkgs.writeShellScript "shutdown-message" ''
14 boot.initrd.systemd.enable = systemdStage1;
18 machine.wait_for_unit("multi-user.target")
19 # .shutdown() would wait for the machine to power off
20 machine.succeed("systemctl poweroff")
21 # Message printed by systemd-shutdown
22 machine.wait_for_console_text("Unmounting '/oldroot'")
23 machine.wait_for_console_text("${msg}")
24 # Don't try to sync filesystems
25 machine.wait_for_shutdown()