diff --git a/nixos/doc/manual/man-nixos-version.xml b/nixos/doc/manual/man-nixos-version.xml new file mode 100644 index 00000000000..db7440977c9 --- /dev/null +++ b/nixos/doc/manual/man-nixos-version.xml @@ -0,0 +1,102 @@ + + + + nixos-version + 8 + NixOS + + + + nixos-version + show the version of nixpkgs NixOS was built from + + + + + nixos-version + + + + + +Description + +This command describes the version of nixpkgs used to build +NixOS. + +By default the output includes: + + + The NixOS release + Number of commits since the release + Git SHA of the released commit + Codename of the NixOS release + + + +Example + +Here is an example output, and corresponding information: +$ nixos-version +16.03.1011.6317da4 (Emu) + + + + + + + + Attribute + Value + + + + + NixOS Release + 16.03 + + + Commit Count + 1011 + + + Commit SHA + 6317da4 + + + Release Codename + Emu + + + + + + + + + + + +Options + +This command accepts the following options: + + + + + + + + The output will be the full hash of the git commit +$ nixos-version --hash +6317da40006f6bc2480c6781999c52d88dde2acf + + + + + + + + diff --git a/nixos/doc/manual/man-pages.xml b/nixos/doc/manual/man-pages.xml index 97a2c16d406..e945e0e6263 100644 --- a/nixos/doc/manual/man-pages.xml +++ b/nixos/doc/manual/man-pages.xml @@ -27,5 +27,6 @@ + diff --git a/nixos/modules/installer/tools/nixos-version.sh b/nixos/modules/installer/tools/nixos-version.sh index 51aa2dd8232..e4e4f5c446c 100644 --- a/nixos/modules/installer/tools/nixos-version.sh +++ b/nixos/modules/installer/tools/nixos-version.sh @@ -1,6 +1,9 @@ #! @shell@ case "$1" in + --help) + exec man nixos-version + exit 1 --hash|--revision) echo "@nixosRevision@" ;;