Commit 1ae185712c00

Vincent Demeester <vincent@sbr.pm>
2026-09-10 14:07:36
fix(nagoya): preserve Nix config during home activation
Back up the bootstrap-created user Nix configuration before Home Manager activates and resolve Nagoya locally so repeated bootstrap runs complete without clobbering configuration or warning from sudo. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 353c02e
Changed files (3)
imperative/nagoya/bootstrap.sh
@@ -82,7 +82,7 @@ setup_host_configs() {
 
 setup_home_manager() {
 	cd "$REPO_PATH"
-	nix run home-manager -- switch --flake ".#vincent@${SYSTEM_CONFIG}"
+	nix run home-manager -- switch --flake ".#vincent@${SYSTEM_CONFIG}" -b backup
 }
 
 main() {
imperative/nagoya/test-bootstrap.sh
@@ -7,8 +7,9 @@ bootstrap="$repo_root/imperative/nagoya/bootstrap.sh"
 
 [[ -x "$bootstrap" ]]
 grep -q 'install.determinate.systems/nix' "$bootstrap"
-grep -q 'nix run home-manager -- switch --flake' "$bootstrap"
+grep -q "nix run home-manager -- switch --flake \".#vincent@\${SYSTEM_CONFIG}\" -b backup" "$bootstrap"
 grep -q 'git clone' "$bootstrap"
+grep -q '127.0.0.1 localhost nagoya' "$repo_root/systems/nagoya/gen-configs.nix"
 if grep -qE '\b(apt|systemctl|wg|wireguard)\b' "$bootstrap"; then
 	exit 1
 fi
systems/nagoya/gen-configs.nix
@@ -9,7 +9,7 @@
 let
   hostsEntries = libx.hostConfigs globals.machines;
   hosts = pkgs.writeText "hosts" ''
-    127.0.0.1 localhost
+    127.0.0.1 localhost nagoya
     ::1 localhost
     ${pkgs.lib.concatStringsSep "\n" (
       pkgs.lib.mapAttrsToList (ip: names: "${ip} ${pkgs.lib.concatStringsSep " " names}") hostsEntries