3
0
Fork 0
forked from mirrors/nixpkgs

Add option to display git revision to nixos-version

Example use case: git checkout `nixos-version --hash`
This commit is contained in:
Eduard Bachmakov 2014-12-27 21:43:04 +01:00
parent cbe467ef99
commit 86cd055477
2 changed files with 10 additions and 2 deletions

View file

@ -1,2 +1,10 @@
#! @shell@
echo "@nixosVersion@ (@nixosCodeName@)"
case "$1" in
--hash|--revision)
echo "@nixosRevision@"
;;
*)
echo "@nixosVersion@ (@nixosCodeName@)"
;;
esac

View file

@ -50,7 +50,7 @@ let
nixos-version = makeProg {
name = "nixos-version";
src = ./nixos-version.sh;
inherit (config.system) nixosVersion nixosCodeName;
inherit (config.system) nixosVersion nixosCodeName nixosRevision;
};
/*