about summary refs log tree commit diff
path: root/third_party/nix/doc/manual/release-notes/rl-1.7.xml
blob: 44ecaa78da5f1c018ed5a48a049db1d3869091df (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<section xmlns="http://docbook.org/ns/docbook"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      version="5.0"
      xml:id="ssec-relnotes-1.7">

<title>Release 1.7 (2014-04-11)</title>

<para>In addition to the usual bug fixes, this release has the
following new features:</para>

<itemizedlist>

  <listitem>
    <para>Antiquotation is now allowed inside of quoted attribute
    names (e.g. <literal>set."${foo}"</literal>). In the case where
    the attribute name is just a single antiquotation, the quotes can
    be dropped (e.g. the above example can be written
    <literal>set.${foo}</literal>). If an attribute name inside of a
    set declaration evaluates to <literal>null</literal> (e.g.
    <literal>{ ${null} = false; }</literal>), then that attribute is
    not added to the set.</para>
  </listitem>

  <listitem>
    <para>Experimental support for cryptographically signed binary
    caches.  See <link
    xlink:href="https://github.com/NixOS/nix/commit/0fdf4da0e979f992db75cc17376e455ddc5a96d8">the
    commit for details</link>.</para>
  </listitem>

  <listitem>
    <para>An experimental new substituter,
    <command>download-via-ssh</command>, that fetches binaries from
    remote machines via SSH.  Specifying the flags <literal>--option
    use-ssh-substituter true --option ssh-substituter-hosts
    <replaceable>user@hostname</replaceable></literal> will cause Nix
    to download binaries from the specified machine, if it has
    them.</para>
  </listitem>

  <listitem>
    <para><command>nix-store -r</command> and
    <command>nix-build</command> have a new flag,
    <option>--check</option>, that builds a previously built
    derivation again, and prints an error message if the output is not
    exactly the same. This helps to verify whether a derivation is
    truly deterministic.  For example:

<screen>
$ nix-build '&lt;nixpkgs>' -A patchelf
<replaceable>…</replaceable>
$ nix-build '&lt;nixpkgs>' -A patchelf --check
<replaceable>…</replaceable>
error: derivation `/nix/store/1ipvxs…-patchelf-0.6' may not be deterministic:
  hash mismatch in output `/nix/store/4pc1dm…-patchelf-0.6.drv'
</screen>

    </para>

  </listitem>

  <listitem>
    <para>The <command>nix-instantiate</command> flags
    <option>--eval-only</option> and <option>--parse-only</option>
    have been renamed to <option>--eval</option> and
    <option>--parse</option>, respectively.</para>
  </listitem>

  <listitem>
    <para><command>nix-instantiate</command>,
    <command>nix-build</command> and <command>nix-shell</command> now
    have a flag <option>--expr</option> (or <option>-E</option>) that
    allows you to specify the expression to be evaluated as a command
    line argument.  For instance, <literal>nix-instantiate --eval -E
    '1 + 2'</literal> will print <literal>3</literal>.</para>
  </listitem>

  <listitem>
    <para><command>nix-shell</command> improvements:</para>

    <itemizedlist>

      <listitem>
        <para>It has a new flag, <option>--packages</option> (or
        <option>-p</option>), that sets up a build environment
        containing the specified packages from Nixpkgs. For example,
        the command

<screen>
$ nix-shell -p sqlite xorg.libX11 hello
</screen>

        will start a shell in which the given packages are
        present.</para>
      </listitem>

      <listitem>
        <para>It now uses <filename>shell.nix</filename> as the
        default expression, falling back to
        <filename>default.nix</filename> if the former doesn’t
        exist.  This makes it convenient to have a
        <filename>shell.nix</filename> in your project to set up a
        nice development environment.</para>
      </listitem>

      <listitem>
        <para>It evaluates the derivation attribute
        <varname>shellHook</varname>, if set. Since
        <literal>stdenv</literal> does not normally execute this hook,
        it allows you to do <command>nix-shell</command>-specific
        setup.</para>
      </listitem>

      <listitem>
        <para>It preserves the user’s timezone setting.</para>
      </listitem>

    </itemizedlist>

  </listitem>

  <listitem>
    <para>In chroots, Nix now sets up a <filename>/dev</filename>
    containing only a minimal set of devices (such as
    <filename>/dev/null</filename>). Note that it only does this if
    you <emphasis>don’t</emphasis> have <filename>/dev</filename>
    listed in your <option>build-chroot-dirs</option> setting;
    otherwise, it will bind-mount the <literal>/dev</literal> from
    outside the chroot.</para>

    <para>Similarly, if you don’t have <filename>/dev/pts</filename> listed
    in <option>build-chroot-dirs</option>, Nix will mount a private
    <literal>devpts</literal> filesystem on the chroot’s
    <filename>/dev/pts</filename>.</para>

  </listitem>

  <listitem>
    <para>New built-in function: <function>builtins.toJSON</function>,
    which returns a JSON representation of a value.</para>
  </listitem>

  <listitem>
    <para><command>nix-env -q</command> has a new flag
    <option>--json</option> to print a JSON representation of the
    installed or available packages.</para>
  </listitem>

  <listitem>
    <para><command>nix-env</command> now supports meta attributes with
    more complex values, such as attribute sets.</para>
  </listitem>

  <listitem>
    <para>The <option>-A</option> flag now allows attribute names with
    dots in them, e.g.

<screen>
$ nix-instantiate --eval '&lt;nixos>' -A 'config.systemd.units."nscd.service".text'
</screen>

    </para>
  </listitem>

  <listitem>
    <para>The <option>--max-freed</option> option to
    <command>nix-store --gc</command> now accepts a unit
    specifier. For example, <literal>nix-store --gc --max-freed
    1G</literal> will free up to 1 gigabyte of disk space.</para>
  </listitem>

  <listitem>
    <para><command>nix-collect-garbage</command> has a new flag
    <option>--delete-older-than</option>
    <replaceable>N</replaceable><literal>d</literal>, which deletes
    all user environment generations older than
    <replaceable>N</replaceable> days.  Likewise, <command>nix-env
    --delete-generations</command> accepts a
    <replaceable>N</replaceable><literal>d</literal> age limit.</para>
  </listitem>

  <listitem>
    <para>Nix now heuristically detects whether a build failure was
    due to a disk-full condition. In that case, the build is not
    flagged as “permanently failed”. This is mostly useful for Hydra,
    which needs to distinguish between permanent and transient build
    failures.</para>
  </listitem>

  <listitem>
    <para>There is a new symbol <literal>__curPos</literal> that
    expands to an attribute set containing its file name and line and
    column numbers, e.g. <literal>{ file = "foo.nix"; line = 10;
    column = 5; }</literal>.  There also is a new builtin function,
    <varname>unsafeGetAttrPos</varname>, that returns the position of
    an attribute.  This is used by Nixpkgs to provide location
    information in error messages, e.g.

<screen>
$ nix-build '&lt;nixpkgs>' -A libreoffice --argstr system x86_64-darwin
error: the package ‘libreoffice-4.0.5.2’ in ‘.../applications/office/libreoffice/default.nix:263’
  is not supported on ‘x86_64-darwin’
</screen>

    </para>
  </listitem>

  <listitem>
    <para>The garbage collector is now more concurrent with other Nix
    processes because it releases certain locks earlier.</para>
  </listitem>

  <listitem>
    <para>The binary tarball installer has been improved.  You can now
    install Nix by running:

<screen>
$ bash &lt;(curl https://nixos.org/nix/install)
</screen>

    </para>
  </listitem>

  <listitem>
    <para>More evaluation errors include position information. For
    instance, selecting a missing attribute will print something like

<screen>
error: attribute `nixUnstabl' missing, at /etc/nixos/configurations/misc/eelco/mandark.nix:216:15
</screen>

    </para>
  </listitem>

  <listitem>
    <para>The command <command>nix-setuid-helper</command> is
    gone.</para>
  </listitem>

  <listitem>
    <para>Nix no longer uses Automake, but instead has a
    non-recursive, GNU Make-based build system.</para>
  </listitem>

  <listitem>
    <para>All installed libraries now have the prefix
    <literal>libnix</literal>.  In particular, this gets rid of
    <literal>libutil</literal>, which could clash with libraries with
    the same name from other packages.</para>
  </listitem>

  <listitem>
    <para>Nix now requires a compiler that supports C++11.</para>
  </listitem>

</itemizedlist>

<para>This release has contributions from Danny Wilson, Domen Kožar,
Eelco Dolstra, Ian-Woo Kim, Ludovic Courtès, Maxim Ivanov, Petr
Rockai, Ricardo M. Correia and Shea Levy.</para>

</section>