@@ -62,9 +62,11 @@ chown -f 0:30000 /nix/store
6262chmod -f 1775 /nix/store
6363if [ -n "@readOnlyStore@" ]; then
6464 if ! [[ "$(findmnt --noheadings --output OPTIONS /nix/store)" =~ ro(,|$) ]]; then
65− # FIXME when linux < 4.5 is EOL, switch to atomic bind mounts
66− #mount /nix/store /nix/store -o bind,remount,ro
67− mount --bind /nix/store /nix/store
65+ if [ -z "$container" ]; then
66+ mount --bind /nix/store /nix/store
67+ else
68+ mount --rbind /nix/store /nix/store
69+ fi
6870 mount -o remount,ro,bind /nix/store
6971 fi
7072fi