From 3baffb2a697c65283989fc109a94e25574fc3f7e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Apr 2026 16:42:51 +0000 Subject: [PATCH 1/2] Initial plan From a8128cef8dad74d6a6999aef526f383a652c3717 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Apr 2026 16:43:50 +0000 Subject: [PATCH 2/2] Fix chpasswd: find binary in Nix store and pipe password inline Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/630a25f6-417a-47de-b163-b519252b403c Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com> --- iso/installer.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/iso/installer.py b/iso/installer.py index 7e35402..f27df18 100644 --- a/iso/installer.py +++ b/iso/installer.py @@ -1000,9 +1000,20 @@ class InstallerWindow(Adw.ApplicationWindow): raise RuntimeError(proc.stderr.strip() or "Failed to write password file") run(["sudo", "chmod", "600", "/mnt/var/lib/secrets/free-password"]) + # Locate chpasswd in the installed system's Nix store + chpasswd_find = subprocess.run( + ["sudo", "find", "/mnt/nix/store", "-name", "chpasswd", "-type", "f", "-path", "*/bin/chpasswd"], + capture_output=True, text=True + ) + chpasswd_paths = chpasswd_find.stdout.strip().splitlines() + if not chpasswd_paths: + raise RuntimeError("chpasswd binary not found in /mnt/nix/store") + # Use the first match; strip the /mnt prefix for chroot-relative path + chpasswd_bin = chpasswd_paths[0][len("/mnt"):] + proc = subprocess.run( - ["sudo", "nixos-enter", "--root", "/mnt", "--", "sh", "-c", "chpasswd"], - input=f"free:{password}", + ["sudo", "chroot", "/mnt", "sh", "-c", + f"echo 'free:{password}' | {chpasswd_bin}"], capture_output=True, text=True ) if proc.returncode != 0: