From 8e33e4fa3f67e6ddf6926e9bcae425f2ef617011 Mon Sep 17 00:00:00 2001 From: randogoth Date: Wed, 14 Jan 2026 18:46:55 +0200 Subject: [PATCH] fixed missing system profile --- files/system/usr/bin/mount-nix.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/files/system/usr/bin/mount-nix.sh b/files/system/usr/bin/mount-nix.sh index 5e45edf..2dc3a43 100755 --- a/files/system/usr/bin/mount-nix.sh +++ b/files/system/usr/bin/mount-nix.sh @@ -14,11 +14,25 @@ copy_seed_store() { fi } +ensure_system_profile() { + local seed_profile="/usr/share/nix-store/var/nix/profiles/system" + local target_profile="/var/lib/nix-store/var/nix/profiles/system" + + mkdir -p /var/lib/nix-store/var/nix/profiles + + if { [ ! -e "$target_profile" ] || [ -L "$target_profile" ] && [ ! -e "$(readlink -f "$target_profile")" ]; } \ + && [ -e "$seed_profile" ]; then + cp -a "$seed_profile" "$target_profile" + fi +} + if ! mountpoint -q /nix; then if [ -z "$(ls -A /var/lib/nix-store 2>/dev/null)" ] && compgen -G "/usr/share/nix-store/*" >/dev/null; then copy_seed_store fi + ensure_system_profile + mount --bind /var/lib/nix-store /nix mount -o remount,bind,exec /nix