peru: 1.2.0 -> 1.3.3 (#373970)
[NixPkgs.git] / nixos / modules / installer / tools / nixos-version.sh
blob39e34a3718cb1e8e2d18ba28c2b1a8cc7f373445
1 #! @runtimeShell@
2 # shellcheck shell=bash
4 case "$1" in
5 -h|--help)
6 exec man nixos-version
7 exit 1
8 ;;
9 --hash|--revision)
10 if ! [[ @revision@ =~ ^[0-9a-f]+$ ]]; then
11 echo "$0: Nixpkgs commit hash is unknown" >&2
12 exit 1
14 echo "@revision@"
16 --configuration-revision)
17 if [[ "@configurationRevision@" =~ "@" ]]; then
18 echo "$0: configuration revision is unknown" >&2
19 exit 1
21 echo "@configurationRevision@"
23 --json)
24 cat <<EOF
25 @json@
26 EOF
29 echo "@version@ (@codeName@)"
31 esac