Compare commits
2 Commits
revers-upd
...
pr-5024
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8584f3247a | ||
|
|
d3534a2b72 |
@@ -214,26 +214,28 @@ def run_machine_install(opts: InstallOptions, target_host: Remote) -> None:
|
|||||||
cmd,
|
cmd,
|
||||||
)
|
)
|
||||||
|
|
||||||
notify_install_step("nixos-anywhere")
|
default_install_steps: dict[str, Step] = {
|
||||||
run(
|
"kexec": "nixos-anywhere",
|
||||||
[*cmd, "--phases", "kexec"],
|
"disko": "formatting",
|
||||||
RunOpts(log=Log.BOTH, prefix=machine.name, needs_user_terminal=True),
|
"install": "installing",
|
||||||
)
|
"reboot": "rebooting",
|
||||||
notify_install_step("formatting")
|
}
|
||||||
run(
|
|
||||||
[*cmd, "--phases", "disko"],
|
def run_phase(phase: str) -> None:
|
||||||
RunOpts(log=Log.BOTH, prefix=machine.name, needs_user_terminal=True),
|
notification = default_install_steps.get(phase, "nixos-anywhere")
|
||||||
)
|
notify_install_step(notification)
|
||||||
notify_install_step("installing")
|
run(
|
||||||
run(
|
[*cmd, "--phases", phase],
|
||||||
[*cmd, "--phases", "install"],
|
RunOpts(log=Log.BOTH, prefix=machine.name, needs_user_terminal=True),
|
||||||
RunOpts(log=Log.BOTH, prefix=machine.name, needs_user_terminal=True),
|
)
|
||||||
)
|
|
||||||
notify_install_step("rebooting")
|
if opts.phases:
|
||||||
run(
|
phases = [phase.strip() for phase in opts.phases.split(",")]
|
||||||
[*cmd, "--phases", "reboot"],
|
for phase in phases:
|
||||||
RunOpts(log=Log.BOTH, prefix=machine.name, needs_user_terminal=True),
|
run_phase(phase)
|
||||||
)
|
else:
|
||||||
|
for phase in ["kexec", "disko", "install", "reboot"]:
|
||||||
|
run_phase(phase)
|
||||||
|
|
||||||
if opts.persist_state:
|
if opts.persist_state:
|
||||||
inventory_store = InventoryStore(machine.flake)
|
inventory_store = InventoryStore(machine.flake)
|
||||||
|
|||||||
Reference in New Issue
Block a user