6 .Nd show the NixOS version
14 .Op Fl -configuration-revision
20 This command shows the version of the currently active NixOS configuration. For example:
21 .Bd -literal -offset indent
23 16.03.1011.6317da4 (Emu)
27 The version consists of the following elements:
28 .Bl -tag -width indent
30 The NixOS release, indicating the year and month in which it was released
33 The number of commits in the Nixpkgs Git repository between the start of the
34 release branch and the commit from which this version was built. This ensures
35 that NixOS versions are monotonically increasing. It is
37 when the current NixOS configuration was built from a checkout of the Nixpkgs
38 Git repository rather than from a NixOS channel.
40 The first 7 characters of the commit in the Nixpkgs Git repository from which
41 this version was built.
43 The code name of the NixOS release. The first letter of the code name indicates
44 that this is the N'th stable NixOS release; for example, Emu is the fifth
51 .Bl -tag -width indent
52 .It Fl -hash , -revision
53 Show the full SHA1 hash of the Git commit from which this configuration was
55 .Bd -literal -offset indent
56 $ nixos-version --hash
57 6317da40006f6bc2480c6781999c52d88dde2acf
60 .It Fl -configuration-revision
61 Show the configuration revision if available. This could be the full SHA1 hash
62 of the Git commit of the system flake, if you add
63 .Bd -literal -offset indent
64 { system.configurationRevision = self.rev or "dirty"; }
69 array of your flake.nix system configuration e.g.
70 .Bd -literal -offset indent
71 $ nixos-version --configuration-revision
72 aa314ebd1592f6cdd53cb5bba8bcae97d9323de8
76 Print a JSON representation of the versions of NixOS and the top-level
86 .An the Nixpkgs/NixOS contributors