refactor: make nanuqsaurus module-based; keep btrfs install profile

This commit is contained in:
randogoth 2026-02-04 20:53:05 +02:00
parent e640b43b2f
commit bb138278f1
13 changed files with 218 additions and 173 deletions

View file

@ -2,9 +2,12 @@
set -euo pipefail
UID="$(id -u)"
USER_NAME="$(id -un)"
USER_BUS="/run/user/$UID/bus"
HM_DIR="$HOME/.config/home-manager"
SKEL_DIR="/etc/skel/.config/home-manager"
EXPECTED_USER="${NANUQSAURUS_ADMIN_USER:-}"
HM_TARGET="${NANUQSAURUS_HM_TARGET:-$USER_NAME}"
# Ensure basic PATH for user units
export PATH="/run/current-system/sw/bin:${PATH:-}"
@ -79,6 +82,10 @@ trap 'notify "Bootstrap finished" "Your system is fully hydrated. It is recommen
# ---- Home Manager bootstrap -------------------------------------------------
if [[ -n "$EXPECTED_USER" && "$USER_NAME" != "$EXPECTED_USER" ]]; then
exit 0
fi
mkdir -p "$HM_DIR"
for f in flake.nix home.nix; do
@ -88,5 +95,5 @@ for f in flake.nix home.nix; do
install -m 600 "$src" "$dst"
done
home-manager switch --flake "$HM_DIR#admin"
home-manager switch --flake "$HM_DIR#$HM_TARGET"
touch "$HM_DIR/.hm_bootstrap_done"

View file

@ -2,7 +2,7 @@
set -euo pipefail
# Non-interactive Btrfs installer using disko-install.
# Defaults: DISK=/dev/vda TARGET_HOST=nanuqsaurus
# Defaults: DISK=/dev/vda TARGET_HOST=nanuqsaurus-btrfs
# If FLAKE is unset and /etc/nixos/flake.nix exists, it uses /etc/nixos.
# Otherwise, set FLAKE to a flake URI like:
# - git+https://codeberg.org/<owner>/<repo>.git