summary refs log tree commit diff
path: root/nixos/modules/installer/tools/nixos-version.sh
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/installer/tools/nixos-version.sh')
-rw-r--r--nixos/modules/installer/tools/nixos-version.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/nixos/modules/installer/tools/nixos-version.sh b/nixos/modules/installer/tools/nixos-version.sh
index 5dbf277fe4c..51aa2dd8232 100644
--- a/nixos/modules/installer/tools/nixos-version.sh
+++ b/nixos/modules/installer/tools/nixos-version.sh
@@ -1,2 +1,10 @@
 #! @shell@
-echo "@nixosVersion@ (@nixosCodeName@)"
+
+case "$1" in
+  --hash|--revision)
+    echo "@nixosRevision@"
+    ;;
+  *)
+    echo "@nixosVersion@ (@nixosCodeName@)"
+    ;;
+esac