install: add progress to ui

This commit is contained in:
Johannes Kirschbauer
2025-08-12 13:31:59 +02:00
parent 8aa88b22ab
commit 9880847d43
2 changed files with 21 additions and 5 deletions

View File

@@ -545,7 +545,14 @@ const InstallSummary = () => {
); );
}; };
type InstallTopic = "generators" | "upload-secrets" | "nixos-anywhere"; type InstallTopic = [
"generators",
"upload-secrets",
"nixos-anywhere",
"formatting",
"rebooting",
"installing",
][number];
const InstallProgress = () => { const InstallProgress = () => {
const stepSignal = useStepper<InstallSteps>(); const stepSignal = useStepper<InstallSteps>();
@@ -599,6 +606,15 @@ const InstallProgress = () => {
<Match when={installState()?.topic === "nixos-anywhere"}> <Match when={installState()?.topic === "nixos-anywhere"}>
Running nixos-anywhere ... Running nixos-anywhere ...
</Match> </Match>
<Match when={installState()?.topic === "formatting"}>
Formatting ...
</Match>
<Match when={installState()?.topic === "installing"}>
Installing ...
</Match>
<Match when={installState()?.topic === "rebooting"}>
Rebooting ...
</Match>
</Switch> </Switch>
</Match> </Match>
</Switch> </Switch>

View File

@@ -203,21 +203,21 @@ def run_machine_install(opts: InstallOptions, target_host: Remote) -> None:
notify_install_step("nixos-anywhere") notify_install_step("nixos-anywhere")
run( run(
cmd + +["--phases", "kexec"], [*cmd, "--phases", "kexec"],
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("formatting") notify_install_step("formatting")
run( run(
cmd + +["--phases", "disko"], [*cmd, "--phases", "disko"],
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("installing") notify_install_step("installing")
run( run(
cmd + +["--phases", "install"], [*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") notify_install_step("rebooting")
run( run(
cmd + +["--phases", "reboot"], [*cmd, "--phases", "reboot"],
RunOpts(log=Log.BOTH, prefix=machine.name, needs_user_terminal=True), RunOpts(log=Log.BOTH, prefix=machine.name, needs_user_terminal=True),
) )