nixpkgs/nixos/modules/installer/tools/nixos-version.sh

24 lines
348 B
Bash
Raw Normal View History

#! @runtimeShell@
case "$1" in
-h|--help)
exec man nixos-version
exit 1
;;
--hash|--revision)
2020-02-10 15:32:59 +00:00
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