diff --git a/nixos/modules/installer/tools/nixos-version.sh b/nixos/modules/installer/tools/nixos-version.sh index bde6c9c30030..fb0fe26116a6 100644 --- a/nixos/modules/installer/tools/nixos-version.sh +++ b/nixos/modules/installer/tools/nixos-version.sh @@ -6,7 +6,7 @@ case "$1" in exit 1 ;; --hash|--revision) - if ! [[ @revision@ =~ /[0-9a-f]+/ ]]; then + if ! [[ @revision@ =~ ^[0-9a-f]+$ ]]; then echo "$0: Nixpkgs commit hash is unknown" exit 1 fi