commit 407839471a14f10d5d1d0bc3e35094ead97678c8 equwal <13551856+equwal@users.noreply.github.com> 2026-10-04 03:28:08 -0700 Arch: copy and enable the nix-daemon units inside the chroot The profile symlink is absolute, so the host path did not resolve; also create /nix/var/nix/daemon-socket, which nix-daemon.socket requires.
backends/arch.sh | 6 ++---- install.sh | 3 ++- test-qemu.py | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/backends/arch.sh b/backends/arch.sh index 886285e..0bee1ae 100644 --- a/backends/arch.sh +++ b/backends/arch.sh @@ -26,10 +26,8 @@ user_add() { ch "useradd -m -G wheel,video,input,audio -s /bin/bash $1"; } serial_getty() { ch "systemctl enable serial-getty@ttyS0" >/dev/null 2>&1; } nix_native() { return 1; } nix_service() { - for u in nix-daemon.socket nix-daemon.service; do - ln -sf /nix/var/nix/profiles/default/lib/systemd/system/$u $M/etc/systemd/system/$u - done - ch "systemctl enable nix-daemon.socket" >/dev/null 2>&1 + ch "cp /nix/var/nix/profiles/default/lib/systemd/system/nix-daemon.* /etc/systemd/system/ && + systemctl enable nix-daemon.socket" } boot_cmd() { printf '[Unit]\nDescription=waybase boot command\n[Service]\nType=oneshot\nExecStart=/bin/sh -c "%s"\n[Install]\nWantedBy=multi-user.target\n' \ diff --git a/install.sh b/install.sh index 98d748d..2bc7e26 100644 --- a/install.sh +++ b/install.sh @@ -165,7 +165,8 @@ if ! nix_native; then NV=${NV##*/nix-} T=/tmp/nix-$NV-x86_64-linux f=$(fetch "https://releases.nixos.org/nix/nix-$NV/nix-$NV-x86_64-linux.tar.xz") && tar -xJf "$f" -C $M/tmp && rm "$f" - mkdir -p $M/nix/store $M/nix/var/nix/profiles/per-user $M/nix/var/nix/gcroots + # daemon-socket must exist: nix-daemon.socket has ConditionPathIsReadWrite on it + mkdir -p $M/nix/store $M/nix/var/nix/profiles/per-user $M/nix/var/nix/gcroots $M/nix/var/nix/daemon-socket mv $M$T/store/* $M/nix/store/ NIX=$(cd $M/nix/store && ls -d ./*-nix-"$NV" | head -1); NIX=/nix/store/${NIX#./} CA=$(cd $M/nix/store && ls -d ./*-nss-cacert-* | head -1); CA=/nix/store/${CA#./} diff --git a/test-qemu.py b/test-qemu.py index 3d7d12d..43e09b0 100644 --- a/test-qemu.py +++ b/test-qemu.py @@ -133,7 +133,7 @@ login(vm, "tester", PW["user"]) r = vm.run(r""" . /etc/profile >/dev/null 2>&1 nix --version 2>&1 | head -1 | sed 's/^/NIXVER /' -nix store info --store daemon >/dev/null 2>&1 || nix store ping --store daemon >/dev/null 2>&1 && echo NIXDAEMON_OK +nix store info --store daemon >/tmp/ns.log 2>&1 && echo NIXDAEMON_OK || tail -3 /tmp/ns.log for b in foot fuzzel pipewire wireplumber waybase-session; do command -v $b >/dev/null || echo MISSING:$b; done echo FROMNIX $(cat /etc/waybase-from-nix) for c in %s; do