diff --git a/pkgs/nomarchy-install/nomarchy-install.sh b/pkgs/nomarchy-install/nomarchy-install.sh index e957b97..4b7f8c8 100644 --- a/pkgs/nomarchy-install/nomarchy-install.sh +++ b/pkgs/nomarchy-install/nomarchy-install.sh @@ -405,6 +405,12 @@ fi commit -qm "Initial Nomarchy configuration" ) +# The user must own their flake — libgit2 refuses repositories owned by +# someone else, which breaks `home-manager switch` (and theme switching) +# outright. The first normal NixOS user is always 1000:users(100); the +# account doesn't exist in the target yet, so numeric ids it is. +chown -R 1000:100 "$FLAKE_DIR" + # /etc/nixos on the installed system points at the user-owned flake. mkdir -p /mnt/etc ln -sfn "/home/$USERNAME/.nomarchy" /mnt/etc/nixos @@ -463,7 +469,7 @@ export NIX_CONFIG=$(printf '%q' "$NIX_CONFIG") out=\$(nix --extra-experimental-features "nix-command flakes" \ build --no-link --print-out-paths \ --option substituters "" \ - "/home/$USERNAME/.nomarchy#homeConfigurations.$USERNAME.activationPackage") + "path:/home/$USERNAME/.nomarchy#homeConfigurations.$USERNAME.activationPackage") install -d -o "$USERNAME" -g users /nix/var/nix/profiles/per-user/$USERNAME install -d -o "$USERNAME" -g users /nix/var/nix/gcroots/per-user/$USERNAME runuser -u "$USERNAME" -- bash -lc "USER=$USERNAME HOME=/home/$USERNAME \$out/activate" @@ -472,7 +478,7 @@ if nixos-enter --root /mnt -- bash /tmp/nomarchy-hm-activate.sh; then success "Desktop pre-activated — first boot is fully themed" else warn "Desktop pre-activation failed; after first login run:" - warn " home-manager switch --flake ~/.nomarchy" + warn " home-manager switch --flake ~/.nomarchy -b bak" fi rm -f /mnt/tmp/nomarchy-hm-activate.sh