about summary refs log tree commit diff
path: root/doc/manual/release-notes/rl-1.2.xml
blob: 72d164f00c01c19360e0045cf62e850eeafd1e83 (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
<chapter 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.2">

<title>Release 1.2 (December 6, 2012)</title>

<para>This release has the following improvements and changes:</para>

<itemizedlist>

  <listitem>
    <para>Nix has a new binary substituter mechanism: the
    <emphasis>binary cache</emphasis>.  A binary cache contains
    pre-built binaries of Nix packages.  Whenever Nix wants to build a
    missing Nix store path, it will check a set of binary caches to
    see if any of them has a pre-built binary of that path.  The
    configuration setting <option>binary-caches</option> contains a
    list of URLs of binary caches.  For instance, doing
<screen>
$ nix-env -i thunderbird --option binary-caches http://cache.nixos.org
</screen>
    will install Thunderbird and its dependencies, using the available
    pre-built binaries in <uri>http://cache.nixos.org</uri>.
    The main advantage over the old “manifest”-based method of getting
    pre-built binaries is that you don’t have to worry about your
    manifest being in sync with the Nix expressions you’re installing
    from; i.e., you don’t need to run <command>nix-pull</command> to
    update your manifest.  It’s also more scalable because you don’t
    need to redownload a giant manifest file every time.
    </para>

    <para>A Nix channel can provide a binary cache URL that will be
    used automatically if you subscribe to that channel.  If you use
    the Nixpkgs or NixOS channels
    (<uri>http://nixos.org/channels</uri>) you automatically get the
    cache <uri>http://cache.nixos.org</uri>.</para>

    <para>Binary caches are created using <command>nix-push</command>.
    For details on the operation and format of binary caches, see the
    <command>nix-push</command> manpage.  More details are provided in
    <link xlink:href="http://lists.science.uu.nl/pipermail/nix-dev/2012-September/009826.html">this
    nix-dev posting</link>.</para>
  </listitem>

  <listitem>
    <para>Multiple output support should now be usable.  A derivation
    can declare that it wants to produce multiple store paths by
    saying something like
<programlisting>
outputs = [ "lib" "headers" "doc" ];
</programlisting>
    This will cause Nix to pass the intended store path of each output
    to the builder through the environment variables
    <literal>lib</literal>, <literal>headers</literal> and
    <literal>doc</literal>.  Other packages can refer to a specific
    output by referring to
    <literal><replaceable>pkg</replaceable>.<replaceable>output</replaceable></literal>,
    e.g.
<programlisting>
buildInputs = [ pkg.lib pkg.headers ];
</programlisting>
    If you install a package with multiple outputs using
    <command>nix-env</command>, each output path will be symlinked
    into the user environment.</para>
  </listitem>

  <listitem>
    <para>Dashes are now valid as part of identifiers and attribute
    names.</para>
  </listitem>

  <listitem>
    <para>The new operation <command>nix-store --repair-path</command>
    allows corrupted or missing store paths to be repaired by
    redownloading them.  <command>nix-store --verify --check-contents
    --repair</command> will scan and repair all paths in the Nix
    store.  Similarly, <command>nix-env</command>,
    <command>nix-build</command>, <command>nix-instantiate</command>
    and <command>nix-store --realise</command> have a
    <option>--repair</option> flag to detect and fix bad paths by
    rebuilding or redownloading them.</para>
  </listitem>

  <listitem>
    <para>Nix no longer sets the immutable bit on files in the Nix
    store.  Instead, the recommended way to guard the Nix store
    against accidental modification on Linux is to make it a read-only
    bind mount, like this:

<screen>
$ mount --bind /nix/store /nix/store
$ mount -o remount,ro,bind /nix/store
</screen>

    Nix will automatically make <filename>/nix/store</filename>
    writable as needed (using a private mount namespace) to allow
    modifications.</para>
  </listitem>

  <listitem>
    <para>Store optimisation (replacing identical files in the store
    with hard links) can now be done automatically every time a path
    is added to the store.  This is enabled by setting the
    configuration option <literal>auto-optimise-store</literal> to
    <literal>true</literal> (disabled by default).</para>
  </listitem>

  <listitem>
    <para>Nix now supports <command>xz</command> compression for NARs
    in addition to <command>bzip2</command>.  It compresses about 30%
    better on typical archives and decompresses about twice as
    fast.</para>
  </listitem>

  <listitem>
    <para>Basic Nix expression evaluation profiling: setting the
    environment variable <envar>NIX_COUNT_CALLS</envar> to
    <literal>1</literal> will cause Nix to print how many times each
    primop or function was executed.</para>
  </listitem>

  <listitem>
    <para>New primops: <varname>concatLists</varname>,
    <varname>elem</varname>, <varname>elemAt</varname> and
    <varname>filter</varname>.</para>
  </listitem>

  <listitem>
    <para>The command <command>nix-copy-closure</command> has a new
    flag <option>--use-substitutes</option> (<option>-s</option>) to
    download missing paths on the target machine using the substitute
    mechanism.</para>
  </listitem>

  <listitem>
    <para>The command <command>nix-worker</command> has been renamed
    to <command>nix-daemon</command>.  Support for running the Nix
    worker in “slave” mode has been removed.</para>
  </listitem>

  <listitem>
    <para>The <option>--help</option> flag of every Nix command now
    invokes <command>man</command>.</para>
  </listitem>

  <listitem>
    <para>Chroot builds are now supported on systemd machines.</para>
  </listitem>

</itemizedlist>

<para>This release has contributions from Eelco Dolstra, Florian
Friesdorf, Mats Erik Andersson and Shea Levy.</para>

</chapter>