mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 17:33:09 +00:00
25 lines
372 B
Bash
25 lines
372 B
Bash
#! @runtimeShell@
|
|
# shellcheck shell=bash
|
|
|
|
case "$1" in
|
|
-h|--help)
|
|
exec man nixos-version
|
|
exit 1
|
|
;;
|
|
--hash|--revision)
|
|
if ! [[ @revision@ =~ ^[0-9a-f]+$ ]]; then
|
|
echo "$0: Nixpkgs commit hash is unknown"
|
|
exit 1
|
|
fi
|
|
echo "@revision@"
|
|
;;
|
|
--json)
|
|
cat <<EOF
|
|
@json@
|
|
EOF
|
|
;;
|
|
*)
|
|
echo "@version@ (@codeName@)"
|
|
;;
|
|
esac
|