aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-20 13:56:10 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-20 13:56:10 +0100
commit026237a5f47986aa644761445ff71f6c1f0f6f90 (patch)
tree4790a877cb81414fa0c1bedde83c0aa2e285f0a0
parent45aa471501294806c8390ea2f21796abc705b8cd (diff)
downloaddotfiles-026237a5f47986aa644761445ff71f6c1f0f6f90.tar.gz
dotfiles-026237a5f47986aa644761445ff71f6c1f0f6f90.tar.bz2
dotfiles-026237a5f47986aa644761445ff71f6c1f0f6f90.zip
fix(bootstrap): use pacman nix instead of curl installer
Pacman's 'nix' package is already in meta/base.txt and provides the same multi-user daemon setup (nix-daemon.socket already enabled via systemd-units/system.txt; flakes already enabled via /etc/nix/nix.conf from etc/). The curl-piped Determinate installer was adding nothing on top — and on a host where pacman already installed nix, it would create two competing nix binaries. Changes: - Add 'nix' to PREREQS so pacman installs it alongside the other prerequisites, before 'just init' runs. - Drop the curl install block. - Source /etc/profile.d/nix.sh (or nix-daemon.sh) before 'just init' so the nix-switch step inside 'just init' finds the binary in PATH.
-rwxr-xr-xbootstrap.sh33
1 files changed, 16 insertions, 17 deletions
diff --git a/bootstrap.sh b/bootstrap.sh
index 1d3783b..d6f986c 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -33,7 +33,7 @@ id -nG "$USER" | tr ' ' '\n' | grep -qx wheel ||
# 2. install sudo + pacman prerequisites, enable wheel in sudoers.
# If sudo is absent we do this in a single su -c so the root password
# is entered only once. If sudo is already there, reuse it.
-PREREQS='sudo git base-devel chezmoi just efibootmgr'
+PREREQS='sudo git base-devel chezmoi just efibootmgr nix'
SUDOERS_SED='s/^# *\(%wheel ALL=(ALL:ALL\(:ALL\)*) ALL\)/\1/'
if ! command -v sudo >/dev/null 2>&1; then
@@ -72,25 +72,24 @@ fi
# at sudo-rs (PATH precedence shadows /usr/bin/sudo), and installs
# git hooks. The classic 'sudo' package stays installed because
# base-devel hard-depends on it; that's harmless — the binary is
-# never invoked once /usr/local/bin/sudo is in place.
-# `just init` also runs `just nix-switch` (step 5b below); the nix
-# install needs to happen before that.
+# never invoked once /usr/local/bin/sudo is in place. `just init`
+# also runs `just nix-switch` to apply the Home-Manager profile;
+# nix itself is part of PREREQS above (pacman package), and
+# nix-daemon.socket is enabled by `unit-apply` via
+# systemd-units/system.txt.
cd "$DOTFILES_DIR"
-# 5a. install nix (Determinate Systems installer, multi-user) before
-# `just init`, so `just nix-switch` finds it.
-if ! command -v nix >/dev/null 2>&1; then
- log 'installing nix (Determinate Systems multi-user installer)'
- curl --proto '=https' --tlsv1.2 -sSf -L \
- https://install.determinate.systems/nix |
- sh -s -- install linux --no-confirm
- # Source nix env for the rest of this script (installer writes
- # /etc/profile.d/nix.sh but the current shell hasn't sourced it).
- if [ -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]; then
- # shellcheck disable=SC1091
- . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
+# Source the nix profile so `nix` is on PATH for the rest of this
+# script (pacman drops /etc/profile.d/nix.sh but the current shell
+# didn't read it). Multi-user (daemon mode) and per-user variants exist;
+# pacman ships the multi-user one.
+for f in /etc/profile.d/nix.sh /etc/profile.d/nix-daemon.sh; do
+ if [ -r "$f" ]; then
+ # shellcheck disable=SC1090
+ . "$f"
+ break
fi
-fi
+done
log 'running just init'
just init