File tree Expand file tree Collapse file tree 2 files changed +6
-17
lines changed
pkgs/by-name/sw/switch-to-configuration-ng/src/src Expand file tree Collapse file tree 2 files changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -18,16 +18,21 @@ makeTest {
1818 meta = with maintainers ; {
1919 maintainers = [ urbas ] ;
2020 } ;
21- nodes . machine = { ... } :
21+ nodes . machine = { lib , pkgs , ... } :
2222 {
2323 imports = [ ../modules/profiles/headless.nix ../modules/virtualisation/amazon-init.nix ] ;
2424 services . openssh . enable = true ;
25+ system . switch . enable = true ;
2526 networking . hostName = "" ;
2627 environment . etc . "ec2-metadata/user-data" = {
2728 text = ''
2829 #!/usr/bin/bash
2930
3031 echo successful > /tmp/evidence
32+
33+ # Emulate running nixos-rebuild switch, just without any building.
34+ # https://github.com/nixos/nixpkgs/blob/4c62505847d88f16df11eff3c81bf9a453a4979e/nixos/modules/virtualisation/amazon-init.nix#L55
35+ /run/current-system/bin/switch-to-configuration test
3136 '' ;
3237 } ;
3338 } ;
Original file line number Diff line number Diff line change @@ -1082,22 +1082,6 @@ won't take effect until you reboot the system.
10821082 . subscribe ( )
10831083 . context ( "Failed to subscribe to systemd dbus messages" ) ?;
10841084
1085- // Wait for the system to have finished booting.
1086- loop {
1087- let system_state: String = systemd
1088- . get ( "org.freedesktop.systemd1.Manager" , "SystemState" )
1089- . context ( "Failed to get system state" ) ?;
1090-
1091- match system_state. as_str ( ) {
1092- "running" | "degraded" | "maintenance" => break ,
1093- _ => {
1094- _ = dbus_conn
1095- . process ( Duration :: from_millis ( 500 ) )
1096- . context ( "Failed to process dbus messages" ) ?
1097- }
1098- }
1099- }
1100-
11011085 let _systemd_reload_status = systemd_reload_status. clone ( ) ;
11021086 let reloading_token = systemd
11031087 . match_signal (
You can’t perform that action at this time.
0 commit comments