Compare commits

3 Commits

Author SHA1 Message Date
Sovran_Systems
2385466b1a Merge pull request #82 from naturallaw777/copilot/fix-nixos-install-absolute-paths
fix(installer): copy role-state.nix and custom.nix to host /etc/nixos before nixos-install
2026-04-05 11:57:33 -05:00
copilot-swe-agent[bot]
37ad4fd2ad fix: copy role-state.nix and custom.nix to host /etc/nixos before nixos-install
Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/38396f35-c812-43e5-9bf0-f7bd611cbba7

Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
2026-04-05 16:54:29 +00:00
copilot-swe-agent[bot]
35569e6ec0 Initial plan 2026-04-05 16:53:30 +00:00

View File

@@ -876,6 +876,14 @@ class InstallerWindow(Adw.ApplicationWindow):
if not os.path.exists(f): if not os.path.exists(f):
raise RuntimeError(f"Required file missing: {f}") raise RuntimeError(f"Required file missing: {f}")
# The flake.nix imports /etc/nixos/role-state.nix and /etc/nixos/custom.nix
# as absolute paths. With --impure, Nix resolves these on the live ISO host,
# not under /mnt. Copy them so they exist on the host filesystem too.
GLib.idle_add(append_text, buf, "Copying config files to host /etc/nixos for flake evaluation...\n")
run(["sudo", "mkdir", "-p", "/etc/nixos"])
run(["sudo", "cp", "/mnt/etc/nixos/role-state.nix", "/etc/nixos/role-state.nix"])
run(["sudo", "cp", "/mnt/etc/nixos/custom.nix", "/etc/nixos/custom.nix"])
run_stream([ run_stream([
"sudo", "nixos-install", "sudo", "nixos-install",
"--root", "/mnt", "--root", "/mnt",