deinonyxus/files/system/usr/bin/mount-nix-overlay.sh
2025-12-22 21:13:22 +02:00

13 lines
337 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
mkdir -p /usr/share/nix-store /var/lib/nix-store /var/cache/nix-store /nix
# Skip if already mounted to avoid errors on reload.
if mountpoint -q /nix; then
exit 0
fi
mount -t overlay overlay \
-o lowerdir=/usr/share/nix-store,upperdir=/var/lib/nix-store,workdir=/var/cache/nix-store \
/nix