diff --git a/nixos/modules/installer/tools/nixos-enter.sh b/nixos/modules/installer/tools/nixos-enter.sh index 96b6a017b81..fcd0c54f5db 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"