From 09a817f02d945b4180a16b8521edf4c64f07000e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Apr 2026 02:02:19 +0000 Subject: [PATCH] feat: clean up /mnt/etc/nixos after nixos-install, keep only 5 required files Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/08d1a4eb-697e-46d4-bb8e-71af6bb4316f Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com> --- iso/installer.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/iso/installer.py b/iso/installer.py index 969cc3f..8cdaf58 100644 --- a/iso/installer.py +++ b/iso/installer.py @@ -917,6 +917,19 @@ class InstallerWindow(Adw.ApplicationWindow): "--impure" ], buf) + # Clean up /mnt/etc/nixos — only 5 files are needed post-install. + # configuration.nix and modules/ were needed during nixos-install + # for flake evaluation, but are now baked into the Nix store via + # self.nixosModules.Sovran_SystemsOS. + GLib.idle_add(append_text, buf, "Cleaning up /mnt/etc/nixos...\n") + keep = {"flake.nix", "flake.lock", "hardware-configuration.nix", + "role-state.nix", "custom.nix"} + nixos_dir = "/mnt/etc/nixos" + for entry in os.listdir(nixos_dir): + if entry not in keep: + path = os.path.join(nixos_dir, entry) + run(["sudo", "rm", "-rf", path]) + GLib.idle_add(self.push_complete) # ── Step 6: Complete ───────────────────────────────────────────────────