diff --git a/nixos/modules/installer/tools/nixos-version.sh b/nixos/modules/installer/tools/nixos-version.sh index 5dbf277fe4c4..51aa2dd82321 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 diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix index 2c796250a982..2ba1dc0841e2 100644 --- a/nixos/modules/installer/tools/tools.nix +++ b/nixos/modules/installer/tools/tools.nix @@ -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; }; /*