about summary refs log tree commit diff
path: root/nixos/modules/installer/tools/nixos-enter.sh
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/installer/tools/nixos-enter.sh')
-rw-r--r--nixos/modules/installer/tools/nixos-enter.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/nixos/modules/installer/tools/nixos-enter.sh b/nixos/modules/installer/tools/nixos-enter.sh
index 96b6a017b810..fcd0c54f5db9 100644
--- a/nixos/modules/installer/tools/nixos-enter.sh
+++ b/nixos/modules/installer/tools/nixos-enter.sh
@@ -45,6 +45,11 @@ while [ "$#" -gt 0 ]; do
     esac
 done
 
+if [[ ! -e $mountPoint/etc/NIXOS ]]; then
+    echo "$0: '$mountPoint' is not a NixOS installation" >&2
+    exit 126
+fi
+
 mkdir -m 0755 -p "$mountPoint/dev"
 mount --rbind /dev "$mountPoint/dev"