git.iko.soy/typeable/nixpkgs
on master help sign in
Add option to display git revision to nixos-version

Example use case: git checkout `nixos-version --hash`

commit86cd055477ab91a6134a0bc437c3f6e24e0ac602 authorEduard Bachmakov <e.bachmakov@gmail.com> dateSat 27 Dec 2014, 21:43 (12 years ago) parentcbe467e
2 files changed+10−2
nixos/modules/installer/tools/nixos-version.sh+9−1 nixos/modules/installer/tools/tools.nix+1−1
nixos/modules/installer/tools/nixos-version.sh+9−1
@@ -1,2 +1,10 @@
11#! @shell@
2−echo "@nixosVersion@ (@nixosCodeName@)"
2+
3+case "$1" in
4+ --hash|--revision)
5+ echo "@nixosRevision@"
6+ ;;
7+ *)
8+ echo "@nixosVersion@ (@nixosCodeName@)"
9+ ;;
10+esac
nixos/modules/installer/tools/tools.nix+1−1
@@ -50,7 +50,7 @@ let
5050 nixos-version = makeProg {
5151 name = "nixos-version";
5252 src = ./nixos-version.sh;
53− inherit (config.system) nixosVersion nixosCodeName;
53+ inherit (config.system) nixosVersion nixosCodeName nixosRevision;
5454 };
5555
5656 /*