summary refs log tree commit diff
path: root/nixos/doc/manual/manpages/nixos-version.8
blob: 980ee8b1f49e9536ca9255f79aab9f1292b2a503 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
.Dd January 1, 1980
.\" nixpkgs groff will use Nixpkgs as the OS in the title by default, taking it from
.\" doc-default-operating-system. mandoc doesn't have this register set by default,
.\" so we can use it as a groff/mandoc switch.
.ie ddoc-default-operating-system .Dt nixos-version \&8 "NixOS System Manager's Manual"
.el .Dt nixos-version 8
.Os NixOS
.Sh NAME
.Nm nixos-version
.Nd show the NixOS version
.
.
.
.Sh SYNOPSIS
.Nm nixos-version
.Op Fl -hash
.Op Fl -revision
.Op Fl -configuration-revision
.Op Fl -json
.
.
.
.Sh DESCRIPTION
This command shows the version of the currently active NixOS configuration. For example:
.Bd -literal -offset indent
$ nixos-version
16.03.1011.6317da4 (Emu)
.Ed
.
.Pp
The version consists of the following elements:
.Bl -tag -width indent
.It Ql 16.03
The NixOS release, indicating the year and month in which it was released
(e.g. March 2016).
.It Ql 1011
The number of commits in the Nixpkgs Git repository between the start of the
release branch and the commit from which this version was built. This ensures
that NixOS versions are monotonically increasing. It is
.Ql git
when the current NixOS configuration was built from a checkout of the Nixpkgs
Git repository rather than from a NixOS channel.
.It Ql 6317da4
The first 7 characters of the commit in the Nixpkgs Git repository from which
this version was built.
.It Ql Emu
The code name of the NixOS release. The first letter of the code name indicates
that this is the N'th stable NixOS release; for example, Emu is the fifth
release.
.El
.
.
.
.Sh OPTIONS
.Bl -tag -width indent
.It Fl -hash , -revision
Show the full SHA1 hash of the Git commit from which this configuration was
built, e.g.
.Bd -literal -offset indent
$ nixos-version --hash
6317da40006f6bc2480c6781999c52d88dde2acf
.Ed
.
.It Fl -configuration-revision
Show the configuration revision if available. This could be the full SHA1 hash
of the Git commit of the system flake, if you add
.Bd -literal -offset indent
{ system.configurationRevision = self.rev or "dirty"; }
.Ed
.Pp
to the
.Ql modules
array of your flake.nix system configuration e.g.
.Bd -literal -offset indent
$ nixos-version --configuration-revision
aa314ebd1592f6cdd53cb5bba8bcae97d9323de8
.Ed
.
.It Fl -json
Print a JSON representation of the versions of NixOS and the top-level
configuration flake.
.El
.
.
.
.Sh AUTHORS
.An -nosplit
.An Eelco Dolstra
and
.An the Nixpkgs/NixOS contributors