fix(installer): improve error handling for deployed flake.nix write

Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/b7dfaecc-2b2e-4f5f-bb9a-f97ced90e76e

Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-07 20:20:36 +00:00
committed by GitHub
parent d3a5b3e6ef
commit 48de6b9821

View File

@@ -956,12 +956,16 @@ class InstallerWindow(Adw.ApplicationWindow):
run(["sudo", "rm", "-rf", path])
GLib.idle_add(append_text, buf, "Writing deployed flake.nix...\n")
subprocess.run(
proc = subprocess.run(
["sudo", "tee", "/mnt/etc/nixos/flake.nix"],
input=DEPLOYED_FLAKE,
capture_output=True,
text=True,
check=True,
)
log(proc.stdout)
if proc.returncode != 0:
log(proc.stderr)
raise RuntimeError(proc.stderr.strip() or "Failed to write deployed flake.nix")
run(["sudo", "rm", "-f", "/mnt/etc/nixos/flake.lock"])
GLib.idle_add(self.push_create_password)