<replaceable> -> <emphasis>
Pandoc doesn't know <replaceable> so let's force it to be rendered as italics.
This commit is contained in:
parent
ee05108472
commit
802150f987
|
@ -86,7 +86,7 @@ To leave a field at its default, set it to <literal>-</literal>.
|
|||
<orderedlist>
|
||||
|
||||
<listitem><para>The URI of the remote store in the format
|
||||
<literal>ssh://[<replaceable>username</replaceable>@]<replaceable>hostname</replaceable></literal>,
|
||||
<literal>ssh://[<emphasis>username</emphasis>@]<emphasis>hostname</emphasis></literal>,
|
||||
e.g. <literal>ssh://nix@mac</literal> or
|
||||
<literal>ssh://mac</literal>. For backward compatibility,
|
||||
<literal>ssh://</literal> may be omitted. The hostname may be an
|
||||
|
@ -171,7 +171,7 @@ builders = ssh://mac x86_64-darwin ; ssh://beastie x86_64-freebsd
|
|||
|
||||
Finally, remote builders can be configured in a separate configuration
|
||||
file included in <option>builders</option> via the syntax
|
||||
<literal>@<replaceable>file</replaceable></literal>. For example,
|
||||
<literal>@<emphasis>file</emphasis></literal>. For example,
|
||||
|
||||
<programlisting>
|
||||
builders = @/etc/nix/machines
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<listitem>
|
||||
<para>
|
||||
The system-wide configuration file
|
||||
<filename><replaceable>sysconfdir</replaceable>/nix/nix.conf</filename>
|
||||
<filename><emphasis>sysconfdir</emphasis>/nix/nix.conf</filename>
|
||||
(i.e. <filename>/etc/nix/nix.conf</filename> on most systems),
|
||||
or <filename>$NIX_CONF_DIR/nix.conf</filename> if
|
||||
<literal>NIX_CONF_DIR</literal> is set. Values loaded in this
|
||||
|
@ -52,11 +52,11 @@
|
|||
</itemizedlist>
|
||||
|
||||
<para>The configuration files consist of
|
||||
<literal><replaceable>name</replaceable> =
|
||||
<replaceable>value</replaceable></literal> pairs, one per line. Other
|
||||
<literal><emphasis>name</emphasis> =
|
||||
<emphasis>value</emphasis></literal> pairs, one per line. Other
|
||||
files can be included with a line like <literal>include
|
||||
<replaceable>path</replaceable></literal>, where
|
||||
<replaceable>path</replaceable> is interpreted relative to the current
|
||||
<emphasis>path</emphasis></literal>, where
|
||||
<emphasis>path</emphasis> is interpreted relative to the current
|
||||
conf file and a missing file is an error unless
|
||||
<literal>!include</literal> is used instead.
|
||||
Comments start with a <literal>#</literal> character. Here is an
|
||||
|
@ -244,7 +244,7 @@ false</literal>.</para>
|
|||
instance, in Nixpkgs, if the derivation attribute
|
||||
<varname>enableParallelBuilding</varname> is set to
|
||||
<literal>true</literal>, the builder passes the
|
||||
<option>-j<replaceable>N</replaceable></option> flag to GNU Make.
|
||||
<option>-j<emphasis>N</emphasis></option> flag to GNU Make.
|
||||
It can be overridden using the <option
|
||||
linkend='opt-cores'>--cores</option> command line switch and
|
||||
defaults to <literal>1</literal>. The value <literal>0</literal>
|
||||
|
@ -383,10 +383,10 @@ false</literal>.</para>
|
|||
<function>builtins.fetchurl</function> to obtain files by
|
||||
hash. The default is
|
||||
<literal>http://tarballs.nixos.org/</literal>. Given a hash type
|
||||
<replaceable>ht</replaceable> and a base-16 hash
|
||||
<replaceable>h</replaceable>, Nix will try to download the file
|
||||
<emphasis>ht</emphasis> and a base-16 hash
|
||||
<emphasis>h</emphasis>, Nix will try to download the file
|
||||
from
|
||||
<literal>hashed-mirror/<replaceable>ht</replaceable>/<replaceable>h</replaceable></literal>.
|
||||
<literal>hashed-mirror/<emphasis>ht</emphasis>/<emphasis>h</emphasis></literal>.
|
||||
This allows files to be downloaded even if they have disappeared
|
||||
from their original URI. For example, given the default mirror
|
||||
<literal>http://tarballs.nixos.org/</literal>, when building the derivation
|
||||
|
@ -421,7 +421,7 @@ builtins.fetchurl {
|
|||
output and error of its builder) to the directory
|
||||
<filename>/nix/var/log/nix/drvs</filename>. The build log can be
|
||||
retrieved using the command <command>nix-store -l
|
||||
<replaceable>path</replaceable></command>.</para></listitem>
|
||||
<emphasis>path</emphasis></command>.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
|
@ -592,9 +592,9 @@ builtins.fetchurl {
|
|||
accounts in the following format:
|
||||
|
||||
<screen>
|
||||
machine <replaceable>my-machine</replaceable>
|
||||
login <replaceable>my-username</replaceable>
|
||||
password <replaceable>my-password</replaceable>
|
||||
machine <emphasis>my-machine</emphasis>
|
||||
login <emphasis>my-username</emphasis>
|
||||
password <emphasis>my-password</emphasis>
|
||||
</screen>
|
||||
|
||||
For the exact syntax, see <link
|
||||
|
@ -837,13 +837,13 @@ password <replaceable>my-password</replaceable>
|
|||
|
||||
<listitem><para>A list of paths bind-mounted into Nix sandbox
|
||||
environments. You can use the syntax
|
||||
<literal><replaceable>target</replaceable>=<replaceable>source</replaceable></literal>
|
||||
<literal><emphasis>target</emphasis>=<emphasis>source</emphasis></literal>
|
||||
to mount a path in a different location in the sandbox; for
|
||||
instance, <literal>/bin=/nix-bin</literal> will mount the path
|
||||
<literal>/nix-bin</literal> as <literal>/bin</literal> inside the
|
||||
sandbox. If <replaceable>source</replaceable> is followed by
|
||||
sandbox. If <emphasis>source</emphasis> is followed by
|
||||
<literal>?</literal>, then it is not an error if
|
||||
<replaceable>source</replaceable> does not exist; for example,
|
||||
<emphasis>source</emphasis> does not exist; for example,
|
||||
<literal>/dev/nvidiactl?</literal> specifies that
|
||||
<filename>/dev/nvidiactl</filename> will only be mounted in the
|
||||
sandbox if it exists in the host filesystem.</para>
|
||||
|
@ -1035,7 +1035,7 @@ function-trace exited /nix/store/.../example.nix:226:41 at 1565795253249941684
|
|||
<listitem><para>A list of URLs of substituters, separated by
|
||||
whitespace. These are not used by default, but can be enabled by
|
||||
users of the Nix daemon by specifying <literal>--option
|
||||
substituters <replaceable>urls</replaceable></literal> on the
|
||||
substituters <emphasis>urls</emphasis></literal> on the
|
||||
command line. Unprivileged users are only allowed to pass a
|
||||
subset of the URLs listed in <literal>substituters</literal> and
|
||||
<literal>trusted-substituters</literal>.</para></listitem>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
<para>A colon-separated list of directories used to look up Nix
|
||||
expressions enclosed in angle brackets (i.e.,
|
||||
<literal><<replaceable>path</replaceable>></literal>). For
|
||||
<literal><<emphasis>path</emphasis>></literal>). For
|
||||
instance, the value
|
||||
|
||||
<screen>
|
||||
|
@ -40,10 +40,10 @@
|
|||
nixpkgs=/home/eelco/Dev/nixpkgs-branch:/etc/nixos</screen>
|
||||
|
||||
will cause Nix to search for
|
||||
<literal><nixpkgs/<replaceable>path</replaceable>></literal> in
|
||||
<filename>/home/eelco/Dev/nixpkgs-branch/<replaceable>path</replaceable></filename>
|
||||
<literal><nixpkgs/<emphasis>path</emphasis>></literal> in
|
||||
<filename>/home/eelco/Dev/nixpkgs-branch/<emphasis>path</emphasis></filename>
|
||||
and
|
||||
<filename>/etc/nixos/nixpkgs/<replaceable>path</replaceable></filename>.</para>
|
||||
<filename>/etc/nixos/nixpkgs/<emphasis>path</emphasis></filename>.</para>
|
||||
|
||||
<para>If a path in the Nix search path starts with
|
||||
<literal>http://</literal> or <literal>https://</literal>, it is
|
||||
|
@ -105,7 +105,7 @@ $ mount -o bind /mnt/otherdisk/nix /nix</screen>
|
|||
<varlistentry><term><literal>NIX_STORE_DIR</literal></term>
|
||||
|
||||
<listitem><para>Overrides the location of the Nix store (default
|
||||
<filename><replaceable>prefix</replaceable>/store</filename>).</para></listitem>
|
||||
<filename><emphasis>prefix</emphasis>/store</filename>).</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
|
@ -114,7 +114,7 @@ $ mount -o bind /mnt/otherdisk/nix /nix</screen>
|
|||
|
||||
<listitem><para>Overrides the location of the Nix static data
|
||||
directory (default
|
||||
<filename><replaceable>prefix</replaceable>/share</filename>).</para></listitem>
|
||||
<filename><emphasis>prefix</emphasis>/share</filename>).</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
|
@ -122,7 +122,7 @@ $ mount -o bind /mnt/otherdisk/nix /nix</screen>
|
|||
<varlistentry><term><literal>NIX_LOG_DIR</literal></term>
|
||||
|
||||
<listitem><para>Overrides the location of the Nix log directory
|
||||
(default <filename><replaceable>prefix</replaceable>/var/log/nix</filename>).</para></listitem>
|
||||
(default <filename><emphasis>prefix</emphasis>/var/log/nix</filename>).</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
|
@ -130,7 +130,7 @@ $ mount -o bind /mnt/otherdisk/nix /nix</screen>
|
|||
<varlistentry><term><literal>NIX_STATE_DIR</literal></term>
|
||||
|
||||
<listitem><para>Overrides the location of the Nix state directory
|
||||
(default <filename><replaceable>prefix</replaceable>/var/nix</filename>).</para></listitem>
|
||||
(default <filename><emphasis>prefix</emphasis>/var/nix</filename>).</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
|
@ -139,7 +139,7 @@ $ mount -o bind /mnt/otherdisk/nix /nix</screen>
|
|||
|
||||
<listitem><para>Overrides the location of the system Nix configuration
|
||||
directory (default
|
||||
<filename><replaceable>prefix</replaceable>/etc/nix</filename>).</para></listitem>
|
||||
<filename><emphasis>prefix</emphasis>/etc/nix</filename>).</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
|
|
|
@ -20,14 +20,14 @@
|
|||
<cmdsynopsis>
|
||||
<command>nix-build</command>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="opt-common-syn.xml#xmlns(db=http://docbook.org/ns/docbook)xpointer(/db:nop/*)" />
|
||||
<arg><option>--arg</option> <replaceable>name</replaceable> <replaceable>value</replaceable></arg>
|
||||
<arg><option>--argstr</option> <replaceable>name</replaceable> <replaceable>value</replaceable></arg>
|
||||
<arg><option>--arg</option> <emphasis>name</emphasis> <emphasis>value</emphasis></arg>
|
||||
<arg><option>--argstr</option> <emphasis>name</emphasis> <emphasis>value</emphasis></arg>
|
||||
<arg>
|
||||
<group choice='req'>
|
||||
<arg choice='plain'><option>--attr</option></arg>
|
||||
<arg choice='plain'><option>-A</option></arg>
|
||||
</group>
|
||||
<replaceable>attrPath</replaceable>
|
||||
<emphasis>attrPath</emphasis>
|
||||
</arg>
|
||||
<arg><option>--no-out-link</option></arg>
|
||||
<arg><option>--dry-run</option></arg>
|
||||
|
@ -36,16 +36,16 @@
|
|||
<arg choice='plain'><option>--out-link</option></arg>
|
||||
<arg choice='plain'><option>-o</option></arg>
|
||||
</group>
|
||||
<replaceable>outlink</replaceable>
|
||||
<emphasis>outlink</emphasis>
|
||||
</arg>
|
||||
<arg choice='plain' rep='repeat'><replaceable>paths</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>paths</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsection><title>Description</title>
|
||||
|
||||
<para>The <command>nix-build</command> command builds the derivations
|
||||
described by the Nix expressions in <replaceable>paths</replaceable>.
|
||||
described by the Nix expressions in <emphasis>paths</emphasis>.
|
||||
If the build succeeds, it places a symlink to the result in the
|
||||
current directory. The symlink is called <filename>result</filename>.
|
||||
If there are multiple Nix expressions, or the Nix expressions evaluate
|
||||
|
@ -53,11 +53,11 @@ to multiple derivations, multiple sequentially numbered symlinks are
|
|||
created (<filename>result</filename>, <filename>result-2</filename>,
|
||||
and so on).</para>
|
||||
|
||||
<para>If no <replaceable>paths</replaceable> are specified, then
|
||||
<para>If no <emphasis>paths</emphasis> are specified, then
|
||||
<command>nix-build</command> will use <filename>default.nix</filename>
|
||||
in the current directory, if it exists.</para>
|
||||
|
||||
<para>If an element of <replaceable>paths</replaceable> starts with
|
||||
<para>If an element of <emphasis>paths</emphasis> starts with
|
||||
<literal>http://</literal> or <literal>https://</literal>, it is
|
||||
interpreted as the URL of a tarball that will be downloaded and
|
||||
unpacked to a temporary location. The tarball must include a single
|
||||
|
@ -104,11 +104,11 @@ also <xref linkend="sec-common-options" />.</phrase></para>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id='opt-out-link'><term><option>--out-link</option> /
|
||||
<option>-o</option> <replaceable>outlink</replaceable></term>
|
||||
<option>-o</option> <emphasis>outlink</emphasis></term>
|
||||
|
||||
<listitem><para>Change the name of the symlink to the output path
|
||||
created from <filename>result</filename> to
|
||||
<replaceable>outlink</replaceable>.</para></listitem>
|
||||
<emphasis>outlink</emphasis>.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
|
@ -131,7 +131,7 @@ store derivation is /nix/store/qybprl8sz2lc...-firefox-1.5.0.7.drv
|
|||
/nix/store/d18hyl92g30l...-firefox-1.5.0.7
|
||||
|
||||
$ ls -l result
|
||||
lrwxrwxrwx <replaceable>...</replaceable> result -> /nix/store/d18hyl92g30l...-firefox-1.5.0.7
|
||||
lrwxrwxrwx <emphasis>...</emphasis> result -> /nix/store/d18hyl92g30l...-firefox-1.5.0.7
|
||||
|
||||
$ ls ./result/bin/
|
||||
firefox firefox-config</screen>
|
||||
|
@ -143,7 +143,7 @@ You can also build all outputs:
|
|||
$ nix-build '<nixpkgs>' -A openssl.all
|
||||
</screen>
|
||||
This will create a symlink for each output named
|
||||
<filename>result-<replaceable>outputname</replaceable></filename>.
|
||||
<filename>result-<emphasis>outputname</emphasis></filename>.
|
||||
The suffix is omitted if the output name is <literal>out</literal>.
|
||||
So if <literal>openssl</literal> has outputs <literal>out</literal>,
|
||||
<literal>bin</literal> and <literal>man</literal>,
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
<cmdsynopsis>
|
||||
<command>nix-channel</command>
|
||||
<group choice='req'>
|
||||
<arg choice='plain'><option>--add</option> <replaceable>url</replaceable> <arg choice='opt'><replaceable>name</replaceable></arg></arg>
|
||||
<arg choice='plain'><option>--remove</option> <replaceable>name</replaceable></arg>
|
||||
<arg choice='plain'><option>--add</option> <emphasis>url</emphasis> <arg choice='opt'><emphasis>name</emphasis></arg></arg>
|
||||
<arg choice='plain'><option>--remove</option> <emphasis>name</emphasis></arg>
|
||||
<arg choice='plain'><option>--list</option></arg>
|
||||
<arg choice='plain'><option>--update</option> <arg rep='repeat'><replaceable>names</replaceable></arg></arg>
|
||||
<arg choice='plain'><option>--rollback</option> <arg choice='opt'><replaceable>generation</replaceable></arg></arg>
|
||||
<arg choice='plain'><option>--update</option> <arg rep='repeat'><emphasis>names</emphasis></arg></arg>
|
||||
<arg choice='plain'><option>--rollback</option> <arg choice='opt'><emphasis>generation</emphasis></arg></arg>
|
||||
</group>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
@ -44,22 +44,22 @@ xlink:href="https://nixos.org/channels" />.</para>
|
|||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry><term><option>--add</option> <replaceable>url</replaceable> [<replaceable>name</replaceable>]</term>
|
||||
<varlistentry><term><option>--add</option> <emphasis>url</emphasis> [<emphasis>name</emphasis>]</term>
|
||||
|
||||
<listitem><para>Adds a channel named
|
||||
<replaceable>name</replaceable> with URL
|
||||
<replaceable>url</replaceable> to the list of subscribed channels.
|
||||
If <replaceable>name</replaceable> is omitted, it defaults to the
|
||||
last component of <replaceable>url</replaceable>, with the
|
||||
<emphasis>name</emphasis> with URL
|
||||
<emphasis>url</emphasis> to the list of subscribed channels.
|
||||
If <emphasis>name</emphasis> is omitted, it defaults to the
|
||||
last component of <emphasis>url</emphasis>, with the
|
||||
suffixes <literal>-stable</literal> or
|
||||
<literal>-unstable</literal> removed.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><option>--remove</option> <replaceable>name</replaceable></term>
|
||||
<varlistentry><term><option>--remove</option> <emphasis>name</emphasis></term>
|
||||
|
||||
<listitem><para>Removes the channel named
|
||||
<replaceable>name</replaceable> from the list of subscribed
|
||||
<emphasis>name</emphasis> from the list of subscribed
|
||||
channels.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
@ -71,18 +71,18 @@ xlink:href="https://nixos.org/channels" />.</para>
|
|||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><option>--update</option> [<replaceable>names</replaceable>…]</term>
|
||||
<varlistentry><term><option>--update</option> [<emphasis>names</emphasis>…]</term>
|
||||
|
||||
<listitem><para>Downloads the Nix expressions of all subscribed
|
||||
channels (or only those included in
|
||||
<replaceable>names</replaceable> if specified) and makes them the
|
||||
<emphasis>names</emphasis> if specified) and makes them the
|
||||
default for <command>nix-env</command> operations (by symlinking
|
||||
them from the directory
|
||||
<filename>~/.nix-defexpr</filename>).</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><option>--rollback</option> [<replaceable>generation</replaceable>]</term>
|
||||
<varlistentry><term><option>--rollback</option> [<emphasis>generation</emphasis>]</term>
|
||||
|
||||
<listitem><para>Reverts the previous call to <command>nix-channel
|
||||
--update</command>. Optionally, you can specify a specific channel
|
||||
|
@ -130,7 +130,7 @@ $ nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
|
|||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry><term><filename>/nix/var/nix/profiles/per-user/<replaceable>username</replaceable>/channels</filename></term>
|
||||
<varlistentry><term><filename>/nix/var/nix/profiles/per-user/<emphasis>username</emphasis>/channels</filename></term>
|
||||
|
||||
<listitem><para><command>nix-channel</command> uses a
|
||||
<command>nix-env</command> profile to keep track of previous
|
||||
|
@ -145,7 +145,7 @@ $ nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
|
|||
<varlistentry><term><filename>~/.nix-defexpr/channels</filename></term>
|
||||
|
||||
<listitem><para>This is a symlink to
|
||||
<filename>/nix/var/nix/profiles/per-user/<replaceable>username</replaceable>/channels</filename>. It
|
||||
<filename>/nix/var/nix/profiles/per-user/<emphasis>username</emphasis>/channels</filename>. It
|
||||
ensures that <command>nix-env</command> can find your channels. In
|
||||
a multi-user installation, you may also have
|
||||
<filename>~/.nix-defexpr/channels_root</filename>, which links to
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
<command>nix-collect-garbage</command>
|
||||
<arg><option>--delete-old</option></arg>
|
||||
<arg><option>-d</option></arg>
|
||||
<arg><option>--delete-older-than</option> <replaceable>period</replaceable></arg>
|
||||
<arg><option>--max-freed</option> <replaceable>bytes</replaceable></arg>
|
||||
<arg><option>--delete-older-than</option> <emphasis>period</emphasis></arg>
|
||||
<arg><option>--max-freed</option> <emphasis>bytes</emphasis></arg>
|
||||
<arg><option>--dry-run</option></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
@ -39,7 +39,7 @@ which deletes all old generations of all profiles in
|
|||
<literal>nix-env --delete-generations old</literal> on all profiles
|
||||
(of course, this makes rollbacks to previous configurations
|
||||
impossible); and
|
||||
<option>--delete-older-than</option> <replaceable>period</replaceable>,
|
||||
<option>--delete-older-than</option> <emphasis>period</emphasis>,
|
||||
where period is a value such as <literal>30d</literal>, which deletes
|
||||
all generations older than the specified number of days in all profiles
|
||||
in <filename>/nix/var/nix/profiles</filename> (except for the generations
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
</group>
|
||||
<arg><option>-v</option></arg>
|
||||
<arg choice='plain'>
|
||||
<replaceable>user@</replaceable><replaceable>machine</replaceable>
|
||||
<emphasis>user@</emphasis><emphasis>machine</emphasis>
|
||||
</arg>
|
||||
<arg choice='plain'><replaceable>paths</replaceable></arg>
|
||||
<arg choice='plain'><emphasis>paths</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
|
@ -44,13 +44,13 @@
|
|||
|
||||
<para><command>nix-copy-closure</command> gives you an easy and
|
||||
efficient way to exchange software between machines. Given one or
|
||||
more Nix store <replaceable>paths</replaceable> on the local
|
||||
more Nix store <emphasis>paths</emphasis> on the local
|
||||
machine, <command>nix-copy-closure</command> computes the closure of
|
||||
those paths (i.e. all their dependencies in the Nix store), and copies
|
||||
all paths in the closure to the remote machine via the
|
||||
<command>ssh</command> (Secure Shell) command. With the
|
||||
<option>--from</option>, the direction is reversed:
|
||||
the closure of <replaceable>paths</replaceable> on a remote machine is
|
||||
the closure of <emphasis>paths</emphasis> on a remote machine is
|
||||
copied to the Nix store on the local machine.</para>
|
||||
|
||||
<para>This command is efficient because it only sends the store paths
|
||||
|
@ -73,8 +73,8 @@ those paths. If this bothers you, use
|
|||
<varlistentry><term><option>--to</option></term>
|
||||
|
||||
<listitem><para>Copy the closure of
|
||||
<replaceable>paths</replaceable> from the local Nix store to the
|
||||
Nix store on <replaceable>machine</replaceable>. This is the
|
||||
<emphasis>paths</emphasis> from the local Nix store to the
|
||||
Nix store on <emphasis>machine</emphasis>. This is the
|
||||
default.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
@ -82,8 +82,8 @@ those paths. If this bothers you, use
|
|||
<varlistentry><term><option>--from</option></term>
|
||||
|
||||
<listitem><para>Copy the closure of
|
||||
<replaceable>paths</replaceable> from the Nix store on
|
||||
<replaceable>machine</replaceable> to the local Nix
|
||||
<emphasis>paths</emphasis> from the Nix store on
|
||||
<emphasis>machine</emphasis> to the local Nix
|
||||
store.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
|
|
@ -20,30 +20,30 @@
|
|||
<cmdsynopsis>
|
||||
<command>nix-env</command>
|
||||
<xi:include href="opt-common-syn.xml#xmlns(db=http://docbook.org/ns/docbook)xpointer(/db:nop/*)" />
|
||||
<arg><option>--arg</option> <replaceable>name</replaceable> <replaceable>value</replaceable></arg>
|
||||
<arg><option>--argstr</option> <replaceable>name</replaceable> <replaceable>value</replaceable></arg>
|
||||
<arg><option>--arg</option> <emphasis>name</emphasis> <emphasis>value</emphasis></arg>
|
||||
<arg><option>--argstr</option> <emphasis>name</emphasis> <emphasis>value</emphasis></arg>
|
||||
<arg>
|
||||
<group choice='req'>
|
||||
<arg choice='plain'><option>--file</option></arg>
|
||||
<arg choice='plain'><option>-f</option></arg>
|
||||
</group>
|
||||
<replaceable>path</replaceable>
|
||||
<emphasis>path</emphasis>
|
||||
</arg>
|
||||
<arg>
|
||||
<group choice='req'>
|
||||
<arg choice='plain'><option>--profile</option></arg>
|
||||
<arg choice='plain'><option>-p</option></arg>
|
||||
</group>
|
||||
<replaceable>path</replaceable>
|
||||
<emphasis>path</emphasis>
|
||||
</arg>
|
||||
<arg>
|
||||
<arg choice='plain'><option>--system-filter</option></arg>
|
||||
<replaceable>system</replaceable>
|
||||
<emphasis>system</emphasis>
|
||||
</arg>
|
||||
<arg><option>--dry-run</option></arg>
|
||||
<arg choice='plain'><replaceable>operation</replaceable></arg>
|
||||
<arg rep='repeat'><replaceable>options</replaceable></arg>
|
||||
<arg rep='repeat'><replaceable>arguments</replaceable></arg>
|
||||
<arg choice='plain'><emphasis>operation</emphasis></arg>
|
||||
<arg rep='repeat'><emphasis>options</emphasis></arg>
|
||||
<arg rep='repeat'><emphasis>arguments</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
|
@ -146,7 +146,7 @@ also <xref linkend="sec-common-options" />.</phrase></para>
|
|||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry><term><option>--file</option> / <option>-f</option> <replaceable>path</replaceable></term>
|
||||
<varlistentry><term><option>--file</option> / <option>-f</option> <emphasis>path</emphasis></term>
|
||||
|
||||
<listitem><para>Specifies the Nix expression (designated below as
|
||||
the <emphasis>active Nix expression</emphasis>) used by the
|
||||
|
@ -165,7 +165,7 @@ also <xref linkend="sec-common-options" />.</phrase></para>
|
|||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><option>--profile</option> / <option>-p</option> <replaceable>path</replaceable></term>
|
||||
<varlistentry><term><option>--profile</option> / <option>-p</option> <emphasis>path</emphasis></term>
|
||||
|
||||
<listitem><para>Specifies the profile to be used by those
|
||||
operations that operate on a profile (designated below as the
|
||||
|
@ -194,12 +194,12 @@ also <xref linkend="sec-common-options" />.</phrase></para>
|
|||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><option>--system-filter</option> <replaceable>system</replaceable></term>
|
||||
<varlistentry><term><option>--system-filter</option> <emphasis>system</emphasis></term>
|
||||
|
||||
<listitem><para>By default, operations such as <option>--query
|
||||
--available</option> show derivations matching any platform. This
|
||||
option allows you to use derivations for the specified platform
|
||||
<replaceable>system</replaceable>.</para></listitem>
|
||||
<emphasis>system</emphasis>.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
|
@ -276,7 +276,7 @@ also <xref linkend="sec-common-options" />.</phrase></para>
|
|||
|
||||
<listitem><para>A symbolic link to the user's current profile. By
|
||||
default, this symlink points to
|
||||
<filename><replaceable>prefix</replaceable>/var/nix/profiles/default</filename>.
|
||||
<filename><emphasis>prefix</emphasis>/var/nix/profiles/default</filename>.
|
||||
The <literal>PATH</literal> environment variable should include
|
||||
<filename>~/.nix-profile/bin</filename> for the user environment
|
||||
to be visible to the user.</para></listitem>
|
||||
|
@ -310,7 +310,7 @@ also <xref linkend="sec-common-options" />.</phrase></para>
|
|||
<arg choice='plain'><option>--remove-all</option></arg>
|
||||
<arg choice='plain'><option>-r</option></arg>
|
||||
</group>
|
||||
<arg choice='plain' rep='repeat'><replaceable>args</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>args</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
</refsection>
|
||||
|
@ -320,13 +320,13 @@ also <xref linkend="sec-common-options" />.</phrase></para>
|
|||
|
||||
<para>The install operation creates a new user environment, based on
|
||||
the current generation of the active profile, to which a set of store
|
||||
paths described by <replaceable>args</replaceable> is added. The
|
||||
arguments <replaceable>args</replaceable> map to store paths in a
|
||||
paths described by <emphasis>args</emphasis> is added. The
|
||||
arguments <emphasis>args</emphasis> map to store paths in a
|
||||
number of possible ways:
|
||||
|
||||
<itemizedlist>
|
||||
|
||||
<listitem><para>By default, <replaceable>args</replaceable> is a set
|
||||
<listitem><para>By default, <emphasis>args</emphasis> is a set
|
||||
of derivation names denoting derivations in the active Nix
|
||||
expression. These are realised, and the resulting output paths are
|
||||
installed. Currently installed derivations with a name equal to the
|
||||
|
@ -335,7 +335,7 @@ number of possible ways:
|
|||
specified.</para>
|
||||
|
||||
<para>If there are multiple derivations matching a name in
|
||||
<replaceable>args</replaceable> that have the same name (e.g.,
|
||||
<emphasis>args</emphasis> that have the same name (e.g.,
|
||||
<literal>gcc-3.3.6</literal> and <literal>gcc-4.1.1</literal>), then
|
||||
the derivation with the highest <emphasis>priority</emphasis> is
|
||||
used. A derivation can define a priority by declaring the
|
||||
|
@ -362,14 +362,14 @@ number of possible ways:
|
|||
packages, use <literal>nix-env -qaP</literal>.</para></listitem>
|
||||
|
||||
<listitem><para>If <option>--from-profile</option>
|
||||
<replaceable>path</replaceable> is given,
|
||||
<replaceable>args</replaceable> is a set of names denoting installed
|
||||
store paths in the profile <replaceable>path</replaceable>. This is
|
||||
<emphasis>path</emphasis> is given,
|
||||
<emphasis>args</emphasis> is a set of names denoting installed
|
||||
store paths in the profile <emphasis>path</emphasis>. This is
|
||||
an easy way to copy user environment elements from one profile to
|
||||
another.</para></listitem>
|
||||
|
||||
<listitem><para>If <option>--from-expression</option> is given,
|
||||
<replaceable>args</replaceable> are Nix <link
|
||||
<emphasis>args</emphasis> are Nix <link
|
||||
linkend="ss-functions">functions</link> that are called with the
|
||||
active Nix expression as their single argument. The derivations
|
||||
returned by those function calls are installed. This allows
|
||||
|
@ -377,12 +377,12 @@ number of possible ways:
|
|||
if there are multiple derivations with the same
|
||||
name.</para></listitem>
|
||||
|
||||
<listitem><para>If <replaceable>args</replaceable> are store
|
||||
<listitem><para>If <emphasis>args</emphasis> are store
|
||||
derivations, then these are <link
|
||||
linkend="rsec-nix-store-realise">realised</link>, and the resulting
|
||||
output paths are installed.</para></listitem>
|
||||
|
||||
<listitem><para>If <replaceable>args</replaceable> are store paths
|
||||
<listitem><para>If <emphasis>args</emphasis> are store paths
|
||||
that are not store derivations, then these are <link
|
||||
linkend="rsec-nix-store-realise">realised</link> and
|
||||
installed.</para></listitem>
|
||||
|
@ -518,7 +518,7 @@ $ nix-env -f '<nixpkgs>' -iA hello --dry-run
|
|||
installing ‘hello-2.10’
|
||||
this path will be fetched (0.04 MiB download, 0.19 MiB unpacked):
|
||||
/nix/store/wkhdf9jinag5750mqlax6z2zbwhqb76n-hello-2.10
|
||||
<replaceable>...</replaceable></screen>
|
||||
<emphasis>...</emphasis></screen>
|
||||
|
||||
</para>
|
||||
|
||||
|
@ -556,7 +556,7 @@ $ nix-env -f https://github.com/NixOS/nixpkgs/archive/nixos-14.12.tar.gz -iA fir
|
|||
<arg choice='plain'><option>--eq</option></arg>
|
||||
<arg choice='plain'><option>--always</option></arg>
|
||||
</group>
|
||||
<arg choice='plain' rep='repeat'><replaceable>args</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>args</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
</refsection>
|
||||
|
@ -566,15 +566,15 @@ $ nix-env -f https://github.com/NixOS/nixpkgs/archive/nixos-14.12.tar.gz -iA fir
|
|||
<para>The upgrade operation creates a new user environment, based on
|
||||
the current generation of the active profile, in which all store paths
|
||||
are replaced for which there are newer versions in the set of paths
|
||||
described by <replaceable>args</replaceable>. Paths for which there
|
||||
described by <emphasis>args</emphasis>. Paths for which there
|
||||
are no newer versions are left untouched; this is not an error. It is
|
||||
also not an error if an element of <replaceable>args</replaceable>
|
||||
also not an error if an element of <emphasis>args</emphasis>
|
||||
matches no installed derivations.</para>
|
||||
|
||||
<para>For a description of how <replaceable>args</replaceable> is
|
||||
<para>For a description of how <emphasis>args</emphasis> is
|
||||
mapped to a set of store paths, see <link
|
||||
linkend="rsec-nix-env-install"><option>--install</option></link>. If
|
||||
<replaceable>args</replaceable> describes multiple store paths with
|
||||
<emphasis>args</emphasis> describes multiple store paths with
|
||||
the same symbolic name, only the one with the highest version is
|
||||
installed.</para>
|
||||
|
||||
|
@ -711,7 +711,7 @@ lexicographically (i.e., using case-sensitive string comparison).</para>
|
|||
<arg choice='plain'><option>--uninstall</option></arg>
|
||||
<arg choice='plain'><option>-e</option></arg>
|
||||
</group>
|
||||
<arg choice='plain' rep='repeat'><replaceable>drvnames</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>drvnames</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsection>
|
||||
|
||||
|
@ -720,7 +720,7 @@ lexicographically (i.e., using case-sensitive string comparison).</para>
|
|||
<para>The uninstall operation creates a new user environment, based on
|
||||
the current generation of the active profile, from which the store
|
||||
paths designated by the symbolic names
|
||||
<replaceable>names</replaceable> are removed.</para>
|
||||
<emphasis>names</emphasis> are removed.</para>
|
||||
|
||||
</refsection>
|
||||
|
||||
|
@ -745,7 +745,7 @@ $ nix-env -e '.*' <lineannotation>(remove everything)</lineannotation></screen>
|
|||
<cmdsynopsis>
|
||||
<command>nix-env</command>
|
||||
<arg choice='plain'><option>--set</option></arg>
|
||||
<arg choice='plain'><replaceable>drvname</replaceable></arg>
|
||||
<arg choice='plain'><emphasis>drvname</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsection>
|
||||
|
||||
|
@ -783,9 +783,9 @@ $ nix-env -p /nix/var/nix/profiles/browser --set firefox</screen>
|
|||
<cmdsynopsis>
|
||||
<command>nix-env</command>
|
||||
<arg choice='plain'><option>--set-flag</option></arg>
|
||||
<arg choice='plain'><replaceable>name</replaceable></arg>
|
||||
<arg choice='plain'><replaceable>value</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><replaceable>drvnames</replaceable></arg>
|
||||
<arg choice='plain'><emphasis>name</emphasis></arg>
|
||||
<arg choice='plain'><emphasis>value</emphasis></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>drvnames</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsection>
|
||||
|
||||
|
@ -848,8 +848,8 @@ firefox-2.0.0.9 <lineannotation>(the current one)</lineannotation>
|
|||
$ nix-env --preserve-installed -i firefox-2.0.0.11
|
||||
installing `firefox-2.0.0.11'
|
||||
building path(s) `/nix/store/myy0y59q3ig70dgq37jqwg1j0rsapzsl-user-environment'
|
||||
collision between `/nix/store/<replaceable>...</replaceable>-firefox-2.0.0.11/bin/firefox'
|
||||
and `/nix/store/<replaceable>...</replaceable>-firefox-2.0.0.9/bin/firefox'.
|
||||
collision between `/nix/store/<emphasis>...</emphasis>-firefox-2.0.0.11/bin/firefox'
|
||||
and `/nix/store/<emphasis>...</emphasis>-firefox-2.0.0.9/bin/firefox'.
|
||||
<lineannotation>(i.e., can’t have two active at the same time)</lineannotation>
|
||||
|
||||
$ nix-env --set-flag active false firefox
|
||||
|
@ -940,12 +940,12 @@ $ nix-env --set-flag priority 10 gcc</screen>
|
|||
<arg choice='plain'><option>--attr</option></arg>
|
||||
<arg choice='plain'><option>-A</option></arg>
|
||||
</group>
|
||||
<replaceable>attribute-path</replaceable>
|
||||
<emphasis>attribute-path</emphasis>
|
||||
</arg>
|
||||
|
||||
<sbr />
|
||||
|
||||
<arg choice='plain' rep='repeat'><replaceable>names</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>names</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
</refsection>
|
||||
|
@ -959,7 +959,7 @@ profile (<option>--installed</option>), or the derivations that are
|
|||
available for installation in the active Nix expression
|
||||
(<option>--available</option>). It only prints information about
|
||||
derivations whose symbolic name matches one of
|
||||
<replaceable>names</replaceable>.</para>
|
||||
<emphasis>names</emphasis>.</para>
|
||||
|
||||
<para>The derivations are sorted by their <literal>name</literal>
|
||||
attributes.</para>
|
||||
|
@ -1086,21 +1086,21 @@ user environment elements, etc. -->
|
|||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry><term><literal><</literal> <replaceable>version</replaceable></term>
|
||||
<varlistentry><term><literal><</literal> <emphasis>version</emphasis></term>
|
||||
|
||||
<listitem><para>A newer version of the package is available
|
||||
or installed.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><literal>=</literal> <replaceable>version</replaceable></term>
|
||||
<varlistentry><term><literal>=</literal> <emphasis>version</emphasis></term>
|
||||
|
||||
<listitem><para>At most the same version of the package is
|
||||
available or installed.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><literal>></literal> <replaceable>version</replaceable></term>
|
||||
<varlistentry><term><literal>></literal> <emphasis>version</emphasis></term>
|
||||
|
||||
<listitem><para>Only older versions of the package are
|
||||
available or installed.</para></listitem>
|
||||
|
@ -1174,7 +1174,7 @@ docbook-xml-4.2
|
|||
firefox-1.0.4
|
||||
MPlayer-1.0pre7
|
||||
ORBit2-2.8.3
|
||||
<replaceable>…</replaceable>
|
||||
<emphasis>…</emphasis>
|
||||
</screen>
|
||||
|
||||
</para>
|
||||
|
@ -1187,7 +1187,7 @@ firefox-1.0.7
|
|||
GConf-2.4.0.1
|
||||
MPlayer-1.0pre7
|
||||
ORBit2-2.8.3
|
||||
<replaceable>…</replaceable>
|
||||
<emphasis>…</emphasis>
|
||||
</screen>
|
||||
|
||||
</para>
|
||||
|
@ -1200,7 +1200,7 @@ $ nix-env -qas
|
|||
--S GConf-2.4.0.1 <lineannotation>(not present, but there is a substitute for fast installation)</lineannotation>
|
||||
--S MPlayer-1.0pre3 <lineannotation>(i.e., this is not the installed MPlayer, even though the version is the same!)</lineannotation>
|
||||
IP- ORBit2-2.8.3 <lineannotation>(installed and by definition present)</lineannotation>
|
||||
<replaceable>…</replaceable>
|
||||
<emphasis>…</emphasis>
|
||||
</screen>
|
||||
|
||||
</para>
|
||||
|
@ -1218,11 +1218,11 @@ foo-1.2.3
|
|||
|
||||
<screen>
|
||||
$ nix-env -qc
|
||||
<replaceable>...</replaceable>
|
||||
<emphasis>...</emphasis>
|
||||
acrobat-reader-7.0 - ? <lineannotation>(package is not available at all)</lineannotation>
|
||||
autoconf-2.59 = 2.59 <lineannotation>(same version)</lineannotation>
|
||||
firefox-1.0.4 < 1.0.7 <lineannotation>(a more recent version is available)</lineannotation>
|
||||
<replaceable>...</replaceable>
|
||||
<emphasis>...</emphasis>
|
||||
</screen>
|
||||
|
||||
</para>
|
||||
|
@ -1234,7 +1234,7 @@ $ nix-env -qa '.*zip.*'
|
|||
bzip2-1.0.6
|
||||
gzip-1.6
|
||||
zip-3.0
|
||||
<replaceable>…</replaceable>
|
||||
<emphasis>…</emphasis>
|
||||
</screen>
|
||||
|
||||
</para>
|
||||
|
@ -1248,7 +1248,7 @@ chromium-37.0.2062.94
|
|||
chromium-beta-38.0.2125.24
|
||||
firefox-32.0.3
|
||||
firefox-with-plugins-13.0.1
|
||||
<replaceable>…</replaceable>
|
||||
<emphasis>…</emphasis>
|
||||
</screen>
|
||||
|
||||
</para>
|
||||
|
@ -1280,7 +1280,7 @@ $ nix-env -f https://github.com/NixOS/nixpkgs/archive/master.tar.gz -qa
|
|||
<arg choice='plain'><option>--switch-profile</option></arg>
|
||||
<arg choice='plain'><option>-S</option></arg>
|
||||
</group>
|
||||
<arg choice='req'><replaceable>path</replaceable></arg>
|
||||
<arg choice='req'><emphasis>path</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
</refsection>
|
||||
|
@ -1288,10 +1288,10 @@ $ nix-env -f https://github.com/NixOS/nixpkgs/archive/master.tar.gz -qa
|
|||
|
||||
<refsection><title>Description</title>
|
||||
|
||||
<para>This operation makes <replaceable>path</replaceable> the current
|
||||
<para>This operation makes <emphasis>path</emphasis> the current
|
||||
profile for the user. That is, the symlink
|
||||
<filename>~/.nix-profile</filename> is made to point to
|
||||
<replaceable>path</replaceable>.</para>
|
||||
<emphasis>path</emphasis>.</para>
|
||||
|
||||
</refsection>
|
||||
|
||||
|
@ -1355,7 +1355,7 @@ $ nix-env --list-generations
|
|||
<cmdsynopsis>
|
||||
<command>nix-env</command>
|
||||
<arg choice='plain'><option>--delete-generations</option></arg>
|
||||
<arg choice='plain' rep='repeat'><replaceable>generations</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>generations</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
</refsection>
|
||||
|
@ -1407,7 +1407,7 @@ $ nix-env -p other_profile --delete-generations old</screen>
|
|||
<arg choice='plain'><option>--switch-generation</option></arg>
|
||||
<arg choice='plain'><option>-G</option></arg>
|
||||
</group>
|
||||
<arg choice='req'><replaceable>generation</replaceable></arg>
|
||||
<arg choice='req'><emphasis>generation</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
</refsection>
|
||||
|
@ -1416,13 +1416,13 @@ $ nix-env -p other_profile --delete-generations old</screen>
|
|||
<refsection><title>Description</title>
|
||||
|
||||
<para>This operation makes generation number
|
||||
<replaceable>generation</replaceable> the current generation of the
|
||||
<emphasis>generation</emphasis> the current generation of the
|
||||
active profile. That is, if the
|
||||
<filename><replaceable>profile</replaceable></filename> is the path to
|
||||
<filename><emphasis>profile</emphasis></filename> is the path to
|
||||
the active profile, then the symlink
|
||||
<filename><replaceable>profile</replaceable></filename> is made to
|
||||
<filename><emphasis>profile</emphasis></filename> is made to
|
||||
point to
|
||||
<filename><replaceable>profile</replaceable>-<replaceable>generation</replaceable>-link</filename>,
|
||||
<filename><emphasis>profile</emphasis>-<emphasis>generation</emphasis>-link</filename>,
|
||||
which is in turn a symlink to the actual user environment in the Nix
|
||||
store.</para>
|
||||
|
||||
|
|
|
@ -22,18 +22,18 @@
|
|||
<arg><option>--flat</option></arg>
|
||||
<arg><option>--base32</option></arg>
|
||||
<arg><option>--truncate</option></arg>
|
||||
<arg><option>--type</option> <replaceable>hashAlgo</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><replaceable>path</replaceable></arg>
|
||||
<arg><option>--type</option> <emphasis>hashAlgo</emphasis></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>path</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
<cmdsynopsis>
|
||||
<command>nix-hash</command>
|
||||
<arg choice='plain'><option>--to-base16</option></arg>
|
||||
<arg choice='plain' rep='repeat'><replaceable>hash</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>hash</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
<cmdsynopsis>
|
||||
<command>nix-hash</command>
|
||||
<arg choice='plain'><option>--to-base32</option></arg>
|
||||
<arg choice='plain' rep='repeat'><replaceable>hash</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>hash</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
|||
|
||||
<para>The command <command>nix-hash</command> computes the
|
||||
cryptographic hash of the contents of each
|
||||
<replaceable>path</replaceable> and prints it on standard output. By
|
||||
<emphasis>path</emphasis> and prints it on standard output. By
|
||||
default, it computes an MD5 hash, but other hash algorithms are
|
||||
available as well. The hash is printed in hexadecimal. To generate
|
||||
the same hash as <command>nix-prefetch-url</command> you have to
|
||||
|
@ -54,9 +54,9 @@ allows directories and symlinks to be hashed as well as regular files.
|
|||
The dump is in the <emphasis>NAR format</emphasis> produced by <link
|
||||
linkend="refsec-nix-store-dump"><command>nix-store</command>
|
||||
<option>--dump</option></link>. Thus, <literal>nix-hash
|
||||
<replaceable>path</replaceable></literal> yields the same
|
||||
<emphasis>path</emphasis></literal> yields the same
|
||||
cryptographic hash as <literal>nix-store --dump
|
||||
<replaceable>path</replaceable> | md5sum</literal>.</para>
|
||||
<emphasis>path</emphasis> | md5sum</literal>.</para>
|
||||
|
||||
</refsection>
|
||||
|
||||
|
@ -68,9 +68,9 @@ cryptographic hash as <literal>nix-store --dump
|
|||
<varlistentry><term><option>--flat</option></term>
|
||||
|
||||
<listitem><para>Print the cryptographic hash of the contents of
|
||||
each regular file <replaceable>path</replaceable>. That is, do
|
||||
each regular file <emphasis>path</emphasis>. That is, do
|
||||
not compute the hash over the dump of
|
||||
<replaceable>path</replaceable>. The result is identical to that
|
||||
<emphasis>path</emphasis>. The result is identical to that
|
||||
produced by the GNU commands <command>md5sum</command> and
|
||||
<command>sha1sum</command>.</para></listitem>
|
||||
|
||||
|
@ -92,7 +92,7 @@ cryptographic hash as <literal>nix-store --dump
|
|||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><option>--type</option> <replaceable>hashAlgo</replaceable></term>
|
||||
<varlistentry><term><option>--type</option> <emphasis>hashAlgo</emphasis></term>
|
||||
|
||||
<listitem><para>Use the specified cryptographic hash algorithm,
|
||||
which can be one of <literal>md5</literal>,
|
||||
|
@ -104,7 +104,7 @@ cryptographic hash as <literal>nix-store --dump
|
|||
<varlistentry><term><option>--to-base16</option></term>
|
||||
|
||||
<listitem><para>Don’t hash anything, but convert the base-32 hash
|
||||
representation <replaceable>hash</replaceable> to
|
||||
representation <emphasis>hash</emphasis> to
|
||||
hexadecimal.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
@ -112,7 +112,7 @@ cryptographic hash as <literal>nix-store --dump
|
|||
<varlistentry><term><option>--to-base32</option></term>
|
||||
|
||||
<listitem><para>Don’t hash anything, but convert the hexadecimal
|
||||
hash representation <replaceable>hash</replaceable> to
|
||||
hash representation <emphasis>hash</emphasis> to
|
||||
base-32.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
|
|
@ -29,26 +29,26 @@
|
|||
</arg>
|
||||
</group>
|
||||
<arg><option>--read-write-mode</option></arg>
|
||||
<arg><option>--arg</option> <replaceable>name</replaceable> <replaceable>value</replaceable></arg>
|
||||
<arg><option>--arg</option> <emphasis>name</emphasis> <emphasis>value</emphasis></arg>
|
||||
<arg>
|
||||
<group choice='req'>
|
||||
<arg choice='plain'><option>--attr</option></arg>
|
||||
<arg choice='plain'><option>-A</option></arg>
|
||||
</group>
|
||||
<replaceable>attrPath</replaceable>
|
||||
<emphasis>attrPath</emphasis>
|
||||
</arg>
|
||||
<arg><option>--add-root</option> <replaceable>path</replaceable></arg>
|
||||
<arg><option>--add-root</option> <emphasis>path</emphasis></arg>
|
||||
<arg><option>--indirect</option></arg>
|
||||
<group>
|
||||
<arg choice='plain'><option>--expr</option></arg>
|
||||
<arg choice='plain'><option>-E</option></arg>
|
||||
</group>
|
||||
<arg choice='plain' rep='repeat'><replaceable>files</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>files</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
<cmdsynopsis>
|
||||
<command>nix-instantiate</command>
|
||||
<arg choice='plain'><option>--find-file</option></arg>
|
||||
<arg choice='plain' rep='repeat'><replaceable>files</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>files</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
|
@ -58,13 +58,13 @@
|
|||
<para>The command <command>nix-instantiate</command> generates <link
|
||||
linkend="gloss-derivation">store derivations</link> from (high-level)
|
||||
Nix expressions. It evaluates the Nix expressions in each of
|
||||
<replaceable>files</replaceable> (which defaults to
|
||||
<replaceable>./default.nix</replaceable>). Each top-level expression
|
||||
<emphasis>files</emphasis> (which defaults to
|
||||
<emphasis>./default.nix</emphasis>). Each top-level expression
|
||||
should evaluate to a derivation, a list of derivations, or a set of
|
||||
derivations. The paths of the resulting store derivations are printed
|
||||
on standard output.</para>
|
||||
|
||||
<para>If <replaceable>files</replaceable> is the character
|
||||
<para>If <emphasis>files</emphasis> is the character
|
||||
<literal>-</literal>, then a Nix expression will be read from standard
|
||||
input.</para>
|
||||
|
||||
|
@ -79,7 +79,7 @@ input.</para>
|
|||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--add-root</option> <replaceable>path</replaceable></term>
|
||||
<term><option>--add-root</option> <emphasis>path</emphasis></term>
|
||||
<term><option>--indirect</option></term>
|
||||
|
||||
<listitem><para>See the <link linkend="opt-add-root">corresponding
|
||||
|
@ -181,7 +181,7 @@ $ nix-instantiate test.nix <lineannotation>(instantiate)</lineannotation>
|
|||
/nix/store/cigxbmvy6dzix98dxxh9b6shg7ar5bvs-perl-BerkeleyDB-0.26.drv
|
||||
|
||||
$ nix-store -r $(nix-instantiate test.nix) <lineannotation>(build)</lineannotation>
|
||||
<replaceable>...</replaceable>
|
||||
<emphasis>...</emphasis>
|
||||
/nix/store/qhqk4n8ci095g3sdp93x7rgwyh9rdvgk-perl-BerkeleyDB-0.26 <lineannotation>(output path)</lineannotation>
|
||||
|
||||
$ ls -l /nix/store/qhqk4n8ci095g3sdp93x7rgwyh9rdvgk-perl-BerkeleyDB-0.26
|
||||
|
@ -226,28 +226,28 @@ $ nix-instantiate --eval --xml -E '1 + 2'
|
|||
|
||||
<screen>
|
||||
$ nix-instantiate --eval --xml -E 'rec { x = "foo"; y = x; }'
|
||||
<replaceable>...</replaceable><![CDATA[
|
||||
<emphasis>...</emphasis><![CDATA[
|
||||
<attr name="x">
|
||||
<string value="foo" />
|
||||
</attr>
|
||||
<attr name="y">
|
||||
<unevaluated />
|
||||
</attr>]]>
|
||||
<replaceable>...</replaceable></screen>
|
||||
<emphasis>...</emphasis></screen>
|
||||
|
||||
Note that <varname>y</varname> is left unevaluated (the XML
|
||||
representation doesn’t attempt to show non-normal forms).
|
||||
|
||||
<screen>
|
||||
$ nix-instantiate --eval --xml --strict -E 'rec { x = "foo"; y = x; }'
|
||||
<replaceable>...</replaceable><![CDATA[
|
||||
<emphasis>...</emphasis><![CDATA[
|
||||
<attr name="x">
|
||||
<string value="foo" />
|
||||
</attr>
|
||||
<attr name="y">
|
||||
<string value="foo" />
|
||||
</attr>]]>
|
||||
<replaceable>...</replaceable></screen>
|
||||
<emphasis>...</emphasis></screen>
|
||||
|
||||
</para>
|
||||
|
||||
|
|
|
@ -20,24 +20,24 @@
|
|||
<cmdsynopsis>
|
||||
<command>nix-prefetch-url</command>
|
||||
<arg><option>--version</option></arg>
|
||||
<arg><option>--type</option> <replaceable>hashAlgo</replaceable></arg>
|
||||
<arg><option>--type</option> <emphasis>hashAlgo</emphasis></arg>
|
||||
<arg><option>--print-path</option></arg>
|
||||
<arg><option>--unpack</option></arg>
|
||||
<arg><option>--name</option> <replaceable>name</replaceable></arg>
|
||||
<arg choice='plain'><replaceable>url</replaceable></arg>
|
||||
<arg><replaceable>hash</replaceable></arg>
|
||||
<arg><option>--name</option> <emphasis>name</emphasis></arg>
|
||||
<arg choice='plain'><emphasis>url</emphasis></arg>
|
||||
<arg><emphasis>hash</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsection><title>Description</title>
|
||||
|
||||
<para>The command <command>nix-prefetch-url</command> downloads the
|
||||
file referenced by the URL <replaceable>url</replaceable>, prints its
|
||||
file referenced by the URL <emphasis>url</emphasis>, prints its
|
||||
cryptographic hash, and copies it into the Nix store. The file name
|
||||
in the store is
|
||||
<filename><replaceable>hash</replaceable>-<replaceable>baseName</replaceable></filename>,
|
||||
where <replaceable>baseName</replaceable> is everything following the
|
||||
final slash in <replaceable>url</replaceable>.</para>
|
||||
<filename><emphasis>hash</emphasis>-<emphasis>baseName</emphasis></filename>,
|
||||
where <emphasis>baseName</emphasis> is everything following the
|
||||
final slash in <emphasis>url</emphasis>.</para>
|
||||
|
||||
<para>This command is just a convenience for Nix expression writers.
|
||||
Often a Nix expression fetches some source distribution from the
|
||||
|
@ -50,7 +50,7 @@ download it again when you build your Nix expression. Since
|
|||
as <command>nix-prefetch-url</command>, the redundant download can be
|
||||
avoided.</para>
|
||||
|
||||
<para>If <replaceable>hash</replaceable> is specified, then a download
|
||||
<para>If <emphasis>hash</emphasis> is specified, then a download
|
||||
is not performed if the Nix store already contains a file with the
|
||||
same hash and base name. Otherwise, the file is downloaded, and an
|
||||
error is signaled if the actual hash of the file does not match the
|
||||
|
@ -67,7 +67,7 @@ downloaded file in the Nix store is also printed.</para>
|
|||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry><term><option>--type</option> <replaceable>hashAlgo</replaceable></term>
|
||||
<varlistentry><term><option>--type</option> <emphasis>hashAlgo</emphasis></term>
|
||||
|
||||
<listitem><para>Use the specified cryptographic hash algorithm,
|
||||
which can be one of <literal>md5</literal>,
|
||||
|
@ -93,14 +93,14 @@ downloaded file in the Nix store is also printed.</para>
|
|||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><option>--name</option> <replaceable>name</replaceable></term>
|
||||
<varlistentry><term><option>--name</option> <emphasis>name</emphasis></term>
|
||||
|
||||
<listitem><para>Override the name of the file in the Nix store. By
|
||||
default, this is
|
||||
<literal><replaceable>hash</replaceable>-<replaceable>basename</replaceable></literal>,
|
||||
where <replaceable>basename</replaceable> is the last component of
|
||||
<replaceable>url</replaceable>. Overriding the name is necessary
|
||||
when <replaceable>basename</replaceable> contains characters that
|
||||
<literal><emphasis>hash</emphasis>-<emphasis>basename</emphasis></literal>,
|
||||
where <emphasis>basename</emphasis> is the last component of
|
||||
<emphasis>url</emphasis>. Overriding the name is necessary
|
||||
when <emphasis>basename</emphasis> contains characters that
|
||||
are not allowed in Nix store paths.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
|
|
@ -19,20 +19,20 @@
|
|||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>nix-shell</command>
|
||||
<arg><option>--arg</option> <replaceable>name</replaceable> <replaceable>value</replaceable></arg>
|
||||
<arg><option>--argstr</option> <replaceable>name</replaceable> <replaceable>value</replaceable></arg>
|
||||
<arg><option>--arg</option> <emphasis>name</emphasis> <emphasis>value</emphasis></arg>
|
||||
<arg><option>--argstr</option> <emphasis>name</emphasis> <emphasis>value</emphasis></arg>
|
||||
<arg>
|
||||
<group choice='req'>
|
||||
<arg choice='plain'><option>--attr</option></arg>
|
||||
<arg choice='plain'><option>-A</option></arg>
|
||||
</group>
|
||||
<replaceable>attrPath</replaceable>
|
||||
<emphasis>attrPath</emphasis>
|
||||
</arg>
|
||||
<arg><option>--command</option> <replaceable>cmd</replaceable></arg>
|
||||
<arg><option>--run</option> <replaceable>cmd</replaceable></arg>
|
||||
<arg><option>--exclude</option> <replaceable>regexp</replaceable></arg>
|
||||
<arg><option>--command</option> <emphasis>cmd</emphasis></arg>
|
||||
<arg><option>--run</option> <emphasis>cmd</emphasis></arg>
|
||||
<arg><option>--exclude</option> <emphasis>regexp</emphasis></arg>
|
||||
<arg><option>--pure</option></arg>
|
||||
<arg><option>--keep</option> <replaceable>name</replaceable></arg>
|
||||
<arg><option>--keep</option> <emphasis>name</emphasis></arg>
|
||||
<group choice='req'>
|
||||
<arg choice='plain'>
|
||||
<group choice='req'>
|
||||
|
@ -41,12 +41,12 @@
|
|||
</group>
|
||||
<arg choice='plain' rep='repeat'>
|
||||
<group choice='req'>
|
||||
<arg choice="plain"><replaceable>packages</replaceable></arg>
|
||||
<arg choice="plain"><replaceable>expressions</replaceable></arg>
|
||||
<arg choice="plain"><emphasis>packages</emphasis></arg>
|
||||
<arg choice="plain"><emphasis>expressions</emphasis></arg>
|
||||
</group>
|
||||
</arg>
|
||||
</arg>
|
||||
<arg><replaceable>path</replaceable></arg>
|
||||
<arg><emphasis>path</emphasis></arg>
|
||||
</group>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
@ -57,17 +57,17 @@
|
|||
dependencies of the specified derivation, but not the derivation
|
||||
itself. It will then start an interactive shell in which all
|
||||
environment variables defined by the derivation
|
||||
<replaceable>path</replaceable> have been set to their corresponding
|
||||
<emphasis>path</emphasis> have been set to their corresponding
|
||||
values, and the script <literal>$stdenv/setup</literal> has been
|
||||
sourced. This is useful for reproducing the environment of a
|
||||
derivation for development.</para>
|
||||
|
||||
<para>If <replaceable>path</replaceable> is not given,
|
||||
<para>If <emphasis>path</emphasis> is not given,
|
||||
<command>nix-shell</command> defaults to
|
||||
<filename>shell.nix</filename> if it exists, and
|
||||
<filename>default.nix</filename> otherwise.</para>
|
||||
|
||||
<para>If <replaceable>path</replaceable> starts with
|
||||
<para>If <emphasis>path</emphasis> starts with
|
||||
<literal>http://</literal> or <literal>https://</literal>, it is
|
||||
interpreted as the URL of a tarball that will be downloaded and
|
||||
unpacked to a temporary location. The tarball must include a single
|
||||
|
@ -103,10 +103,10 @@ also <xref linkend="sec-common-options" />.</phrase></para>
|
|||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry><term><option>--command</option> <replaceable>cmd</replaceable></term>
|
||||
<varlistentry><term><option>--command</option> <emphasis>cmd</emphasis></term>
|
||||
|
||||
<listitem><para>In the environment of the derivation, run the
|
||||
shell command <replaceable>cmd</replaceable>. This command is
|
||||
shell command <emphasis>cmd</emphasis>. This command is
|
||||
executed in an interactive shell. (Use <option>--run</option> to
|
||||
use a non-interactive shell instead.) However, a call to
|
||||
<literal>exit</literal> is implicitly added to the command, so the
|
||||
|
@ -118,7 +118,7 @@ also <xref linkend="sec-common-options" />.</phrase></para>
|
|||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><option>--run</option> <replaceable>cmd</replaceable></term>
|
||||
<varlistentry><term><option>--run</option> <emphasis>cmd</emphasis></term>
|
||||
|
||||
<listitem><para>Like <option>--command</option>, but executes the
|
||||
command in a non-interactive shell. This means (among other
|
||||
|
@ -127,10 +127,10 @@ also <xref linkend="sec-common-options" />.</phrase></para>
|
|||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><option>--exclude</option> <replaceable>regexp</replaceable></term>
|
||||
<varlistentry><term><option>--exclude</option> <emphasis>regexp</emphasis></term>
|
||||
|
||||
<listitem><para>Do not build any dependencies whose store path
|
||||
matches the regular expression <replaceable>regexp</replaceable>.
|
||||
matches the regular expression <emphasis>regexp</emphasis>.
|
||||
This option may be specified multiple times.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
@ -150,7 +150,7 @@ also <xref linkend="sec-common-options" />.</phrase></para>
|
|||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><option>--packages</option> / <option>-p</option> <replaceable>packages</replaceable>…</term>
|
||||
<varlistentry><term><option>--packages</option> / <option>-p</option> <emphasis>packages</emphasis>…</term>
|
||||
|
||||
<listitem><para>Set up an environment in which the specified
|
||||
packages are present. The command line arguments are interpreted
|
||||
|
@ -162,7 +162,7 @@ also <xref linkend="sec-common-options" />.</phrase></para>
|
|||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><option>-i</option> <replaceable>interpreter</replaceable></term>
|
||||
<varlistentry><term><option>-i</option> <emphasis>interpreter</emphasis></term>
|
||||
|
||||
<listitem><para>The chained script interpreter to be invoked by
|
||||
<command>nix-shell</command>. Only applicable in
|
||||
|
@ -171,7 +171,7 @@ also <xref linkend="sec-common-options" />.</phrase></para>
|
|||
|
||||
</listitem></varlistentry>
|
||||
|
||||
<varlistentry><term><option>--keep</option> <replaceable>name</replaceable></term>
|
||||
<varlistentry><term><option>--keep</option> <emphasis>name</emphasis></term>
|
||||
|
||||
<listitem><para>When a <option>--pure</option> shell is started,
|
||||
keep the listed environment variables.</para></listitem>
|
||||
|
@ -278,13 +278,13 @@ following lines:
|
|||
|
||||
<programlisting>
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i <replaceable>real-interpreter</replaceable> -p <replaceable>packages</replaceable>
|
||||
#! nix-shell -i <emphasis>real-interpreter</emphasis> -p <emphasis>packages</emphasis>
|
||||
</programlisting>
|
||||
|
||||
where <replaceable>real-interpreter</replaceable> is the “real” script
|
||||
where <emphasis>real-interpreter</emphasis> is the “real” script
|
||||
interpreter that will be invoked by <command>nix-shell</command> after
|
||||
it has obtained the dependencies and initialised the environment, and
|
||||
<replaceable>packages</replaceable> are the attribute names of the
|
||||
<emphasis>packages</emphasis> are the attribute names of the
|
||||
dependencies in Nixpkgs.</para>
|
||||
|
||||
<para>The lines starting with <literal>#! nix-shell</literal> specify
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
<cmdsynopsis>
|
||||
<command>nix-store</command>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="opt-common-syn.xml#xmlns(db=http://docbook.org/ns/docbook)xpointer(/db:nop/*)" />
|
||||
<arg><option>--add-root</option> <replaceable>path</replaceable></arg>
|
||||
<arg><option>--add-root</option> <emphasis>path</emphasis></arg>
|
||||
<arg><option>--indirect</option></arg>
|
||||
<arg choice='plain'><replaceable>operation</replaceable></arg>
|
||||
<arg rep='repeat'><replaceable>options</replaceable></arg>
|
||||
<arg rep='repeat'><replaceable>arguments</replaceable></arg>
|
||||
<arg choice='plain'><emphasis>operation</emphasis></arg>
|
||||
<arg rep='repeat'><emphasis>options</emphasis></arg>
|
||||
<arg rep='repeat'><emphasis>arguments</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
|
@ -55,14 +55,14 @@ options.</phrase></para>
|
|||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry xml:id="opt-add-root"><term><option>--add-root</option> <replaceable>path</replaceable></term>
|
||||
<varlistentry xml:id="opt-add-root"><term><option>--add-root</option> <emphasis>path</emphasis></term>
|
||||
|
||||
<listitem><para>Causes the result of a realisation
|
||||
(<option>--realise</option> and <option>--force-realise</option>)
|
||||
to be registered as a root of the garbage collector<phrase
|
||||
condition="manual"> (see <xref linkend="ssec-gc-roots"
|
||||
/>)</phrase>. The root is stored in
|
||||
<replaceable>path</replaceable>, which must be inside a directory
|
||||
<emphasis>path</emphasis>, which must be inside a directory
|
||||
that is scanned for roots by the garbage collector (i.e.,
|
||||
typically in a subdirectory of
|
||||
<filename>/nix/var/nix/gcroots/</filename>)
|
||||
|
@ -88,11 +88,11 @@ options.</phrase></para>
|
|||
garbage-collected unless the symlink is removed.</para>
|
||||
|
||||
<para>The <option>--indirect</option> flag causes a uniquely named
|
||||
symlink to <replaceable>path</replaceable> to be stored in
|
||||
symlink to <emphasis>path</emphasis> to be stored in
|
||||
<filename>/nix/var/nix/gcroots/auto/</filename>. For instance,
|
||||
|
||||
<screen>
|
||||
$ nix-store --add-root /home/eelco/bla/result --indirect -r <replaceable>...</replaceable>
|
||||
$ nix-store --add-root /home/eelco/bla/result --indirect -r <emphasis>...</emphasis>
|
||||
|
||||
$ ls -l /nix/var/nix/gcroots/auto
|
||||
lrwxrwxrwx 1 ... 2005-03-13 21:10 dn54lcypm8f8... -> /home/eelco/bla/result
|
||||
|
@ -135,7 +135,7 @@ lrwxrwxrwx 1 ... 2005-03-13 21:10 /home/eelco/bla/result -> /nix/store/1r1134
|
|||
<arg choice='plain'><option>--realise</option></arg>
|
||||
<arg choice='plain'><option>-r</option></arg>
|
||||
</group>
|
||||
<arg choice='plain' rep='repeat'><replaceable>paths</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>paths</emphasis></arg>
|
||||
<arg><option>--dry-run</option></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
|
@ -204,7 +204,7 @@ printed.)</para>
|
|||
with <option>-K</option>, if an output path is not identical to
|
||||
the corresponding output from the previous build, the new output
|
||||
path is left in
|
||||
<filename>/nix/store/<replaceable>name</replaceable>.check.</filename></para>
|
||||
<filename>/nix/store/<emphasis>name</emphasis>.check.</filename></para>
|
||||
|
||||
<para>See also the <option>build-repeat</option> configuration
|
||||
option, which repeats a derivation a number of times and prevents
|
||||
|
@ -361,7 +361,7 @@ EOF
|
|||
<arg choice='plain'><option>--print-live</option></arg>
|
||||
<arg choice='plain'><option>--print-dead</option></arg>
|
||||
</group>
|
||||
<arg><option>--max-freed</option> <replaceable>bytes</replaceable></arg>
|
||||
<arg><option>--max-freed</option> <emphasis>bytes</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
</refsection>
|
||||
|
@ -413,11 +413,11 @@ options control what gets deleted and in what order:
|
|||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry><term><option>--max-freed</option> <replaceable>bytes</replaceable></term>
|
||||
<varlistentry><term><option>--max-freed</option> <emphasis>bytes</emphasis></term>
|
||||
|
||||
<listitem><para>Keep deleting paths until at least
|
||||
<replaceable>bytes</replaceable> bytes have been deleted, then
|
||||
stop. The argument <replaceable>bytes</replaceable> can be
|
||||
<emphasis>bytes</emphasis> bytes have been deleted, then
|
||||
stop. The argument <emphasis>bytes</emphasis> can be
|
||||
followed by the multiplicative suffix <literal>K</literal>,
|
||||
<literal>M</literal>, <literal>G</literal> or
|
||||
<literal>T</literal>, denoting KiB, MiB, GiB or TiB
|
||||
|
@ -450,7 +450,7 @@ be freed.</para>
|
|||
<screen>
|
||||
$ nix-store --gc
|
||||
deleting `/nix/store/kq82idx6g0nyzsp2s14gfsc38npai7lf-cairo-1.0.4.tar.gz.drv'
|
||||
<replaceable>...</replaceable>
|
||||
<emphasis>...</emphasis>
|
||||
8825586 bytes freed (8.42 MiB)</screen>
|
||||
|
||||
</para>
|
||||
|
@ -479,7 +479,7 @@ $ nix-store --gc --max-freed $((100 * 1024 * 1024))</screen>
|
|||
<command>nix-store</command>
|
||||
<arg choice='plain'><option>--delete</option></arg>
|
||||
<arg><option>--ignore-liveness</option></arg>
|
||||
<arg choice='plain' rep='repeat'><replaceable>paths</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>paths</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
</refsection>
|
||||
|
@ -487,7 +487,7 @@ $ nix-store --gc --max-freed $((100 * 1024 * 1024))</screen>
|
|||
<refsection><title>Description</title>
|
||||
|
||||
<para>The operation <option>--delete</option> deletes the store paths
|
||||
<replaceable>paths</replaceable> from the Nix store, but only if it is
|
||||
<emphasis>paths</emphasis> from the Nix store, but only if it is
|
||||
safe to do so; that is, when the path is not reachable from a root of
|
||||
the garbage collector. This means that you can only delete paths that
|
||||
would also be deleted by <literal>nix-store --gc</literal>. Thus,
|
||||
|
@ -537,8 +537,8 @@ error: cannot delete path `/nix/store/zq0h41l75vlb4z45kzgjjmsjxvcv1qk7-mesa-6.4'
|
|||
<arg choice='plain'><option>-d</option></arg>
|
||||
<arg choice='plain'><option>--graph</option></arg>
|
||||
<arg choice='plain'><option>--tree</option></arg>
|
||||
<arg choice='plain'><option>--binding</option> <replaceable>name</replaceable></arg>
|
||||
<arg choice='plain'><option>-b</option> <replaceable>name</replaceable></arg>
|
||||
<arg choice='plain'><option>--binding</option> <emphasis>name</emphasis></arg>
|
||||
<arg choice='plain'><option>-b</option> <emphasis>name</emphasis></arg>
|
||||
<arg choice='plain'><option>--hash</option></arg>
|
||||
<arg choice='plain'><option>--size</option></arg>
|
||||
<arg choice='plain'><option>--roots</option></arg>
|
||||
|
@ -547,7 +547,7 @@ error: cannot delete path `/nix/store/zq0h41l75vlb4z45kzgjjmsjxvcv1qk7-mesa-6.4'
|
|||
<arg><option>-u</option></arg>
|
||||
<arg><option>--force-realise</option></arg>
|
||||
<arg><option>-f</option></arg>
|
||||
<arg choice='plain' rep='repeat'><replaceable>paths</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>paths</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
</refsection>
|
||||
|
@ -560,7 +560,7 @@ information about the store paths . The queries are described below. At
|
|||
most one query can be specified. The default query is
|
||||
<option>--outputs</option>.</para>
|
||||
|
||||
<para>The paths <replaceable>paths</replaceable> may also be symlinks
|
||||
<para>The paths <emphasis>paths</emphasis> may also be symlinks
|
||||
from outside of the Nix store, to the Nix store. In that case, the
|
||||
query is applied to the target of the symlink.</para>
|
||||
|
||||
|
@ -603,7 +603,7 @@ query is applied to the target of the symlink.</para>
|
|||
|
||||
<listitem><para>Prints out the <link
|
||||
linkend="gloss-output-path">output paths</link> of the store
|
||||
derivations <replaceable>paths</replaceable>. These are the paths
|
||||
derivations <emphasis>paths</emphasis>. These are the paths
|
||||
that will be produced when the derivation is
|
||||
built.</para></listitem>
|
||||
|
||||
|
@ -614,7 +614,7 @@ query is applied to the target of the symlink.</para>
|
|||
|
||||
<listitem><para>Prints out the <link
|
||||
linkend="gloss-closure">closure</link> of the store path
|
||||
<replaceable>paths</replaceable>.</para>
|
||||
<emphasis>paths</emphasis>.</para>
|
||||
|
||||
<para>This query has one option:</para>
|
||||
|
||||
|
@ -647,7 +647,7 @@ query is applied to the target of the symlink.</para>
|
|||
|
||||
<listitem><para>Prints the set of <link
|
||||
linkend="gloss-reference">references</link> of the store paths
|
||||
<replaceable>paths</replaceable>, that is, their immediate
|
||||
<emphasis>paths</emphasis>, that is, their immediate
|
||||
dependencies. (For <emphasis>all</emphasis> dependencies, use
|
||||
<option>--requisites</option>.)</para></listitem>
|
||||
|
||||
|
@ -656,9 +656,9 @@ query is applied to the target of the symlink.</para>
|
|||
<varlistentry><term><option>--referrers</option></term>
|
||||
|
||||
<listitem><para>Prints the set of <emphasis>referrers</emphasis> of
|
||||
the store paths <replaceable>paths</replaceable>, that is, the
|
||||
the store paths <emphasis>paths</emphasis>, that is, the
|
||||
store paths currently existing in the Nix store that refer to one
|
||||
of <replaceable>paths</replaceable>. Note that contrary to the
|
||||
of <emphasis>paths</emphasis>. Note that contrary to the
|
||||
references, the set of referrers is not constant; it can change as
|
||||
store paths are added or removed.</para></listitem>
|
||||
|
||||
|
@ -667,11 +667,11 @@ query is applied to the target of the symlink.</para>
|
|||
<varlistentry><term><option>--referrers-closure</option></term>
|
||||
|
||||
<listitem><para>Prints the closure of the set of store paths
|
||||
<replaceable>paths</replaceable> under the referrers relation; that
|
||||
<emphasis>paths</emphasis> under the referrers relation; that
|
||||
is, all store paths that directly or indirectly refer to one of
|
||||
<replaceable>paths</replaceable>. These are all the path currently
|
||||
<emphasis>paths</emphasis>. These are all the path currently
|
||||
in the Nix store that are dependent on
|
||||
<replaceable>paths</replaceable>.</para></listitem>
|
||||
<emphasis>paths</emphasis>.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
|
@ -680,7 +680,7 @@ query is applied to the target of the symlink.</para>
|
|||
|
||||
<listitem><para>Prints the <link
|
||||
linkend="gloss-deriver">deriver</link> of the store paths
|
||||
<replaceable>paths</replaceable>. If the path has no deriver
|
||||
<emphasis>paths</emphasis>. If the path has no deriver
|
||||
(e.g., if it is a source file), or if the deriver is not known
|
||||
(e.g., in the case of a binary-only deployment), the string
|
||||
<literal>unknown-deriver</literal> is printed.</para></listitem>
|
||||
|
@ -690,7 +690,7 @@ query is applied to the target of the symlink.</para>
|
|||
<varlistentry><term><option>--graph</option></term>
|
||||
|
||||
<listitem><para>Prints the references graph of the store paths
|
||||
<replaceable>paths</replaceable> in the format of the
|
||||
<emphasis>paths</emphasis> in the format of the
|
||||
<command>dot</command> tool of AT&T's <link
|
||||
xlink:href="http://www.graphviz.org/">Graphviz package</link>.
|
||||
This can be used to visualise dependency graphs. To obtain a
|
||||
|
@ -703,7 +703,7 @@ query is applied to the target of the symlink.</para>
|
|||
<varlistentry><term><option>--tree</option></term>
|
||||
|
||||
<listitem><para>Prints the references graph of the store paths
|
||||
<replaceable>paths</replaceable> as a nested ASCII tree.
|
||||
<emphasis>paths</emphasis> as a nested ASCII tree.
|
||||
References are ordered by descending closure size; this tends to
|
||||
flatten the tree, making it more readable. The query only
|
||||
recurses into a store path when it is first encountered; this
|
||||
|
@ -715,7 +715,7 @@ query is applied to the target of the symlink.</para>
|
|||
<varlistentry><term><option>--graphml</option></term>
|
||||
|
||||
<listitem><para>Prints the references graph of the store paths
|
||||
<replaceable>paths</replaceable> in the <link
|
||||
<emphasis>paths</emphasis> in the <link
|
||||
xlink:href="http://graphml.graphdrawing.org/">GraphML</link> file format.
|
||||
This can be used to visualise dependency graphs. To obtain a
|
||||
build-time dependency graph, apply this to a store derivation. To
|
||||
|
@ -724,12 +724,12 @@ query is applied to the target of the symlink.</para>
|
|||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><option>--binding</option> <replaceable>name</replaceable></term>
|
||||
<term><option>-b</option> <replaceable>name</replaceable></term>
|
||||
<varlistentry><term><option>--binding</option> <emphasis>name</emphasis></term>
|
||||
<term><option>-b</option> <emphasis>name</emphasis></term>
|
||||
|
||||
<listitem><para>Prints the value of the attribute
|
||||
<replaceable>name</replaceable> (i.e., environment variable) of
|
||||
the store derivations <replaceable>paths</replaceable>. It is an
|
||||
<emphasis>name</emphasis> (i.e., environment variable) of
|
||||
the store derivations <emphasis>paths</emphasis>. It is an
|
||||
error for a derivation to not have the specified
|
||||
attribute.</para></listitem>
|
||||
|
||||
|
@ -738,7 +738,7 @@ query is applied to the target of the symlink.</para>
|
|||
<varlistentry><term><option>--hash</option></term>
|
||||
|
||||
<listitem><para>Prints the SHA-256 hash of the contents of the
|
||||
store paths <replaceable>paths</replaceable> (that is, the hash of
|
||||
store paths <emphasis>paths</emphasis> (that is, the hash of
|
||||
the output of <command>nix-store --dump</command> on the given
|
||||
paths). Since the hash is stored in the Nix database, this is a
|
||||
fast operation.</para></listitem>
|
||||
|
@ -748,7 +748,7 @@ query is applied to the target of the symlink.</para>
|
|||
<varlistentry><term><option>--size</option></term>
|
||||
|
||||
<listitem><para>Prints the size in bytes of the contents of the
|
||||
store paths <replaceable>paths</replaceable> — to be precise, the
|
||||
store paths <emphasis>paths</emphasis> — to be precise, the
|
||||
size of the output of <command>nix-store --dump</command> on the
|
||||
given paths. Note that the actual disk space required by the
|
||||
store paths may be higher, especially on filesystems with large
|
||||
|
@ -760,7 +760,7 @@ query is applied to the target of the symlink.</para>
|
|||
|
||||
<listitem><para>Prints the garbage collector roots that point,
|
||||
directly or indirectly, at the store paths
|
||||
<replaceable>paths</replaceable>.</para></listitem>
|
||||
<emphasis>paths</emphasis>.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
|
@ -778,7 +778,7 @@ query is applied to the target of the symlink.</para>
|
|||
$ nix-store -qR $(which svn)
|
||||
/nix/store/5mbglq5ldqld8sj57273aljwkfvj22mc-subversion-1.1.4
|
||||
/nix/store/9lz9yc6zgmc0vlqmn2ipcpkjlmbi51vv-glibc-2.3.4
|
||||
<replaceable>...</replaceable></screen>
|
||||
<emphasis>...</emphasis></screen>
|
||||
|
||||
</para>
|
||||
|
||||
|
@ -789,7 +789,7 @@ $ nix-store -qR $(nix-store -qd $(which svn))
|
|||
/nix/store/02iizgn86m42q905rddvg4ja975bk2i4-grep-2.5.1.tar.bz2.drv
|
||||
/nix/store/07a2bzxmzwz5hp58nf03pahrv2ygwgs3-gcc-wrapper.sh
|
||||
/nix/store/0ma7c9wsbaxahwwl04gbw3fcd806ski4-glibc-2.3.4.drv
|
||||
<replaceable>... lots of other paths ...</replaceable></screen>
|
||||
<emphasis>... lots of other paths ...</emphasis></screen>
|
||||
|
||||
The difference with the previous example is that we ask the closure of
|
||||
the derivation (<option>-qd</option>), not the closure of the output
|
||||
|
@ -804,7 +804,7 @@ $ nix-store -q --tree $(nix-store -qd $(which svn))
|
|||
+---/nix/store/fmzxmpjx2lh849ph0l36snfj9zdibw67-bash-3.0.drv
|
||||
| +---/nix/store/570hmhmx3v57605cqg9yfvvyh0nnb8k8-bash
|
||||
| +---/nix/store/p3srsbd8dx44v2pg6nbnszab5mcwx03v-builder.sh
|
||||
<replaceable>...</replaceable></screen>
|
||||
<emphasis>...</emphasis></screen>
|
||||
|
||||
</para>
|
||||
|
||||
|
@ -827,7 +827,7 @@ $ nix-store -q --referrers $(nix-store -q --binding openssl $(nix-store -qd $(wh
|
|||
$ nix-store -q --referrers-closure $(ldd $(which svn) | grep /libc.so | awk '{print $3}')
|
||||
/nix/store/034a6h4vpz9kds5r6kzb9lhh81mscw43-libgnomeprintui-2.8.2
|
||||
/nix/store/15l3yi0d45prm7a82pcrknxdh6nzmxza-gawk-3.1.4
|
||||
<replaceable>...</replaceable></screen>
|
||||
<emphasis>...</emphasis></screen>
|
||||
|
||||
Note that <command>ldd</command> is a command that prints out the
|
||||
dynamic libraries used by an ELF executable.</para>
|
||||
|
@ -893,7 +893,7 @@ $ nix-store -q --roots $(which svn)
|
|||
<cmdsynopsis>
|
||||
<command>nix-store</command>
|
||||
<arg choice='plain'><option>--add</option></arg>
|
||||
<arg choice='plain' rep='repeat'><replaceable>paths</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>paths</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
</refsection>
|
||||
|
@ -926,8 +926,8 @@ $ nix-store --add ./foo.c
|
|||
<command>nix-store</command>
|
||||
<arg><option>--recursive</option></arg>
|
||||
<arg choice='plain'><option>--add-fixed</option></arg>
|
||||
<arg choice='plain'><replaceable>algorithm</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><replaceable>paths</replaceable></arg>
|
||||
<arg choice='plain'><emphasis>algorithm</emphasis></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>paths</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
</refsection>
|
||||
|
@ -1039,7 +1039,7 @@ in Nix itself.</para>
|
|||
<cmdsynopsis>
|
||||
<command>nix-store</command>
|
||||
<arg choice='plain'><option>--verify-path</option></arg>
|
||||
<arg choice='plain' rep='repeat'><replaceable>paths</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>paths</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsection>
|
||||
|
||||
|
@ -1077,7 +1077,7 @@ $ nix-store --verify-path $(nix-store -qR $(which svn))
|
|||
<cmdsynopsis>
|
||||
<command>nix-store</command>
|
||||
<arg choice='plain'><option>--repair-path</option></arg>
|
||||
<arg choice='plain' rep='repeat'><replaceable>paths</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>paths</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsection>
|
||||
|
||||
|
@ -1123,7 +1123,7 @@ fetching path `/nix/store/d7a81wsm1ijwwpkks3725661h3263p5-glibc-2.13'...
|
|||
<cmdsynopsis>
|
||||
<command>nix-store</command>
|
||||
<arg choice='plain'><option>--dump</option></arg>
|
||||
<arg choice='plain'><replaceable>path</replaceable></arg>
|
||||
<arg choice='plain'><emphasis>path</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsection>
|
||||
|
||||
|
@ -1131,7 +1131,7 @@ fetching path `/nix/store/d7a81wsm1ijwwpkks3725661h3263p5-glibc-2.13'...
|
|||
|
||||
<para>The operation <option>--dump</option> produces a NAR (Nix
|
||||
ARchive) file containing the contents of the file system tree rooted
|
||||
at <replaceable>path</replaceable>. The archive is written to
|
||||
at <emphasis>path</emphasis>. The archive is written to
|
||||
standard output.</para>
|
||||
|
||||
<para>A NAR archive is like a TAR or Zip archive, but it contains only
|
||||
|
@ -1173,14 +1173,14 @@ links, but not other types of files (such as device nodes).</para>
|
|||
<cmdsynopsis>
|
||||
<command>nix-store</command>
|
||||
<arg choice='plain'><option>--restore</option></arg>
|
||||
<arg choice='plain'><replaceable>path</replaceable></arg>
|
||||
<arg choice='plain'><emphasis>path</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsection>
|
||||
|
||||
<refsection><title>Description</title>
|
||||
|
||||
<para>The operation <option>--restore</option> unpacks a NAR archive
|
||||
to <replaceable>path</replaceable>, which must not already exist. The
|
||||
to <emphasis>path</emphasis>, which must not already exist. The
|
||||
archive is read from standard input.</para>
|
||||
|
||||
</refsection>
|
||||
|
@ -1198,7 +1198,7 @@ archive is read from standard input.</para>
|
|||
<cmdsynopsis>
|
||||
<command>nix-store</command>
|
||||
<arg choice='plain'><option>--export</option></arg>
|
||||
<arg choice='plain' rep='repeat'><replaceable>paths</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>paths</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsection>
|
||||
|
||||
|
@ -1220,7 +1220,7 @@ that are missing in the target Nix store, the import will fail. To
|
|||
copy a whole closure, do something like:
|
||||
|
||||
<screen>
|
||||
$ nix-store --export $(nix-store -qR <replaceable>paths</replaceable>) > out</screen>
|
||||
$ nix-store --export $(nix-store -qR <emphasis>paths</emphasis>) > out</screen>
|
||||
|
||||
To import the whole closure again, run:
|
||||
|
||||
|
@ -1299,7 +1299,7 @@ progress indication.</para>
|
|||
<screen>
|
||||
$ nix-store --optimise
|
||||
hashing files in `/nix/store/qhqx7l2f1kmwihc9bnxs7rc159hsxnf3-gcc-4.1.1'
|
||||
<replaceable>...</replaceable>
|
||||
<emphasis>...</emphasis>
|
||||
541838819 bytes (516.74 MiB) freed by hard-linking 54143 files;
|
||||
there are 114486 files with equal contents out of 215894 files in total
|
||||
</screen>
|
||||
|
@ -1322,7 +1322,7 @@ there are 114486 files with equal contents out of 215894 files in total
|
|||
<arg choice='plain'><option>--read-log</option></arg>
|
||||
<arg choice='plain'><option>-l</option></arg>
|
||||
</group>
|
||||
<arg choice='plain' rep='repeat'><replaceable>paths</replaceable></arg>
|
||||
<arg choice='plain' rep='repeat'><emphasis>paths</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsection>
|
||||
|
||||
|
@ -1351,7 +1351,7 @@ unpacking sources
|
|||
unpacking source archive /nix/store/p8n1jpqs27mgkjw07pb5269717nzf5f8-ktorrent-2.2.1.tar.gz
|
||||
ktorrent-2.2.1/
|
||||
ktorrent-2.2.1/NEWS
|
||||
<replaceable>...</replaceable>
|
||||
<emphasis>...</emphasis>
|
||||
</screen>
|
||||
|
||||
</refsection>
|
||||
|
@ -1369,7 +1369,7 @@ ktorrent-2.2.1/NEWS
|
|||
<cmdsynopsis>
|
||||
<command>nix-store</command>
|
||||
<arg choice='plain'><option>--dump-db</option></arg>
|
||||
<arg rep='repeat'><replaceable>paths</replaceable></arg>
|
||||
<arg rep='repeat'><emphasis>paths</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsection>
|
||||
|
||||
|
@ -1424,7 +1424,7 @@ loads it into the Nix database.</para>
|
|||
<cmdsynopsis>
|
||||
<command>nix-store</command>
|
||||
<arg choice='plain'><option>--print-env</option></arg>
|
||||
<arg choice='plain'><replaceable>drvpath</replaceable></arg>
|
||||
<arg choice='plain'><emphasis>drvpath</emphasis></arg>
|
||||
</cmdsynopsis>
|
||||
</refsection>
|
||||
|
||||
|
@ -1441,7 +1441,7 @@ variable <literal>_args</literal>.</para>
|
|||
|
||||
<screen>
|
||||
$ nix-store --print-env $(nix-instantiate '<nixpkgs>' -A firefox)
|
||||
<replaceable>…</replaceable>
|
||||
<emphasis>…</emphasis>
|
||||
export src; src='/nix/store/plpj7qrwcz94z2psh6fchsi7s8yihc7k-firefox-12.0.source.tar.bz2'
|
||||
export stdenv; stdenv='/nix/store/7c8asx3yfrg5dg1gzhzyq2236zfgibnn-stdenv'
|
||||
export system; system='x86_64-linux'
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
</arg>
|
||||
<arg>
|
||||
<option>--log-format</option>
|
||||
<replaceable>format</replaceable>
|
||||
<emphasis>format</emphasis>
|
||||
</arg>
|
||||
<arg>
|
||||
<group choice='plain'>
|
||||
|
@ -26,19 +26,19 @@
|
|||
<arg choice='plain'><option>--max-jobs</option></arg>
|
||||
<arg choice='plain'><option>-j</option></arg>
|
||||
</group>
|
||||
<replaceable>number</replaceable>
|
||||
<emphasis>number</emphasis>
|
||||
</arg>
|
||||
<arg>
|
||||
<option>--cores</option>
|
||||
<replaceable>number</replaceable>
|
||||
<emphasis>number</emphasis>
|
||||
</arg>
|
||||
<arg>
|
||||
<option>--max-silent-time</option>
|
||||
<replaceable>number</replaceable>
|
||||
<emphasis>number</emphasis>
|
||||
</arg>
|
||||
<arg>
|
||||
<option>--timeout</option>
|
||||
<replaceable>number</replaceable>
|
||||
<emphasis>number</emphasis>
|
||||
</arg>
|
||||
<arg>
|
||||
<group choice='plain'>
|
||||
|
@ -56,12 +56,12 @@
|
|||
<arg><option>--readonly-mode</option></arg>
|
||||
<arg>
|
||||
<option>-I</option>
|
||||
<replaceable>path</replaceable>
|
||||
<emphasis>path</emphasis>
|
||||
</arg>
|
||||
<arg>
|
||||
<option>--option</option>
|
||||
<replaceable>name</replaceable>
|
||||
<replaceable>value</replaceable>
|
||||
<emphasis>name</emphasis>
|
||||
<emphasis>value</emphasis>
|
||||
</arg>
|
||||
<sbr />
|
||||
|
||||
|
|
|
@ -92,12 +92,12 @@
|
|||
</varlistentry>
|
||||
|
||||
|
||||
<varlistentry xml:id="opt-log-format"><term><option>--log-format</option> <replaceable>format</replaceable></term>
|
||||
<varlistentry xml:id="opt-log-format"><term><option>--log-format</option> <emphasis>format</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
|
||||
<para>This option can be used to change the output of the log format, with
|
||||
<replaceable>format</replaceable> being one of:</para>
|
||||
<emphasis>format</emphasis> being one of:</para>
|
||||
|
||||
<variablelist>
|
||||
|
||||
|
@ -130,13 +130,13 @@
|
|||
error. This option suppresses this behaviour. Note that the
|
||||
builder's standard output and error are always written to a log file
|
||||
in
|
||||
<filename><replaceable>prefix</replaceable>/nix/var/log/nix</filename>.</para></listitem>
|
||||
<filename><emphasis>prefix</emphasis>/nix/var/log/nix</filename>.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
|
||||
<varlistentry xml:id="opt-max-jobs"><term><option>--max-jobs</option> / <option>-j</option>
|
||||
<replaceable>number</replaceable></term>
|
||||
<emphasis>number</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
|
||||
|
@ -166,7 +166,7 @@
|
|||
of parallelism. For instance, in Nixpkgs, if the derivation
|
||||
attribute <varname>enableParallelBuilding</varname> is set to
|
||||
<literal>true</literal>, the builder passes the
|
||||
<option>-j<replaceable>N</replaceable></option> flag to GNU Make.
|
||||
<option>-j<emphasis>N</emphasis></option> flag to GNU Make.
|
||||
It defaults to the value of the <link
|
||||
linkend='conf-cores'><literal>cores</literal></link>
|
||||
configuration setting, if set, or <literal>1</literal> otherwise.
|
||||
|
@ -271,7 +271,7 @@
|
|||
</varlistentry>
|
||||
|
||||
|
||||
<varlistentry><term><option>--arg</option> <replaceable>name</replaceable> <replaceable>value</replaceable></term>
|
||||
<varlistentry><term><option>--arg</option> <emphasis>name</emphasis> <emphasis>value</emphasis></term>
|
||||
|
||||
<listitem><para>This option is accepted by
|
||||
<command>nix-env</command>, <command>nix-instantiate</command>,
|
||||
|
@ -280,14 +280,14 @@
|
|||
automatically try to call functions that
|
||||
it encounters. It can automatically call functions for which every
|
||||
argument has a <link linkend='ss-functions'>default value</link>
|
||||
(e.g., <literal>{ <replaceable>argName</replaceable> ?
|
||||
<replaceable>defaultValue</replaceable> }:
|
||||
<replaceable>...</replaceable></literal>). With
|
||||
(e.g., <literal>{ <emphasis>argName</emphasis> ?
|
||||
<emphasis>defaultValue</emphasis> }:
|
||||
<emphasis>...</emphasis></literal>). With
|
||||
<option>--arg</option>, you can also call functions that have
|
||||
arguments without a default value (or override a default value).
|
||||
That is, if the evaluator encounters a function with an argument
|
||||
named <replaceable>name</replaceable>, it will call it with value
|
||||
<replaceable>value</replaceable>.</para>
|
||||
named <emphasis>name</emphasis>, it will call it with value
|
||||
<emphasis>value</emphasis>.</para>
|
||||
|
||||
<para>For instance, the top-level <literal>default.nix</literal> in
|
||||
Nixpkgs is actually a function:
|
||||
|
@ -295,23 +295,23 @@
|
|||
<programlisting>
|
||||
{ # The system (e.g., `i686-linux') for which to build the packages.
|
||||
system ? builtins.currentSystem
|
||||
<replaceable>...</replaceable>
|
||||
}: <replaceable>...</replaceable></programlisting>
|
||||
<emphasis>...</emphasis>
|
||||
}: <emphasis>...</emphasis></programlisting>
|
||||
|
||||
So if you call this Nix expression (e.g., when you do
|
||||
<literal>nix-env -i <replaceable>pkgname</replaceable></literal>),
|
||||
<literal>nix-env -i <emphasis>pkgname</emphasis></literal>),
|
||||
the function will be called automatically using the value <link
|
||||
linkend='builtin-currentSystem'><literal>builtins.currentSystem</literal></link>
|
||||
for the <literal>system</literal> argument. You can override this
|
||||
using <option>--arg</option>, e.g., <literal>nix-env -i
|
||||
<replaceable>pkgname</replaceable> --arg system
|
||||
<emphasis>pkgname</emphasis> --arg system
|
||||
\"i686-freebsd\"</literal>. (Note that since the argument is a Nix
|
||||
string literal, you have to escape the quotes.)</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
|
||||
|
||||
<varlistentry><term><option>--argstr</option> <replaceable>name</replaceable> <replaceable>value</replaceable></term>
|
||||
<varlistentry><term><option>--argstr</option> <emphasis>name</emphasis> <emphasis>value</emphasis></term>
|
||||
|
||||
<listitem><para>This option is like <option>--arg</option>, only the
|
||||
value is not a Nix expression but a string. So instead of
|
||||
|
@ -323,17 +323,17 @@
|
|||
|
||||
|
||||
<varlistentry xml:id="opt-attr"><term><option>--attr</option> / <option>-A</option>
|
||||
<replaceable>attrPath</replaceable></term>
|
||||
<emphasis>attrPath</emphasis></term>
|
||||
|
||||
<listitem><para>Select an attribute from the top-level Nix
|
||||
expression being evaluated. (<command>nix-env</command>,
|
||||
<command>nix-instantiate</command>, <command>nix-build</command> and
|
||||
<command>nix-shell</command> only.) The <emphasis>attribute
|
||||
path</emphasis> <replaceable>attrPath</replaceable> is a sequence of
|
||||
path</emphasis> <emphasis>attrPath</emphasis> is a sequence of
|
||||
attribute names separated by dots. For instance, given a top-level
|
||||
Nix expression <replaceable>e</replaceable>, the attribute path
|
||||
Nix expression <emphasis>e</emphasis>, the attribute path
|
||||
<literal>xorg.xorgserver</literal> would cause the expression
|
||||
<literal><replaceable>e</replaceable>.xorg.xorgserver</literal> to
|
||||
<literal><emphasis>e</emphasis>.xorg.xorgserver</literal> to
|
||||
be used. See <link
|
||||
linkend='refsec-nix-env-install-examples'><command>nix-env
|
||||
--install</command></link> for some concrete examples.</para>
|
||||
|
@ -366,7 +366,7 @@
|
|||
</varlistentry>
|
||||
|
||||
|
||||
<varlistentry xml:id="opt-I"><term><option>-I</option> <replaceable>path</replaceable></term>
|
||||
<varlistentry xml:id="opt-I"><term><option>-I</option> <emphasis>path</emphasis></term>
|
||||
|
||||
<listitem><para>Add a path to the Nix expression search path. This
|
||||
option may be given multiple times. See the <envar
|
||||
|
@ -378,10 +378,10 @@
|
|||
</varlistentry>
|
||||
|
||||
|
||||
<varlistentry><term><option>--option</option> <replaceable>name</replaceable> <replaceable>value</replaceable></term>
|
||||
<varlistentry><term><option>--option</option> <emphasis>name</emphasis> <emphasis>value</emphasis></term>
|
||||
|
||||
<listitem><para>Set the Nix configuration option
|
||||
<replaceable>name</replaceable> to <replaceable>value</replaceable>.
|
||||
<emphasis>name</emphasis> to <emphasis>value</emphasis>.
|
||||
This overrides settings in the Nix configuration file (see
|
||||
<citerefentry><refentrytitle>nix.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>).</para></listitem>
|
||||
|
||||
|
|
|
@ -17,6 +17,6 @@
|
|||
<arg><option>--from-expression</option></arg>
|
||||
<arg><option>-E</option></arg>
|
||||
|
||||
<arg><option>--from-profile</option> <replaceable>path</replaceable></arg>
|
||||
<arg><option>--from-profile</option> <emphasis>path</emphasis></arg>
|
||||
|
||||
</nop>
|
||||
|
|
|
@ -91,12 +91,12 @@ disallowedRequisites = [ foobar ];
|
|||
references graph of their inputs. The attribute is a list of
|
||||
inputs in the Nix store whose references graph the builder needs
|
||||
to know. The value of this attribute should be a list of pairs
|
||||
<literal>[ <replaceable>name1</replaceable>
|
||||
<replaceable>path1</replaceable> <replaceable>name2</replaceable>
|
||||
<replaceable>path2</replaceable> <replaceable>...</replaceable>
|
||||
<literal>[ <emphasis>name1</emphasis>
|
||||
<emphasis>path1</emphasis> <emphasis>name2</emphasis>
|
||||
<emphasis>path2</emphasis> <emphasis>...</emphasis>
|
||||
]</literal>. The references graph of each
|
||||
<replaceable>pathN</replaceable> will be stored in a text file
|
||||
<replaceable>nameN</replaceable> in the temporary build directory.
|
||||
<emphasis>pathN</emphasis> will be stored in a text file
|
||||
<emphasis>nameN</emphasis> in the temporary build directory.
|
||||
The text files have the format used by <command>nix-store
|
||||
--register-validity</command> (with the deriver fields left
|
||||
empty). For example, when the following derivation is built:
|
||||
|
@ -135,7 +135,7 @@ derivation {
|
|||
Nixpkgs has the line
|
||||
|
||||
<programlisting>
|
||||
impureEnvVars = [ "http_proxy" "https_proxy" <replaceable>...</replaceable> ];
|
||||
impureEnvVars = [ "http_proxy" "https_proxy" <emphasis>...</emphasis> ];
|
||||
</programlisting>
|
||||
|
||||
to make it use the proxy server configuration specified by the
|
||||
|
@ -297,11 +297,11 @@ big = "a very long string";
|
|||
<literal>bigPath</literal> will contain the absolute path to a
|
||||
temporary file containing <literal>a very long
|
||||
string</literal>. That is, for any attribute
|
||||
<replaceable>x</replaceable> listed in
|
||||
<emphasis>x</emphasis> listed in
|
||||
<varname>passAsFile</varname>, Nix will pass an environment
|
||||
variable <literal><replaceable>x</replaceable>Path</literal> holding
|
||||
variable <literal><emphasis>x</emphasis>Path</literal> holding
|
||||
the path of the file containing the value of attribute
|
||||
<replaceable>x</replaceable>. This is useful when you need to pass
|
||||
<emphasis>x</emphasis>. This is useful when you need to pass
|
||||
large strings to a builder, since most operating systems impose a
|
||||
limit on the size of the environment (typically, a few hundred
|
||||
kilobyte).</para></listitem>
|
||||
|
|
|
@ -58,7 +58,7 @@ steps:</para>
|
|||
the <literal>PATH</literal>. The <literal>perl</literal> environment
|
||||
variable points to the location of the Perl package (since it
|
||||
was passed in as an attribute to the derivation), so
|
||||
<filename><replaceable>$perl</replaceable>/bin</filename> is the
|
||||
<filename><emphasis>$perl</emphasis>/bin</filename> is the
|
||||
directory containing the Perl interpreter.</para>
|
||||
|
||||
</listitem>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -50,7 +50,7 @@ the single Nix expression in that directory
|
|||
<para>Nix functions generally have the form <literal>{ x, y, ...,
|
||||
z }: e</literal> where <varname>x</varname>, <varname>y</varname>,
|
||||
etc. are the names of the expected arguments, and where
|
||||
<replaceable>e</replaceable> is the body of the function. So
|
||||
<emphasis>e</emphasis> is the body of the function. So
|
||||
here, the entire remainder of the file is the body of the
|
||||
function; when given the required arguments, the body should
|
||||
describe how to build an instance of the Hello package.</para>
|
||||
|
@ -69,10 +69,10 @@ the single Nix expression in that directory
|
|||
<emphasis>attributes</emphasis>. A set is just a list of
|
||||
key/value pairs where each key is a string and each value is an
|
||||
arbitrary Nix expression. They take the general form <literal>{
|
||||
<replaceable>name1</replaceable> =
|
||||
<replaceable>expr1</replaceable>; <replaceable>...</replaceable>
|
||||
<replaceable>nameN</replaceable> =
|
||||
<replaceable>exprN</replaceable>; }</literal>.</para>
|
||||
<emphasis>name1</emphasis> =
|
||||
<emphasis>expr1</emphasis>; <emphasis>...</emphasis>
|
||||
<emphasis>nameN</emphasis> =
|
||||
<emphasis>exprN</emphasis>; }</literal>.</para>
|
||||
|
||||
</listitem>
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ genericBuild ③</programlisting>
|
|||
subdirectory, it's added to GCC's header search path; and so
|
||||
on.<footnote><para>How does it work? <filename>setup</filename>
|
||||
tries to source the file
|
||||
<filename><replaceable>pkg</replaceable>/nix-support/setup-hook</filename>
|
||||
<filename><emphasis>pkg</emphasis>/nix-support/setup-hook</filename>
|
||||
of all dependencies. These “setup hooks” can then set up whatever
|
||||
environment variables they want; for instance, the setup hook for
|
||||
Perl sets the <literal>PERL5LIB</literal> environment variable to
|
||||
|
|
|
@ -137,7 +137,7 @@ while defining a set.</para>
|
|||
<para>Functions have the following form:
|
||||
|
||||
<programlisting>
|
||||
<replaceable>pattern</replaceable>: <replaceable>body</replaceable></programlisting>
|
||||
<emphasis>pattern</emphasis>: <emphasis>body</emphasis></programlisting>
|
||||
|
||||
The pattern specifies what the argument of the function must look
|
||||
like, and binds variables in the body to (parts of) the
|
||||
|
@ -190,9 +190,9 @@ map (concat "foo") [ "bar" "bla" "abc" ]</programlisting>
|
|||
<para>It is possible to provide <emphasis>default values</emphasis>
|
||||
for attributes, in which case they are allowed to be missing. A
|
||||
default value is specified by writing
|
||||
<literal><replaceable>name</replaceable> ?
|
||||
<replaceable>e</replaceable></literal>, where
|
||||
<replaceable>e</replaceable> is an arbitrary expression. For example,
|
||||
<literal><emphasis>name</emphasis> ?
|
||||
<emphasis>e</emphasis></literal>, where
|
||||
<emphasis>e</emphasis> is an arbitrary expression. For example,
|
||||
|
||||
<programlisting>
|
||||
{ x, y ? "foo", z ? "bar" }: z + y + x</programlisting>
|
||||
|
@ -256,9 +256,9 @@ in concat { x = "foo"; y = "bar"; }</programlisting>
|
|||
<para>Conditionals look like this:
|
||||
|
||||
<programlisting>
|
||||
if <replaceable>e1</replaceable> then <replaceable>e2</replaceable> else <replaceable>e3</replaceable></programlisting>
|
||||
if <emphasis>e1</emphasis> then <emphasis>e2</emphasis> else <emphasis>e3</emphasis></programlisting>
|
||||
|
||||
where <replaceable>e1</replaceable> is an expression that should
|
||||
where <emphasis>e1</emphasis> is an expression that should
|
||||
evaluate to a Boolean value (<literal>true</literal> or
|
||||
<literal>false</literal>).</para>
|
||||
|
||||
|
@ -271,11 +271,11 @@ evaluate to a Boolean value (<literal>true</literal> or
|
|||
on or between features and dependencies hold. They look like this:
|
||||
|
||||
<programlisting>
|
||||
assert <replaceable>e1</replaceable>; <replaceable>e2</replaceable></programlisting>
|
||||
assert <emphasis>e1</emphasis>; <emphasis>e2</emphasis></programlisting>
|
||||
|
||||
where <replaceable>e1</replaceable> is an expression that should
|
||||
where <emphasis>e1</emphasis> is an expression that should
|
||||
evaluate to a Boolean value. If it evaluates to
|
||||
<literal>true</literal>, <replaceable>e2</replaceable> is returned;
|
||||
<literal>true</literal>, <emphasis>e2</emphasis> is returned;
|
||||
otherwise expression evaluation is aborted and a backtrace is printed.</para>
|
||||
|
||||
<para>Here is a Nix expression for the Subversion package that shows
|
||||
|
@ -358,10 +358,10 @@ stdenv.mkDerivation {
|
|||
<para>A <emphasis>with-expression</emphasis>,
|
||||
|
||||
<programlisting>
|
||||
with <replaceable>e1</replaceable>; <replaceable>e2</replaceable></programlisting>
|
||||
with <emphasis>e1</emphasis>; <emphasis>e2</emphasis></programlisting>
|
||||
|
||||
introduces the set <replaceable>e1</replaceable> into the lexical
|
||||
scope of the expression <replaceable>e2</replaceable>. For instance,
|
||||
introduces the set <emphasis>e1</emphasis> into the lexical
|
||||
scope of the expression <emphasis>e2</emphasis>. For instance,
|
||||
|
||||
<programlisting>
|
||||
let as = { x = "foo"; y = "bar"; };
|
||||
|
|
|
@ -25,48 +25,48 @@ weakest binding).</para>
|
|||
<tbody>
|
||||
<row>
|
||||
<entry>Select</entry>
|
||||
<entry><replaceable>e</replaceable> <literal>.</literal>
|
||||
<replaceable>attrpath</replaceable>
|
||||
[ <literal>or</literal> <replaceable>def</replaceable> ]
|
||||
<entry><emphasis>e</emphasis> <literal>.</literal>
|
||||
<emphasis>attrpath</emphasis>
|
||||
[ <literal>or</literal> <emphasis>def</emphasis> ]
|
||||
</entry>
|
||||
<entry>none</entry>
|
||||
<entry>Select attribute denoted by the attribute path
|
||||
<replaceable>attrpath</replaceable> from set
|
||||
<replaceable>e</replaceable>. (An attribute path is a
|
||||
<emphasis>attrpath</emphasis> from set
|
||||
<emphasis>e</emphasis>. (An attribute path is a
|
||||
dot-separated list of attribute names.) If the attribute
|
||||
doesn’t exist, return <replaceable>def</replaceable> if
|
||||
doesn’t exist, return <emphasis>def</emphasis> if
|
||||
provided, otherwise abort evaluation.</entry>
|
||||
<entry>1</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Application</entry>
|
||||
<entry><replaceable>e1</replaceable> <replaceable>e2</replaceable></entry>
|
||||
<entry><emphasis>e1</emphasis> <emphasis>e2</emphasis></entry>
|
||||
<entry>left</entry>
|
||||
<entry>Call function <replaceable>e1</replaceable> with
|
||||
argument <replaceable>e2</replaceable>.</entry>
|
||||
<entry>Call function <emphasis>e1</emphasis> with
|
||||
argument <emphasis>e2</emphasis>.</entry>
|
||||
<entry>2</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Arithmetic Negation</entry>
|
||||
<entry><literal>-</literal> <replaceable>e</replaceable></entry>
|
||||
<entry><literal>-</literal> <emphasis>e</emphasis></entry>
|
||||
<entry>none</entry>
|
||||
<entry>Arithmetic negation.</entry>
|
||||
<entry>3</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Has Attribute</entry>
|
||||
<entry><replaceable>e</replaceable> <literal>?</literal>
|
||||
<replaceable>attrpath</replaceable></entry>
|
||||
<entry><emphasis>e</emphasis> <literal>?</literal>
|
||||
<emphasis>attrpath</emphasis></entry>
|
||||
<entry>none</entry>
|
||||
<entry>Test whether set <replaceable>e</replaceable> contains
|
||||
the attribute denoted by <replaceable>attrpath</replaceable>;
|
||||
<entry>Test whether set <emphasis>e</emphasis> contains
|
||||
the attribute denoted by <emphasis>attrpath</emphasis>;
|
||||
return <literal>true</literal> or
|
||||
<literal>false</literal>.</entry>
|
||||
<entry>4</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>List Concatenation</entry>
|
||||
<entry><replaceable>e1</replaceable> <literal>++</literal> <replaceable>e2</replaceable></entry>
|
||||
<entry><emphasis>e1</emphasis> <literal>++</literal> <emphasis>e2</emphasis></entry>
|
||||
<entry>right</entry>
|
||||
<entry>List concatenation.</entry>
|
||||
<entry>5</entry>
|
||||
|
@ -74,7 +74,7 @@ weakest binding).</para>
|
|||
<row>
|
||||
<entry>Multiplication</entry>
|
||||
<entry>
|
||||
<replaceable>e1</replaceable> <literal>*</literal> <replaceable>e2</replaceable>,
|
||||
<emphasis>e1</emphasis> <literal>*</literal> <emphasis>e2</emphasis>,
|
||||
</entry>
|
||||
<entry>left</entry>
|
||||
<entry>Arithmetic multiplication.</entry>
|
||||
|
@ -83,7 +83,7 @@ weakest binding).</para>
|
|||
<row>
|
||||
<entry>Division</entry>
|
||||
<entry>
|
||||
<replaceable>e1</replaceable> <literal>/</literal> <replaceable>e2</replaceable>
|
||||
<emphasis>e1</emphasis> <literal>/</literal> <emphasis>e2</emphasis>
|
||||
</entry>
|
||||
<entry>left</entry>
|
||||
<entry>Arithmetic division.</entry>
|
||||
|
@ -92,7 +92,7 @@ weakest binding).</para>
|
|||
<row>
|
||||
<entry>Addition</entry>
|
||||
<entry>
|
||||
<replaceable>e1</replaceable> <literal>+</literal> <replaceable>e2</replaceable>
|
||||
<emphasis>e1</emphasis> <literal>+</literal> <emphasis>e2</emphasis>
|
||||
</entry>
|
||||
<entry>left</entry>
|
||||
<entry>Arithmetic addition.</entry>
|
||||
|
@ -101,7 +101,7 @@ weakest binding).</para>
|
|||
<row>
|
||||
<entry>Subtraction</entry>
|
||||
<entry>
|
||||
<replaceable>e1</replaceable> <literal>-</literal> <replaceable>e2</replaceable>
|
||||
<emphasis>e1</emphasis> <literal>-</literal> <emphasis>e2</emphasis>
|
||||
</entry>
|
||||
<entry>left</entry>
|
||||
<entry>Arithmetic subtraction.</entry>
|
||||
|
@ -110,7 +110,7 @@ weakest binding).</para>
|
|||
<row>
|
||||
<entry>String Concatenation</entry>
|
||||
<entry>
|
||||
<replaceable>string1</replaceable> <literal>+</literal> <replaceable>string2</replaceable>
|
||||
<emphasis>string1</emphasis> <literal>+</literal> <emphasis>string2</emphasis>
|
||||
</entry>
|
||||
<entry>left</entry>
|
||||
<entry>String concatenation.</entry>
|
||||
|
@ -118,19 +118,19 @@ weakest binding).</para>
|
|||
</row>
|
||||
<row>
|
||||
<entry>Not</entry>
|
||||
<entry><literal>!</literal> <replaceable>e</replaceable></entry>
|
||||
<entry><literal>!</literal> <emphasis>e</emphasis></entry>
|
||||
<entry>none</entry>
|
||||
<entry>Boolean negation.</entry>
|
||||
<entry>8</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Update</entry>
|
||||
<entry><replaceable>e1</replaceable> <literal>//</literal>
|
||||
<replaceable>e2</replaceable></entry>
|
||||
<entry><emphasis>e1</emphasis> <literal>//</literal>
|
||||
<emphasis>e2</emphasis></entry>
|
||||
<entry>right</entry>
|
||||
<entry>Return a set consisting of the attributes in
|
||||
<replaceable>e1</replaceable> and
|
||||
<replaceable>e2</replaceable> (with the latter taking
|
||||
<emphasis>e1</emphasis> and
|
||||
<emphasis>e2</emphasis> (with the latter taking
|
||||
precedence over the former in case of equally named
|
||||
attributes).</entry>
|
||||
<entry>9</entry>
|
||||
|
@ -138,7 +138,7 @@ weakest binding).</para>
|
|||
<row>
|
||||
<entry>Less Than</entry>
|
||||
<entry>
|
||||
<replaceable>e1</replaceable> <literal><</literal> <replaceable>e2</replaceable>,
|
||||
<emphasis>e1</emphasis> <literal><</literal> <emphasis>e2</emphasis>,
|
||||
</entry>
|
||||
<entry>none</entry>
|
||||
<entry>Arithmetic comparison.</entry>
|
||||
|
@ -147,7 +147,7 @@ weakest binding).</para>
|
|||
<row>
|
||||
<entry>Less Than or Equal To</entry>
|
||||
<entry>
|
||||
<replaceable>e1</replaceable> <literal><=</literal> <replaceable>e2</replaceable>
|
||||
<emphasis>e1</emphasis> <literal><=</literal> <emphasis>e2</emphasis>
|
||||
</entry>
|
||||
<entry>none</entry>
|
||||
<entry>Arithmetic comparison.</entry>
|
||||
|
@ -156,7 +156,7 @@ weakest binding).</para>
|
|||
<row>
|
||||
<entry>Greater Than</entry>
|
||||
<entry>
|
||||
<replaceable>e1</replaceable> <literal>></literal> <replaceable>e2</replaceable>
|
||||
<emphasis>e1</emphasis> <literal>></literal> <emphasis>e2</emphasis>
|
||||
</entry>
|
||||
<entry>none</entry>
|
||||
<entry>Arithmetic comparison.</entry>
|
||||
|
@ -165,7 +165,7 @@ weakest binding).</para>
|
|||
<row>
|
||||
<entry>Greater Than or Equal To</entry>
|
||||
<entry>
|
||||
<replaceable>e1</replaceable> <literal>>=</literal> <replaceable>e2</replaceable>
|
||||
<emphasis>e1</emphasis> <literal>>=</literal> <emphasis>e2</emphasis>
|
||||
</entry>
|
||||
<entry>none</entry>
|
||||
<entry>Arithmetic comparison.</entry>
|
||||
|
@ -174,7 +174,7 @@ weakest binding).</para>
|
|||
<row>
|
||||
<entry>Equality</entry>
|
||||
<entry>
|
||||
<replaceable>e1</replaceable> <literal>==</literal> <replaceable>e2</replaceable>
|
||||
<emphasis>e1</emphasis> <literal>==</literal> <emphasis>e2</emphasis>
|
||||
</entry>
|
||||
<entry>none</entry>
|
||||
<entry>Equality.</entry>
|
||||
|
@ -183,7 +183,7 @@ weakest binding).</para>
|
|||
<row>
|
||||
<entry>Inequality</entry>
|
||||
<entry>
|
||||
<replaceable>e1</replaceable> <literal>!=</literal> <replaceable>e2</replaceable>
|
||||
<emphasis>e1</emphasis> <literal>!=</literal> <emphasis>e2</emphasis>
|
||||
</entry>
|
||||
<entry>none</entry>
|
||||
<entry>Inequality.</entry>
|
||||
|
@ -191,28 +191,28 @@ weakest binding).</para>
|
|||
</row>
|
||||
<row>
|
||||
<entry>Logical AND</entry>
|
||||
<entry><replaceable>e1</replaceable> <literal>&&</literal>
|
||||
<replaceable>e2</replaceable></entry>
|
||||
<entry><emphasis>e1</emphasis> <literal>&&</literal>
|
||||
<emphasis>e2</emphasis></entry>
|
||||
<entry>left</entry>
|
||||
<entry>Logical AND.</entry>
|
||||
<entry>12</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Logical OR</entry>
|
||||
<entry><replaceable>e1</replaceable> <literal>||</literal>
|
||||
<replaceable>e2</replaceable></entry>
|
||||
<entry><emphasis>e1</emphasis> <literal>||</literal>
|
||||
<emphasis>e2</emphasis></entry>
|
||||
<entry>left</entry>
|
||||
<entry>Logical OR.</entry>
|
||||
<entry>13</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Logical Implication</entry>
|
||||
<entry><replaceable>e1</replaceable> <literal>-></literal>
|
||||
<replaceable>e2</replaceable></entry>
|
||||
<entry><emphasis>e1</emphasis> <literal>-></literal>
|
||||
<emphasis>e2</emphasis></entry>
|
||||
<entry>none</entry>
|
||||
<entry>Logical implication (equivalent to
|
||||
<literal>!<replaceable>e1</replaceable> ||
|
||||
<replaceable>e2</replaceable></literal>).</entry>
|
||||
<literal>!<emphasis>e1</emphasis> ||
|
||||
<emphasis>e2</emphasis></literal>).</entry>
|
||||
<entry>14</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
<para>You can include the result of an expression into a string by
|
||||
enclosing it in
|
||||
<literal>${<replaceable>...</replaceable>}</literal>, a feature
|
||||
<literal>${<emphasis>...</emphasis>}</literal>, a feature
|
||||
known as <emphasis>antiquotation</emphasis>. The enclosed
|
||||
expression must evaluate to something that can be coerced into a
|
||||
string (meaning that it must be a string, a path, or a
|
||||
|
@ -93,7 +93,7 @@ configureFlags = "
|
|||
text on the initial line.</para>
|
||||
|
||||
<para>Antiquotation
|
||||
(<literal>${<replaceable>expr</replaceable>}</literal>) is
|
||||
(<literal>${<emphasis>expr</emphasis>}</literal>) is
|
||||
supported in indented strings.</para>
|
||||
|
||||
<para>Since <literal>${</literal> and <literal>''</literal> have
|
||||
|
@ -119,7 +119,7 @@ configureFlags = "
|
|||
|
||||
<programlisting>
|
||||
stdenv.mkDerivation {
|
||||
<replaceable>...</replaceable>
|
||||
<emphasis>...</emphasis>
|
||||
postInstall =
|
||||
''
|
||||
mkdir $out/bin $out/etc
|
||||
|
@ -127,7 +127,7 @@ stdenv.mkDerivation {
|
|||
echo "Hello World" > $out/etc/foo.conf
|
||||
${if enableBar then "cp bar $out/bin" else ""}
|
||||
'';
|
||||
<replaceable>...</replaceable>
|
||||
<emphasis>...</emphasis>
|
||||
}
|
||||
</programlisting>
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ building path `/nix/store/632d2b22514d...-hello-2.1.1'
|
|||
hello-2.1.1/
|
||||
hello-2.1.1/intl/
|
||||
hello-2.1.1/intl/ChangeLog
|
||||
<replaceable>...</replaceable>
|
||||
<emphasis>...</emphasis>
|
||||
|
||||
$ ls -l result
|
||||
lrwxrwxrwx ... 2006-09-29 10:43 result -> /nix/store/632d2b22514d...-hello-2.1.1
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
following commands:
|
||||
|
||||
<screen>
|
||||
$ ./configure <replaceable>options...</replaceable>
|
||||
$ ./configure <emphasis>options...</emphasis>
|
||||
$ make
|
||||
$ make install</screen>
|
||||
|
||||
|
@ -26,16 +26,16 @@ $ ./bootstrap.sh</screen>
|
|||
</para>
|
||||
|
||||
<para>The installation path can be specified by passing the
|
||||
<option>--prefix=<replaceable>prefix</replaceable></option> to
|
||||
<option>--prefix=<emphasis>prefix</emphasis></option> to
|
||||
<command>configure</command>. The default installation directory is
|
||||
<filename>/usr/local</filename>. You can change this to any location
|
||||
you like. You must have write permission to the
|
||||
<replaceable>prefix</replaceable> path.</para>
|
||||
<emphasis>prefix</emphasis> path.</para>
|
||||
|
||||
<para>Nix keeps its <emphasis>store</emphasis> (the place where
|
||||
packages are stored) in <filename>/nix/store</filename> by default.
|
||||
This can be changed using
|
||||
<option>--with-store-dir=<replaceable>path</replaceable></option>.</para>
|
||||
<option>--with-store-dir=<emphasis>path</emphasis></option>.</para>
|
||||
|
||||
<warning><para>It is best <emphasis>not</emphasis> to change the Nix
|
||||
store from its default, since doing so makes it impossible to use
|
||||
|
@ -44,6 +44,6 @@ packages will need to be built from source.</para></warning>
|
|||
|
||||
<para>Nix keeps state (such as its database and log files) in
|
||||
<filename>/nix/var</filename> by default. This can be changed using
|
||||
<option>--localstatedir=<replaceable>path</replaceable></option>.</para>
|
||||
<option>--localstatedir=<emphasis>path</emphasis></option>.</para>
|
||||
|
||||
</section>
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
|
||||
<para>To use Nix, some environment variables should be set. In
|
||||
particular, <literal>PATH</literal> should contain the directories
|
||||
<filename><replaceable>prefix</replaceable>/bin</filename> and
|
||||
<filename><emphasis>prefix</emphasis>/bin</filename> and
|
||||
<filename>~/.nix-profile/bin</filename>. The first directory contains
|
||||
the Nix tools themselves, while <filename>~/.nix-profile</filename> is
|
||||
a symbolic link to the current <emphasis>user environment</emphasis>
|
||||
(an automatically generated package consisting of symlinks to
|
||||
installed packages). The simplest way to set the required environment
|
||||
variables is to include the file
|
||||
<filename><replaceable>prefix</replaceable>/etc/profile.d/nix.sh</filename>
|
||||
<filename><emphasis>prefix</emphasis>/etc/profile.d/nix.sh</filename>
|
||||
in your <filename>~/.profile</filename> (or similar), like this:</para>
|
||||
|
||||
<screen>
|
||||
source <replaceable>prefix</replaceable>/etc/profile.d/nix.sh</screen>
|
||||
source <emphasis>prefix</emphasis>/etc/profile.d/nix.sh</screen>
|
||||
|
||||
<section xml:id="sec-nix-ssl-cert-file">
|
||||
|
||||
|
|
|
@ -421,7 +421,7 @@ LABEL=Nix\040Store /nix apfs rw,nobrowse
|
|||
<para>
|
||||
NixOS.org hosts version-specific installation URLs for all Nix
|
||||
versions since 1.11.16, at
|
||||
<literal>https://releases.nixos.org/nix/nix-<replaceable>version</replaceable>/install</literal>.
|
||||
<literal>https://releases.nixos.org/nix/nix-<emphasis>version</emphasis>/install</literal>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
<title>Single-User Mode</title>
|
||||
|
||||
<para>In single-user mode, all Nix operations that access the database
|
||||
in <filename><replaceable>prefix</replaceable>/var/nix/db</filename>
|
||||
in <filename><emphasis>prefix</emphasis>/var/nix/db</filename>
|
||||
or modify the Nix store in
|
||||
<filename><replaceable>prefix</replaceable>/store</filename> must be
|
||||
<filename><emphasis>prefix</emphasis>/store</filename> must be
|
||||
performed under the user ID that owns those directories. This is
|
||||
typically <systemitem class="username">root</systemitem>. (If you
|
||||
install from RPM packages, that’s in fact the default ownership.)
|
||||
|
|
|
@ -99,7 +99,7 @@ there after an upgrade. This means that you can <emphasis>roll
|
|||
back</emphasis> to the old version:</para>
|
||||
|
||||
<screen>
|
||||
$ nix-env --upgrade <replaceable>some-packages</replaceable>
|
||||
$ nix-env --upgrade <emphasis>some-packages</emphasis>
|
||||
$ nix-env --rollback
|
||||
</screen>
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ docbook-xml-4.5
|
|||
firefox-33.0.2
|
||||
hello-2.9
|
||||
libxslt-1.1.28
|
||||
<replaceable>...</replaceable></screen>
|
||||
<emphasis>...</emphasis></screen>
|
||||
|
||||
</para></step>
|
||||
|
||||
|
|
|
@ -74,10 +74,10 @@ then you need to pass the path to your Nixpkgs tree using the
|
|||
<option>-f</option> flag:
|
||||
|
||||
<screen>
|
||||
$ nix-env -qaf <replaceable>/path/to/nixpkgs</replaceable>
|
||||
$ nix-env -qaf <emphasis>/path/to/nixpkgs</emphasis>
|
||||
</screen>
|
||||
|
||||
where <replaceable>/path/to/nixpkgs</replaceable> is where you’ve
|
||||
where <emphasis>/path/to/nixpkgs</emphasis> is where you’ve
|
||||
unpacked or checked out Nixpkgs.</para>
|
||||
|
||||
<para>You can select specific packages by name:
|
||||
|
|
|
@ -45,7 +45,7 @@ $ nix-channel --remove nixpkgs
|
|||
$ nix-channel --update</screen>
|
||||
|
||||
This downloads and unpacks the Nix expressions in every channel
|
||||
(downloaded from <literal><replaceable>url</replaceable>/nixexprs.tar.bz2</literal>).
|
||||
(downloaded from <literal><emphasis>url</emphasis>/nixexprs.tar.bz2</literal>).
|
||||
It also makes the union of each channel’s Nix expressions available by
|
||||
default to <command>nix-env</command> operations (via the symlink
|
||||
<filename>~/.nix-defexpr/channels</filename>). Consequently, you can
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<para>The roots of the garbage collector are all store paths to which
|
||||
there are symlinks in the directory
|
||||
<filename><replaceable>prefix</replaceable>/nix/var/nix/gcroots</filename>.
|
||||
<filename><emphasis>prefix</emphasis>/nix/var/nix/gcroots</filename>.
|
||||
For instance, the following command makes the path
|
||||
<filename>/nix/store/d718ef...-foo</filename> a root of the collector:
|
||||
|
||||
|
@ -20,7 +20,7 @@ That is, after this command, the garbage collector will not remove
|
|||
dependencies.</para>
|
||||
|
||||
<para>Subdirectories of
|
||||
<filename><replaceable>prefix</replaceable>/nix/var/nix/gcroots</filename>
|
||||
<filename><emphasis>prefix</emphasis>/nix/var/nix/gcroots</filename>
|
||||
are also searched for symlinks. Symlinks to non-store paths are
|
||||
followed and searched for roots, but symlinks to non-store paths
|
||||
<emphasis>inside</emphasis> the paths reached in that way are not
|
||||
|
|
|
@ -118,7 +118,7 @@ can also see all available generations:
|
|||
$ nix-env --list-generations</screen></para>
|
||||
|
||||
<para>You generally wouldn’t have
|
||||
<filename>/nix/var/nix/profiles/<replaceable>some-profile</replaceable>/bin</filename>
|
||||
<filename>/nix/var/nix/profiles/<emphasis>some-profile</emphasis>/bin</filename>
|
||||
in your <literal>PATH</literal>. Rather, there is a symlink
|
||||
<filename>~/.nix-profile</filename> that points to your current
|
||||
profile. This means that you should put
|
||||
|
|
|
@ -46,9 +46,9 @@ irreversible.</para></warning>
|
|||
<literal>\*</literal>.</para></listitem>
|
||||
|
||||
<listitem><para><literal>nix-env -i
|
||||
<replaceable>pkgname</replaceable></literal> will now install
|
||||
<emphasis>pkgname</emphasis></literal> will now install
|
||||
the highest available version of
|
||||
<replaceable>pkgname</replaceable>, rather than installing all
|
||||
<emphasis>pkgname</emphasis>, rather than installing all
|
||||
available versions (which would probably give collisions)
|
||||
(<literal>NIX-31</literal>).</para></listitem>
|
||||
|
||||
|
@ -85,7 +85,7 @@ irreversible.</para></warning>
|
|||
"--with-freetype2-library=${freetype}/lib"</programlisting>
|
||||
|
||||
You can write arbitrary expressions within
|
||||
<literal>${<replaceable>...</replaceable>}</literal>, not just
|
||||
<literal>${<emphasis>...</emphasis>}</literal>, not just
|
||||
identifiers.</para></listitem>
|
||||
|
||||
<listitem><para>Multi-line string literals.</para></listitem>
|
||||
|
@ -163,7 +163,7 @@ irreversible.</para></warning>
|
|||
attribute set are unique.) For instance, a quick way to perform a
|
||||
test build of a package in Nixpkgs is <literal>nix-build
|
||||
pkgs/top-level/all-packages.nix -A
|
||||
<replaceable>foo</replaceable></literal>. <literal>nix-env -q
|
||||
<emphasis>foo</emphasis></literal>. <literal>nix-env -q
|
||||
--attr</literal> shows the attribute names corresponding to each
|
||||
derivation.</para></listitem>
|
||||
|
||||
|
@ -173,13 +173,13 @@ irreversible.</para></warning>
|
|||
<command>nix-build</command> evaluates to a function whose arguments
|
||||
all have default values, the function will be called automatically.
|
||||
Also, the new command-line switch <option>--arg
|
||||
<replaceable>name</replaceable>
|
||||
<replaceable>value</replaceable></option> can be used to specify
|
||||
<emphasis>name</emphasis>
|
||||
<emphasis>value</emphasis></option> can be used to specify
|
||||
function arguments on the command line.</para></listitem>
|
||||
|
||||
|
||||
<listitem><para><literal>nix-install-package --url
|
||||
<replaceable>URL</replaceable></literal> allows a package to be
|
||||
<emphasis>URL</emphasis></literal> allows a package to be
|
||||
installed directly from the given URL.</para></listitem>
|
||||
|
||||
|
||||
|
@ -192,7 +192,7 @@ irreversible.</para></warning>
|
|||
|
||||
|
||||
<listitem><para><literal>nix-build -o
|
||||
<replaceable>symlink</replaceable></literal> allows the symlink to
|
||||
<emphasis>symlink</emphasis></literal> allows the symlink to
|
||||
the build result to be named something other than
|
||||
<literal>result</literal>.</para></listitem>
|
||||
|
||||
|
|
|
@ -59,17 +59,17 @@ $ rm __db* log.* derivers references referrers reserved validpaths DB_CONFIG</sc
|
|||
|
||||
<listitem><para>The garbage collector has a number of new options to
|
||||
allow only some of the garbage to be deleted. The option
|
||||
<option>--max-freed <replaceable>N</replaceable></option> tells the
|
||||
collector to stop after at least <replaceable>N</replaceable> bytes
|
||||
<option>--max-freed <emphasis>N</emphasis></option> tells the
|
||||
collector to stop after at least <emphasis>N</emphasis> bytes
|
||||
have been deleted. The option <option>--max-links
|
||||
<replaceable>N</replaceable></option> tells it to stop after the
|
||||
<emphasis>N</emphasis></option> tells it to stop after the
|
||||
link count on <filename>/nix/store</filename> has dropped below
|
||||
<replaceable>N</replaceable>. This is useful for very large Nix
|
||||
<emphasis>N</emphasis>. This is useful for very large Nix
|
||||
stores on filesystems with a 32000 subdirectories limit (like
|
||||
<literal>ext3</literal>). The option <option>--use-atime</option>
|
||||
causes store paths to be deleted in order of ascending last access
|
||||
time. This allows non-recently used stuff to be deleted. The
|
||||
option <option>--max-atime <replaceable>time</replaceable></option>
|
||||
option <option>--max-atime <emphasis>time</emphasis></option>
|
||||
specifies an upper limit to the last accessed time of paths that may
|
||||
be deleted. For instance,
|
||||
|
||||
|
@ -119,7 +119,7 @@ the following paths will be downloaded/copied (30.02 MiB):
|
|||
<listitem><para>@-patterns as in Haskell. For instance, in a
|
||||
function definition
|
||||
|
||||
<programlisting>f = args @ {x, y, z}: <replaceable>...</replaceable>;</programlisting>
|
||||
<programlisting>f = args @ {x, y, z}: <emphasis>...</emphasis>;</programlisting>
|
||||
|
||||
<varname>args</varname> refers to the argument as a whole, which
|
||||
is further pattern-matched against the attribute set pattern
|
||||
|
@ -131,7 +131,7 @@ the following paths will be downloaded/copied (30.02 MiB):
|
|||
takes <emphasis>at least</emphasis> the listed attributes, while
|
||||
ignoring additional attributes. For instance,
|
||||
|
||||
<programlisting>{stdenv, fetchurl, fuse, ...}: <replaceable>...</replaceable></programlisting>
|
||||
<programlisting>{stdenv, fetchurl, fuse, ...}: <emphasis>...</emphasis></programlisting>
|
||||
|
||||
defines a function that accepts any attribute set that includes
|
||||
at least the three listed attributes.</para></listitem>
|
||||
|
@ -163,7 +163,7 @@ the following paths will be downloaded/copied (30.02 MiB):
|
|||
<command>nix-pack-closure</command> and
|
||||
<command>nix-unpack-closure</command>. You can do almost the same
|
||||
thing but much more efficiently by doing <literal>nix-store --export
|
||||
$(nix-store -qR <replaceable>paths</replaceable>) > closure</literal> and
|
||||
$(nix-store -qR <emphasis>paths</emphasis>) > closure</literal> and
|
||||
<literal>nix-store --import <
|
||||
closure</literal>.</para></listitem>
|
||||
|
||||
|
|
|
@ -95,9 +95,9 @@ features:</para>
|
|||
|
||||
<listitem>
|
||||
<para>The scoping rules for <literal>inherit
|
||||
(<replaceable>e</replaceable>) ...</literal> in recursive
|
||||
(<emphasis>e</emphasis>) ...</literal> in recursive
|
||||
attribute sets have changed. The expression
|
||||
<replaceable>e</replaceable> can now refer to the attributes
|
||||
<emphasis>e</emphasis> can now refer to the attributes
|
||||
defined in the containing set.</para>
|
||||
</listitem>
|
||||
|
||||
|
|
|
@ -27,14 +27,14 @@
|
|||
2</command>), but this was not desirable because the number of
|
||||
actions to be performed in parallel was not configurable. Nix
|
||||
now has an option <option>--cores
|
||||
<replaceable>N</replaceable></option> as well as a configuration
|
||||
<emphasis>N</emphasis></option> as well as a configuration
|
||||
setting <varname>build-cores =
|
||||
<replaceable>N</replaceable></varname> that causes the
|
||||
<emphasis>N</emphasis></varname> that causes the
|
||||
environment variable <literal>NIX_BUILD_CORES</literal> to be set to
|
||||
<replaceable>N</replaceable> when the builder is invoked. The
|
||||
<emphasis>N</emphasis> when the builder is invoked. The
|
||||
builder can use this at its discretion to perform a parallel
|
||||
build, e.g., by calling <command>make -j
|
||||
<replaceable>N</replaceable></command>. In Nixpkgs, this can be
|
||||
<emphasis>N</emphasis></command>. In Nixpkgs, this can be
|
||||
enabled on a per-package basis by setting the derivation
|
||||
attribute <varname>enableParallelBuilding</varname> to
|
||||
<literal>true</literal>.
|
||||
|
|
|
@ -91,10 +91,10 @@
|
|||
<itemizedlist>
|
||||
|
||||
<listitem><para>New language construct: <literal>with
|
||||
<replaceable>E1</replaceable>;
|
||||
<replaceable>E2</replaceable></literal> brings all attributes
|
||||
defined in the attribute set <replaceable>E1</replaceable> in
|
||||
scope in <replaceable>E2</replaceable>.</para></listitem>
|
||||
<emphasis>E1</emphasis>;
|
||||
<emphasis>E2</emphasis></literal> brings all attributes
|
||||
defined in the attribute set <emphasis>E1</emphasis> in
|
||||
scope in <emphasis>E2</emphasis>.</para></listitem>
|
||||
|
||||
<listitem><para>Added a <function>map</function>
|
||||
function.</para></listitem>
|
||||
|
|
|
@ -33,7 +33,7 @@ is too old (i.e., for Nix <= 0.7)</screen>
|
|||
|
||||
then you should unsubscribe from the offending channel
|
||||
(<command>nix-channel --remove
|
||||
<replaceable>URL</replaceable></command>; leave out
|
||||
<emphasis>URL</emphasis></command>; leave out
|
||||
<literal>/MANIFEST</literal>), and subscribe to the same URL, with
|
||||
<literal>channels</literal> replaced by <literal>channels-v3</literal>
|
||||
(e.g., <link
|
||||
|
@ -118,7 +118,7 @@ $ nix-store -q --referrers-closure \
|
|||
subscribing to a channel.</para></listitem>
|
||||
|
||||
<listitem><para><command>nix-store -r
|
||||
<replaceable>PATHS</replaceable></command> now builds all the
|
||||
<emphasis>PATHS</emphasis></command> now builds all the
|
||||
derivations PATHS in parallel. Previously it did them sequentially
|
||||
(though exploiting possible parallelism between subderivations).
|
||||
This is nice for build farms.</para></listitem>
|
||||
|
|
|
@ -72,8 +72,8 @@
|
|||
to get rid of the bootstrap binaries in the Nixpkgs source tree
|
||||
and download them instead. You can use it by doing
|
||||
<literal>import <nix/fetchurl.nix> { url =
|
||||
<replaceable>url</replaceable>; sha256 =
|
||||
"<replaceable>hash</replaceable>"; }</literal>. (Shea Levy)</para>
|
||||
<emphasis>url</emphasis>; sha256 =
|
||||
"<emphasis>hash</emphasis>"; }</literal>. (Shea Levy)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
|
|
@ -62,8 +62,8 @@ $ nix-prefetch-url -A nix-repl.src
|
|||
<listitem>
|
||||
<para>
|
||||
The new flag <option>--option build-repeat
|
||||
<replaceable>N</replaceable></option> will cause every build to
|
||||
be executed <replaceable>N</replaceable>+1 times. If the build
|
||||
<emphasis>N</emphasis></option> will cause every build to
|
||||
be executed <emphasis>N</emphasis>+1 times. If the build
|
||||
output differs between any round, the build is rejected, and the
|
||||
output paths are not registered as valid. This is primarily
|
||||
useful to verify build determinism. (We already had a
|
||||
|
@ -78,11 +78,11 @@ $ nix-prefetch-url -A nix-repl.src
|
|||
<listitem>
|
||||
<para>
|
||||
The options <option>--check</option> and <option>--option
|
||||
build-repeat <replaceable>N</replaceable></option>, if they
|
||||
build-repeat <emphasis>N</emphasis></option>, if they
|
||||
detect a difference between two runs of the same derivation and
|
||||
<option>-K</option> is given, will make the output of the other
|
||||
run available under
|
||||
<filename><replaceable>store-path</replaceable>-check</filename>. This
|
||||
<filename><emphasis>store-path</emphasis>-check</filename>. This
|
||||
makes it easier to investigate the non-determinism using tools
|
||||
like <command>diffoscope</command>, e.g.,
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ outputs = [ "lib" "headers" "doc" ];
|
|||
<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>,
|
||||
<literal><emphasis>pkg</emphasis>.<emphasis>output</emphasis></literal>,
|
||||
e.g.
|
||||
<programlisting>
|
||||
buildInputs = [ pkg.lib pkg.headers ];
|
||||
|
|
|
@ -20,8 +20,8 @@ xlink:href="https://github.com/NixOS/nix/commit/5526a282b5b44e9296e61e07d7d2626a
|
|||
<function>builtins.hashString</function>.</para></listitem>
|
||||
|
||||
<listitem><para>Build logs are now stored in
|
||||
<filename>/nix/var/log/nix/drvs/<replaceable>XX</replaceable>/</filename>,
|
||||
where <replaceable>XX</replaceable> is the first two characters of
|
||||
<filename>/nix/var/log/nix/drvs/<emphasis>XX</emphasis>/</filename>,
|
||||
where <emphasis>XX</emphasis> is the first two characters of
|
||||
the derivation. This is useful on machines that keep a lot of build
|
||||
logs (such as Hydra servers).</para></listitem>
|
||||
|
||||
|
|
|
@ -19,15 +19,15 @@ are:</para>
|
|||
|
||||
<listitem>
|
||||
<para>Previously, Nix optimised expressions such as
|
||||
<literal>"${<replaceable>expr</replaceable>}"</literal> to
|
||||
<replaceable>expr</replaceable>. Thus it neither checked whether
|
||||
<replaceable>expr</replaceable> could be coerced to a string, nor
|
||||
<literal>"${<emphasis>expr</emphasis>}"</literal> to
|
||||
<emphasis>expr</emphasis>. Thus it neither checked whether
|
||||
<emphasis>expr</emphasis> could be coerced to a string, nor
|
||||
applied such coercions. This meant that
|
||||
<literal>"${123}"</literal> evaluatued to <literal>123</literal>,
|
||||
and <literal>"${./foo}"</literal> evaluated to
|
||||
<literal>./foo</literal> (even though
|
||||
<literal>"${./foo} "</literal> evaluates to
|
||||
<literal>"/nix/store/<replaceable>hash</replaceable>-foo "</literal>).
|
||||
<literal>"/nix/store/<emphasis>hash</emphasis>-foo "</literal>).
|
||||
Nix now checks the type of antiquoted expressions and
|
||||
applies coercions.</para>
|
||||
</listitem>
|
||||
|
|
|
@ -34,7 +34,7 @@ following new features:</para>
|
|||
<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
|
||||
<emphasis>user@hostname</emphasis></literal> will cause Nix
|
||||
to download binaries from the specified machine, if it has
|
||||
them.</para>
|
||||
</listitem>
|
||||
|
@ -49,9 +49,9 @@ following new features:</para>
|
|||
|
||||
<screen>
|
||||
$ nix-build '<nixpkgs>' -A patchelf
|
||||
<replaceable>…</replaceable>
|
||||
<emphasis>…</emphasis>
|
||||
$ nix-build '<nixpkgs>' -A patchelf --check
|
||||
<replaceable>…</replaceable>
|
||||
<emphasis>…</emphasis>
|
||||
error: derivation `/nix/store/1ipvxs…-patchelf-0.6' may not be deterministic:
|
||||
hash mismatch in output `/nix/store/4pc1dm…-patchelf-0.6.drv'
|
||||
</screen>
|
||||
|
@ -173,11 +173,11 @@ $ nix-instantiate --eval '<nixos>' -A 'config.systemd.units."nscd.service".te
|
|||
<listitem>
|
||||
<para><command>nix-collect-garbage</command> has a new flag
|
||||
<option>--delete-older-than</option>
|
||||
<replaceable>N</replaceable><literal>d</literal>, which deletes
|
||||
<emphasis>N</emphasis><literal>d</literal>, which deletes
|
||||
all user environment generations older than
|
||||
<replaceable>N</replaceable> days. Likewise, <command>nix-env
|
||||
<emphasis>N</emphasis> days. Likewise, <command>nix-env
|
||||
--delete-generations</command> accepts a
|
||||
<replaceable>N</replaceable><literal>d</literal> age limit.</para>
|
||||
<emphasis>N</emphasis><literal>d</literal> age limit.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
|
|
@ -38,8 +38,8 @@ log-servers = http://hydra.nixos.org/log
|
|||
</programlisting>
|
||||
|
||||
then it will try to get logs from
|
||||
<literal>http://hydra.nixos.org/log/<replaceable>base name of the
|
||||
store path</replaceable></literal>. This allows you to do things like:
|
||||
<literal>http://hydra.nixos.org/log/<emphasis>base name of the
|
||||
store path</emphasis></literal>. This allows you to do things like:
|
||||
|
||||
<screen>
|
||||
$ nix-store -l $(which xterm)
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<para>The command <command>nix-push</command> has been removed as
|
||||
part of the effort to eliminate Nix's dependency on Perl. You can
|
||||
use <command>nix copy</command> instead, e.g. <literal>nix copy
|
||||
--to file:///tmp/my-binary-cache <replaceable>paths…</replaceable></literal></para>
|
||||
--to file:///tmp/my-binary-cache <emphasis>paths…</emphasis></literal></para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
@ -136,8 +136,8 @@
|
|||
http-connections 100</literal> you can write
|
||||
<literal>--http-connections 100</literal>. Boolean options can
|
||||
be written as
|
||||
<literal>--<replaceable>foo</replaceable></literal> or
|
||||
<literal>--no-<replaceable>foo</replaceable></literal>
|
||||
<literal>--<emphasis>foo</emphasis></literal> or
|
||||
<literal>--no-<emphasis>foo</emphasis></literal>
|
||||
(e.g. <option>--no-auto-optimise-store</option>).</para>
|
||||
</listitem>
|
||||
|
||||
|
@ -551,7 +551,7 @@
|
|||
is still supported for compatibility, but it is also possible to
|
||||
specify builders in <command>nix.conf</command> by setting the
|
||||
option <literal>builders =
|
||||
@<replaceable>path</replaceable></literal>.</para>
|
||||
@<emphasis>path</emphasis></literal>.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
@ -580,9 +580,9 @@
|
|||
|
||||
<listitem>
|
||||
<para>You can now use
|
||||
<uri>channel:<replaceable>channel-name</replaceable></uri> as a
|
||||
<uri>channel:<emphasis>channel-name</emphasis></uri> as a
|
||||
short-hand for
|
||||
<uri>https://nixos.org/channels/<replaceable>channel-name</replaceable>/nixexprs.tar.xz</uri>. For
|
||||
<uri>https://nixos.org/channels/<emphasis>channel-name</emphasis>/nixexprs.tar.xz</uri>. For
|
||||
example, <literal>nix-build channel:nixos-15.09 -A hello</literal>
|
||||
will build the GNU Hello package from the
|
||||
<literal>nixos-15.09</literal> channel. In the future, this may
|
||||
|
|
|
@ -28,8 +28,8 @@ By default Nix reads settings from the following places:
|
|||
The configuration files consist of `name =
|
||||
value` pairs, one per line. Other files can be included with a line like
|
||||
`include
|
||||
path`, where path is interpreted relative to the current conf file and a
|
||||
missing file is an error unless `!include` is used instead. Comments
|
||||
path`, where *path* is interpreted relative to the current conf file and
|
||||
a missing file is an error unless `!include` is used instead. Comments
|
||||
start with a `#` character. Here is an example configuration file:
|
||||
|
||||
keep-outputs = true # Nice for developers
|
||||
|
@ -216,7 +216,7 @@ The following settings are currently available:
|
|||
- `hashed-mirrors`
|
||||
A list of web servers used by `builtins.fetchurl` to obtain files by
|
||||
hash. The default is `http://tarballs.nixos.org/`. Given a hash type
|
||||
ht and a base-16 hash h, Nix will try to download the file from
|
||||
*ht* and a base-16 hash *h*, Nix will try to download the file from
|
||||
`hashed-mirror/ht/h`. This allows files to be downloaded even if
|
||||
they have disappeared from their original URI. For example, given
|
||||
the default mirror `http://tarballs.nixos.org/`, when building the
|
||||
|
@ -504,8 +504,8 @@ The following settings are currently available:
|
|||
A list of paths bind-mounted into Nix sandbox environments. You can
|
||||
use the syntax `target=source` to mount a path in a different
|
||||
location in the sandbox; for instance, `/bin=/nix-bin` will mount
|
||||
the path `/nix-bin` as `/bin` inside the sandbox. If source is
|
||||
followed by `?`, then it is not an error if source does not exist;
|
||||
the path `/nix-bin` as `/bin` inside the sandbox. If *source* is
|
||||
followed by `?`, then it is not an error if *source* does not exist;
|
||||
for example, `/dev/nvidiactl?` specifies that `/dev/nvidiactl` will
|
||||
only be mounted in the sandbox if it exists in the host filesystem.
|
||||
|
||||
|
|
|
@ -43,16 +43,16 @@ paths
|
|||
# Description
|
||||
|
||||
The `nix-build` command builds the derivations described by the Nix
|
||||
expressions in paths. If the build succeeds, it places a symlink to the
|
||||
result in the current directory. The symlink is called `result`. If
|
||||
expressions in *paths*. If the build succeeds, it places a symlink to
|
||||
the result in the current directory. The symlink is called `result`. If
|
||||
there are multiple Nix expressions, or the Nix expressions evaluate to
|
||||
multiple derivations, multiple sequentially numbered symlinks are
|
||||
created (`result`, `result-2`, and so on).
|
||||
|
||||
If no paths are specified, then `nix-build` will use `default.nix` in
|
||||
If no *paths* are specified, then `nix-build` will use `default.nix` in
|
||||
the current directory, if it exists.
|
||||
|
||||
If an element of paths starts with `http://` or `https://`, it is
|
||||
If an element of *paths* starts with `http://` or `https://`, it is
|
||||
interpreted as the URL of a tarball that will be downloaded and unpacked
|
||||
to a temporary location. The tarball must include a single top-level
|
||||
directory containing at least a file named `default.nix`.
|
||||
|
@ -83,9 +83,9 @@ All options not listed here are passed to `nix-store
|
|||
- `--dry-run`
|
||||
Show what store paths would be built or downloaded.
|
||||
|
||||
- `--out-link` / `-o` outlink
|
||||
- `--out-link` / `-o` *outlink*
|
||||
Change the name of the symlink to the output path created from
|
||||
`result` to outlink.
|
||||
`result` to *outlink*.
|
||||
|
||||
The following common options are supported:
|
||||
|
||||
|
|
|
@ -42,25 +42,26 @@ To see the list of official NixOS channels, visit
|
|||
|
||||
This command has the following operations:
|
||||
|
||||
- `--add` url \[name\]
|
||||
Adds a channel named name with URL url to the list of subscribed
|
||||
channels. If name is omitted, it defaults to the last component of
|
||||
url, with the suffixes `-stable` or `-unstable` removed.
|
||||
- `--add` *url* \[*name*\]
|
||||
Adds a channel named *name* with URL *url* to the list of subscribed
|
||||
channels. If *name* is omitted, it defaults to the last component of
|
||||
*url*, with the suffixes `-stable` or `-unstable` removed.
|
||||
|
||||
- `--remove` name
|
||||
Removes the channel named name from the list of subscribed channels.
|
||||
- `--remove` *name*
|
||||
Removes the channel named *name* from the list of subscribed
|
||||
channels.
|
||||
|
||||
- `--list`
|
||||
Prints the names and URLs of all subscribed channels on standard
|
||||
output.
|
||||
|
||||
- `--update` \[names…\]
|
||||
- `--update` \[*names*…\]
|
||||
Downloads the Nix expressions of all subscribed channels (or only
|
||||
those included in names if specified) and makes them the default for
|
||||
`nix-env` operations (by symlinking them from the directory
|
||||
those included in *names* if specified) and makes them the default
|
||||
for `nix-env` operations (by symlinking them from the directory
|
||||
`~/.nix-defexpr`).
|
||||
|
||||
- `--rollback` \[generation\]
|
||||
- `--rollback` \[*generation*\]
|
||||
Reverts the previous call to `nix-channel
|
||||
--update`. Optionally, you can specify a specific channel generation
|
||||
number to restore.
|
||||
|
|
|
@ -33,7 +33,7 @@ additional options: `-d` (`--delete-old`), which deletes all old
|
|||
generations of all profiles in `/nix/var/nix/profiles` by invoking
|
||||
`nix-env --delete-generations old` on all profiles (of course, this
|
||||
makes rollbacks to previous configurations impossible); and
|
||||
`--delete-older-than` period, where period is a value such as `30d`,
|
||||
`--delete-older-than` *period*, where period is a value such as `30d`,
|
||||
which deletes all generations older than the specified number of days in
|
||||
all profiles in `/nix/var/nix/profiles` (except for the generations that
|
||||
were active at that point in time).
|
||||
|
|
|
@ -98,7 +98,7 @@ This section lists the options that are common to all operations. These
|
|||
options are allowed for every subcommand, though they may not always
|
||||
have an effect. See also [???](#sec-common-options).
|
||||
|
||||
- `--file` / `-f` path
|
||||
- `--file` / `-f` *path*
|
||||
Specifies the Nix expression (designated below as the *active Nix
|
||||
expression*) used by the `--install`, `--upgrade`, and `--query
|
||||
--available` operations to obtain derivations. The default is
|
||||
|
@ -109,7 +109,7 @@ have an effect. See also [???](#sec-common-options).
|
|||
unpacked to a temporary location. The tarball must include a single
|
||||
top-level directory containing at least a file named `default.nix`.
|
||||
|
||||
- `--profile` / `-p` path
|
||||
- `--profile` / `-p` *path*
|
||||
Specifies the profile to be used by those operations that operate on
|
||||
a profile (designated below as the *active profile*). A profile is a
|
||||
sequence of user environments called *generations*, one of which is
|
||||
|
@ -125,10 +125,10 @@ have an effect. See also [???](#sec-common-options).
|
|||
[substituted](#gloss-substitute) (i.e., downloaded) and which paths
|
||||
will be built from source (because no substitute is available).
|
||||
|
||||
- `--system-filter` system
|
||||
- `--system-filter` *system*
|
||||
By default, operations such as `--query
|
||||
--available` show derivations matching any platform. This option
|
||||
allows you to use derivations for the specified platform system.
|
||||
allows you to use derivations for the specified platform *system*.
|
||||
|
||||
<!-- end list -->
|
||||
|
||||
|
@ -200,17 +200,17 @@ args
|
|||
|
||||
The install operation creates a new user environment, based on the
|
||||
current generation of the active profile, to which a set of store paths
|
||||
described by args is added. The arguments args map to store paths in a
|
||||
number of possible ways:
|
||||
described by *args* is added. The arguments *args* map to store paths in
|
||||
a number of possible ways:
|
||||
|
||||
- By default, args is a set of derivation names denoting derivations
|
||||
- By default, *args* is a set of derivation names denoting derivations
|
||||
in the active Nix expression. These are realised, and the resulting
|
||||
output paths are installed. Currently installed derivations with a
|
||||
name equal to the name of a derivation being added are removed
|
||||
unless the option `--preserve-installed` is specified.
|
||||
|
||||
If there are multiple derivations matching a name in args that have
|
||||
the same name (e.g., `gcc-3.3.6` and `gcc-4.1.1`), then the
|
||||
If there are multiple derivations matching a name in *args* that
|
||||
have the same name (e.g., `gcc-3.3.6` and `gcc-4.1.1`), then the
|
||||
derivation with the highest *priority* is used. A derivation can
|
||||
define a priority by declaring the `meta.priority` attribute. This
|
||||
attribute should be a number, with a higher value denoting a lower
|
||||
|
@ -230,22 +230,23 @@ number of possible ways:
|
|||
unambiguous. To find out the attribute paths of available packages,
|
||||
use `nix-env -qaP`.
|
||||
|
||||
- If `--from-profile` path is given, args is a set of names denoting
|
||||
installed store paths in the profile path. This is an easy way to
|
||||
copy user environment elements from one profile to another.
|
||||
- If `--from-profile` *path* is given, *args* is a set of names
|
||||
denoting installed store paths in the profile *path*. This is an
|
||||
easy way to copy user environment elements from one profile to
|
||||
another.
|
||||
|
||||
- If `--from-expression` is given, args are Nix
|
||||
- If `--from-expression` is given, *args* are Nix
|
||||
[functions](#ss-functions) that are called with the active Nix
|
||||
expression as their single argument. The derivations returned by
|
||||
those function calls are installed. This allows derivations to be
|
||||
specified in an unambiguous way, which is necessary if there are
|
||||
multiple derivations with the same name.
|
||||
|
||||
- If args are store derivations, then these are
|
||||
- If *args* are store derivations, then these are
|
||||
[realised](#rsec-nix-store-realise), and the resulting output paths
|
||||
are installed.
|
||||
|
||||
- If args are store paths that are not store derivations, then these
|
||||
- If *args* are store paths that are not store derivations, then these
|
||||
are [realised](#rsec-nix-store-realise) and installed.
|
||||
|
||||
- By default all outputs are installed for each derivation. That can
|
||||
|
@ -359,12 +360,12 @@ args
|
|||
The upgrade operation creates a new user environment, based on the
|
||||
current generation of the active profile, in which all store paths are
|
||||
replaced for which there are newer versions in the set of paths
|
||||
described by args. Paths for which there are no newer versions are left
|
||||
untouched; this is not an error. It is also not an error if an element
|
||||
of args matches no installed derivations.
|
||||
described by *args*. Paths for which there are no newer versions are
|
||||
left untouched; this is not an error. It is also not an error if an
|
||||
element of *args* matches no installed derivations.
|
||||
|
||||
For a description of how args is mapped to a set of store paths, see
|
||||
[`--install`](#rsec-nix-env-install). If args describes multiple store
|
||||
For a description of how *args* is mapped to a set of store paths, see
|
||||
[`--install`](#rsec-nix-env-install). If *args* describes multiple store
|
||||
paths with the same symbolic name, only the one with the highest version
|
||||
is installed.
|
||||
|
||||
|
@ -462,7 +463,7 @@ drvnames
|
|||
|
||||
The uninstall operation creates a new user environment, based on the
|
||||
current generation of the active profile, from which the store paths
|
||||
designated by the symbolic names names are removed.
|
||||
designated by the symbolic names *names* are removed.
|
||||
|
||||
## Examples
|
||||
|
||||
|
@ -629,7 +630,7 @@ The query operation displays information about either the store paths
|
|||
that are installed in the current generation of the active profile
|
||||
(`--installed`), or the derivations that are available for installation
|
||||
in the active Nix expression (`--available`). It only prints information
|
||||
about derivations whose symbolic name matches one of names.
|
||||
about derivations whose symbolic name matches one of *names*.
|
||||
|
||||
The derivations are sorted by their `name` attributes.
|
||||
|
||||
|
@ -696,14 +697,14 @@ derivation is shown unless `--no-name` is specified.
|
|||
upgrades for installed packages are available in a Nix expression. A
|
||||
column is added with the following meaning:
|
||||
|
||||
- `<` version
|
||||
- `<` *version*
|
||||
A newer version of the package is available or installed.
|
||||
|
||||
- `=` version
|
||||
- `=` *version*
|
||||
At most the same version of the package is available or
|
||||
installed.
|
||||
|
||||
- `>` version
|
||||
- `>` *version*
|
||||
Only older versions of the package are available or installed.
|
||||
|
||||
- `- ?`
|
||||
|
@ -806,8 +807,8 @@ path
|
|||
|
||||
## Description
|
||||
|
||||
This operation makes path the current profile for the user. That is, the
|
||||
symlink `~/.nix-profile` is made to point to path.
|
||||
This operation makes *path* the current profile for the user. That is,
|
||||
the symlink `~/.nix-profile` is made to point to *path*.
|
||||
|
||||
## Examples
|
||||
|
||||
|
@ -882,9 +883,9 @@ generation
|
|||
|
||||
## Description
|
||||
|
||||
This operation makes generation number generation the current generation
|
||||
of the active profile. That is, if the `profile` is the path to the
|
||||
active profile, then the symlink `profile` is made to point to
|
||||
This operation makes generation number *generation* the current
|
||||
generation of the active profile. That is, if the `profile` is the path
|
||||
to the active profile, then the symlink `profile` is made to point to
|
||||
`profile-generation-link`, which is in turn a symlink to the actual user
|
||||
environment in the Nix store.
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ hash
|
|||
# Description
|
||||
|
||||
The command `nix-hash` computes the cryptographic hash of the contents
|
||||
of each path and prints it on standard output. By default, it computes
|
||||
of each *path* and prints it on standard output. By default, it computes
|
||||
an MD5 hash, but other hash algorithms are available as well. The hash
|
||||
is printed in hexadecimal. To generate the same hash as
|
||||
`nix-prefetch-url` you have to specify multiple arguments, see below for
|
||||
|
@ -55,9 +55,9 @@ path | md5sum`.
|
|||
|
||||
- `--flat`
|
||||
Print the cryptographic hash of the contents of each regular file
|
||||
path. That is, do not compute the hash over the dump of path. The
|
||||
result is identical to that produced by the GNU commands `md5sum`
|
||||
and `sha1sum`.
|
||||
*path*. That is, do not compute the hash over the dump of *path*.
|
||||
The result is identical to that produced by the GNU commands
|
||||
`md5sum` and `sha1sum`.
|
||||
|
||||
- `--base32`
|
||||
Print the hash in a base-32 representation rather than hexadecimal.
|
||||
|
@ -67,17 +67,17 @@ path | md5sum`.
|
|||
- `--truncate`
|
||||
Truncate hashes longer than 160 bits (such as SHA-256) to 160 bits.
|
||||
|
||||
- `--type` hashAlgo
|
||||
- `--type` *hashAlgo*
|
||||
Use the specified cryptographic hash algorithm, which can be one of
|
||||
`md5`, `sha1`, and `sha256`.
|
||||
|
||||
- `--to-base16`
|
||||
Don’t hash anything, but convert the base-32 hash representation
|
||||
hash to hexadecimal.
|
||||
*hash* to hexadecimal.
|
||||
|
||||
- `--to-base32`
|
||||
Don’t hash anything, but convert the hexadecimal hash representation
|
||||
hash to base-32.
|
||||
*hash* to base-32.
|
||||
|
||||
# Examples
|
||||
|
||||
|
|
|
@ -56,19 +56,19 @@ files
|
|||
|
||||
The command `nix-instantiate` generates [store
|
||||
derivations](#gloss-derivation) from (high-level) Nix expressions. It
|
||||
evaluates the Nix expressions in each of files (which defaults to
|
||||
./default.nix). Each top-level expression should evaluate to a
|
||||
evaluates the Nix expressions in each of *files* (which defaults to
|
||||
*./default.nix*). Each top-level expression should evaluate to a
|
||||
derivation, a list of derivations, or a set of derivations. The paths of
|
||||
the resulting store derivations are printed on standard output.
|
||||
|
||||
If files is the character `-`, then a Nix expression will be read from
|
||||
If *files* is the character `-`, then a Nix expression will be read from
|
||||
standard input.
|
||||
|
||||
See also [???](#sec-common-options) for a list of common options.
|
||||
|
||||
# Options
|
||||
|
||||
- `--add-root` path; `--indirect`
|
||||
- `--add-root` *path*; `--indirect`
|
||||
See the [corresponding options](#opt-add-root) in `nix-store`.
|
||||
|
||||
- `--parse`
|
||||
|
|
|
@ -31,9 +31,9 @@ hash
|
|||
# Description
|
||||
|
||||
The command `nix-prefetch-url` downloads the file referenced by the URL
|
||||
url, prints its cryptographic hash, and copies it into the Nix store.
|
||||
The file name in the store is `hash-baseName`, where baseName is
|
||||
everything following the final slash in url.
|
||||
*url*, prints its cryptographic hash, and copies it into the Nix store.
|
||||
The file name in the store is `hash-baseName`, where *baseName* is
|
||||
everything following the final slash in *url*.
|
||||
|
||||
This command is just a convenience for Nix expression writers. Often a
|
||||
Nix expression fetches some source distribution from the network using
|
||||
|
@ -44,10 +44,10 @@ again when you build your Nix expression. Since `fetchurl` uses the same
|
|||
name for the downloaded file as `nix-prefetch-url`, the redundant
|
||||
download can be avoided.
|
||||
|
||||
If hash is specified, then a download is not performed if the Nix store
|
||||
already contains a file with the same hash and base name. Otherwise, the
|
||||
file is downloaded, and an error is signaled if the actual hash of the
|
||||
file does not match the specified hash.
|
||||
If *hash* is specified, then a download is not performed if the Nix
|
||||
store already contains a file with the same hash and base name.
|
||||
Otherwise, the file is downloaded, and an error is signaled if the
|
||||
actual hash of the file does not match the specified hash.
|
||||
|
||||
This command prints the hash on standard output. Additionally, if the
|
||||
option `--print-path` is used, the path of the downloaded file in the
|
||||
|
@ -55,7 +55,7 @@ Nix store is also printed.
|
|||
|
||||
# Options
|
||||
|
||||
- `--type` hashAlgo
|
||||
- `--type` *hashAlgo*
|
||||
Use the specified cryptographic hash algorithm, which can be one of
|
||||
`md5`, `sha1`, and `sha256`.
|
||||
|
||||
|
@ -67,10 +67,10 @@ Nix store is also printed.
|
|||
result to the Nix store. The resulting hash can be used with
|
||||
functions such as Nixpkgs’s `fetchzip` or `fetchFromGitHub`.
|
||||
|
||||
- `--name` name
|
||||
- `--name` *name*
|
||||
Override the name of the file in the Nix store. By default, this is
|
||||
`hash-basename`, where basename is the last component of url.
|
||||
Overriding the name is necessary when basename contains characters
|
||||
`hash-basename`, where *basename* is the last component of *url*.
|
||||
Overriding the name is necessary when *basename* contains characters
|
||||
that are not allowed in Nix store paths.
|
||||
|
||||
# Examples
|
||||
|
|
|
@ -61,14 +61,14 @@ path
|
|||
The command `nix-shell` will build the dependencies of the specified
|
||||
derivation, but not the derivation itself. It will then start an
|
||||
interactive shell in which all environment variables defined by the
|
||||
derivation path have been set to their corresponding values, and the
|
||||
derivation *path* have been set to their corresponding values, and the
|
||||
script `$stdenv/setup` has been sourced. This is useful for reproducing
|
||||
the environment of a derivation for development.
|
||||
|
||||
If path is not given, `nix-shell` defaults to `shell.nix` if it exists,
|
||||
and `default.nix` otherwise.
|
||||
If *path* is not given, `nix-shell` defaults to `shell.nix` if it
|
||||
exists, and `default.nix` otherwise.
|
||||
|
||||
If path starts with `http://` or `https://`, it is interpreted as the
|
||||
If *path* starts with `http://` or `https://`, it is interpreted as the
|
||||
URL of a tarball that will be downloaded and unpacked to a temporary
|
||||
location. The tarball must include a single top-level directory
|
||||
containing at least a file named `default.nix`.
|
||||
|
@ -91,8 +91,8 @@ All options not listed here are passed to `nix-store
|
|||
--realise`, except for `--arg` and `--attr` / `-A` which are passed to
|
||||
`nix-instantiate`. See also [???](#sec-common-options).
|
||||
|
||||
- `--command` cmd
|
||||
In the environment of the derivation, run the shell command cmd.
|
||||
- `--command` *cmd*
|
||||
In the environment of the derivation, run the shell command *cmd*.
|
||||
This command is executed in an interactive shell. (Use `--run` to
|
||||
use a non-interactive shell instead.) However, a call to `exit` is
|
||||
implicitly added to the command, so the shell will exit after
|
||||
|
@ -102,14 +102,14 @@ All options not listed here are passed to `nix-store
|
|||
interactive shell. This can be useful for doing any additional
|
||||
initialisation.
|
||||
|
||||
- `--run` cmd
|
||||
- `--run` *cmd*
|
||||
Like `--command`, but executes the command in a non-interactive
|
||||
shell. This means (among other things) that if you hit Ctrl-C while
|
||||
the command is running, the shell exits.
|
||||
|
||||
- `--exclude` regexp
|
||||
- `--exclude` *regexp*
|
||||
Do not build any dependencies whose store path matches the regular
|
||||
expression regexp. This option may be specified multiple times.
|
||||
expression *regexp*. This option may be specified multiple times.
|
||||
|
||||
- `--pure`
|
||||
If this flag is specified, the environment is almost entirely
|
||||
|
@ -120,19 +120,19 @@ All options not listed here are passed to `nix-store
|
|||
installation) `/etc/bashrc` are still sourced, so any variables set
|
||||
there will affect the interactive shell.
|
||||
|
||||
- `--packages` / `-p` packages…
|
||||
- `--packages` / `-p` *packages*…
|
||||
Set up an environment in which the specified packages are present.
|
||||
The command line arguments are interpreted as attribute names inside
|
||||
the Nix Packages collection. Thus, `nix-shell -p libjpeg openjdk`
|
||||
will start a shell in which the packages denoted by the attribute
|
||||
names `libjpeg` and `openjdk` are present.
|
||||
|
||||
- `-i` interpreter
|
||||
- `-i` *interpreter*
|
||||
The chained script interpreter to be invoked by `nix-shell`. Only
|
||||
applicable in `#!`-scripts (described
|
||||
[below](#ssec-nix-shell-shebang)).
|
||||
|
||||
- `--keep` name
|
||||
- `--keep` *name*
|
||||
When a `--pure` shell is started, keep the listed environment
|
||||
variables.
|
||||
|
||||
|
@ -199,10 +199,10 @@ done by starting the script with the following lines:
|
|||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i real-interpreter -p packages
|
||||
|
||||
where real-interpreter is the “real” script interpreter that will be
|
||||
where *real-interpreter* is the “real” script interpreter that will be
|
||||
invoked by `nix-shell` after it has obtained the dependencies and
|
||||
initialised the environment, and packages are the attribute names of the
|
||||
dependencies in Nixpkgs.
|
||||
initialised the environment, and *packages* are the attribute names of
|
||||
the dependencies in Nixpkgs.
|
||||
|
||||
The lines starting with `#! nix-shell` specify `nix-shell` options (see
|
||||
above). Note that you cannot write `#! /usr/bin/env nix-shell -i ...`
|
||||
|
|
|
@ -37,10 +37,10 @@ options are allowed for every subcommand, though they may not always
|
|||
have an effect. See also [???](#sec-common-options) for a list of common
|
||||
options.
|
||||
|
||||
- `--add-root` path
|
||||
- `--add-root` *path*
|
||||
Causes the result of a realisation (`--realise` and
|
||||
`--force-realise`) to be registered as a root of the garbage
|
||||
collector(see [???](#ssec-gc-roots)). The root is stored in path,
|
||||
collector(see [???](#ssec-gc-roots)). The root is stored in *path*,
|
||||
which must be inside a directory that is scanned for roots by the
|
||||
garbage collector (i.e., typically in a subdirectory of
|
||||
`/nix/var/nix/gcroots/`) *unless* the `--indirect` flag is used.
|
||||
|
@ -56,8 +56,8 @@ options.
|
|||
result in the current directory; such a build result should not be
|
||||
garbage-collected unless the symlink is removed.
|
||||
|
||||
The `--indirect` flag causes a uniquely named symlink to path to be
|
||||
stored in `/nix/var/nix/gcroots/auto/`. For instance,
|
||||
The `--indirect` flag causes a uniquely named symlink to *path* to
|
||||
be stored in `/nix/var/nix/gcroots/auto/`. For instance,
|
||||
|
||||
$ nix-store --add-root /home/eelco/bla/result --indirect -r ...
|
||||
|
||||
|
@ -262,10 +262,11 @@ The following suboperations may be specified:
|
|||
By default, all unreachable paths are deleted. The following options
|
||||
control what gets deleted and in what order:
|
||||
|
||||
- `--max-freed` bytes
|
||||
Keep deleting paths until at least bytes bytes have been deleted,
|
||||
then stop. The argument bytes can be followed by the multiplicative
|
||||
suffix `K`, `M`, `G` or `T`, denoting KiB, MiB, GiB or TiB units.
|
||||
- `--max-freed` *bytes*
|
||||
Keep deleting paths until at least *bytes* bytes have been deleted,
|
||||
then stop. The argument *bytes* can be followed by the
|
||||
multiplicative suffix `K`, `M`, `G` or `T`, denoting KiB, MiB, GiB
|
||||
or TiB units.
|
||||
|
||||
The behaviour of the collector is also influenced by the
|
||||
[`keep-outputs`](#conf-keep-outputs) and
|
||||
|
@ -303,7 +304,7 @@ paths
|
|||
|
||||
## Description
|
||||
|
||||
The operation `--delete` deletes the store paths paths from the Nix
|
||||
The operation `--delete` deletes the store paths *paths* from the Nix
|
||||
store, but only if it is safe to do so; that is, when the path is not
|
||||
reachable from a root of the garbage collector. This means that you can
|
||||
only delete paths that would also be deleted by `nix-store --gc`. Thus,
|
||||
|
@ -379,7 +380,7 @@ The operation `--query` displays various bits of information about the
|
|||
store paths . The queries are described below. At most one query can be
|
||||
specified. The default query is `--outputs`.
|
||||
|
||||
The paths paths may also be symlinks from outside of the Nix store, to
|
||||
The paths *paths* may also be symlinks from outside of the Nix store, to
|
||||
the Nix store. In that case, the query is applied to the target of the
|
||||
symlink.
|
||||
|
||||
|
@ -397,11 +398,11 @@ symlink.
|
|||
|
||||
- `--outputs`
|
||||
Prints out the [output paths](#gloss-output-path) of the store
|
||||
derivations paths. These are the paths that will be produced when
|
||||
derivations *paths*. These are the paths that will be produced when
|
||||
the derivation is built.
|
||||
|
||||
- `--requisites`; `-R`
|
||||
Prints out the [closure](#gloss-closure) of the store path paths.
|
||||
Prints out the [closure](#gloss-closure) of the store path *paths*.
|
||||
|
||||
This query has one option:
|
||||
|
||||
|
@ -419,29 +420,30 @@ symlink.
|
|||
|
||||
- `--references`
|
||||
Prints the set of [references](#gloss-reference) of the store paths
|
||||
paths, that is, their immediate dependencies. (For *all*
|
||||
*paths*, that is, their immediate dependencies. (For *all*
|
||||
dependencies, use `--requisites`.)
|
||||
|
||||
- `--referrers`
|
||||
Prints the set of *referrers* of the store paths paths, that is, the
|
||||
store paths currently existing in the Nix store that refer to one of
|
||||
paths. Note that contrary to the references, the set of referrers is
|
||||
not constant; it can change as store paths are added or removed.
|
||||
Prints the set of *referrers* of the store paths *paths*, that is,
|
||||
the store paths currently existing in the Nix store that refer to
|
||||
one of *paths*. Note that contrary to the references, the set of
|
||||
referrers is not constant; it can change as store paths are added or
|
||||
removed.
|
||||
|
||||
- `--referrers-closure`
|
||||
Prints the closure of the set of store paths paths under the
|
||||
Prints the closure of the set of store paths *paths* under the
|
||||
referrers relation; that is, all store paths that directly or
|
||||
indirectly refer to one of paths. These are all the path currently
|
||||
in the Nix store that are dependent on paths.
|
||||
indirectly refer to one of *paths*. These are all the path currently
|
||||
in the Nix store that are dependent on *paths*.
|
||||
|
||||
- `--deriver`; `-d`
|
||||
Prints the [deriver](#gloss-deriver) of the store paths paths. If
|
||||
Prints the [deriver](#gloss-deriver) of the store paths *paths*. If
|
||||
the path has no deriver (e.g., if it is a source file), or if the
|
||||
deriver is not known (e.g., in the case of a binary-only
|
||||
deployment), the string `unknown-deriver` is printed.
|
||||
|
||||
- `--graph`
|
||||
Prints the references graph of the store paths paths in the format
|
||||
Prints the references graph of the store paths *paths* in the format
|
||||
of the `dot` tool of AT\&T's [Graphviz
|
||||
package](http://www.graphviz.org/). This can be used to visualise
|
||||
dependency graphs. To obtain a build-time dependency graph, apply
|
||||
|
@ -449,40 +451,40 @@ symlink.
|
|||
apply it to an output path.
|
||||
|
||||
- `--tree`
|
||||
Prints the references graph of the store paths paths as a nested
|
||||
Prints the references graph of the store paths *paths* as a nested
|
||||
ASCII tree. References are ordered by descending closure size; this
|
||||
tends to flatten the tree, making it more readable. The query only
|
||||
recurses into a store path when it is first encountered; this
|
||||
prevents a blowup of the tree representation of the graph.
|
||||
|
||||
- `--graphml`
|
||||
Prints the references graph of the store paths paths in the
|
||||
Prints the references graph of the store paths *paths* in the
|
||||
[GraphML](http://graphml.graphdrawing.org/) file format. This can be
|
||||
used to visualise dependency graphs. To obtain a build-time
|
||||
dependency graph, apply this to a store derivation. To obtain a
|
||||
runtime dependency graph, apply it to an output path.
|
||||
|
||||
- `--binding` name; `-b` name
|
||||
Prints the value of the attribute name (i.e., environment variable)
|
||||
of the store derivations paths. It is an error for a derivation to
|
||||
not have the specified attribute.
|
||||
- `--binding` *name*; `-b` *name*
|
||||
Prints the value of the attribute *name* (i.e., environment
|
||||
variable) of the store derivations *paths*. It is an error for a
|
||||
derivation to not have the specified attribute.
|
||||
|
||||
- `--hash`
|
||||
Prints the SHA-256 hash of the contents of the store paths paths
|
||||
Prints the SHA-256 hash of the contents of the store paths *paths*
|
||||
(that is, the hash of the output of `nix-store --dump` on the given
|
||||
paths). Since the hash is stored in the Nix database, this is a fast
|
||||
operation.
|
||||
|
||||
- `--size`
|
||||
Prints the size in bytes of the contents of the store paths paths —
|
||||
to be precise, the size of the output of `nix-store --dump` on the
|
||||
given paths. Note that the actual disk space required by the store
|
||||
paths may be higher, especially on filesystems with large cluster
|
||||
sizes.
|
||||
Prints the size in bytes of the contents of the store paths *paths*
|
||||
— to be precise, the size of the output of `nix-store --dump` on
|
||||
the given paths. Note that the actual disk space required by the
|
||||
store paths may be higher, especially on filesystems with large
|
||||
cluster sizes.
|
||||
|
||||
- `--roots`
|
||||
Prints the garbage collector roots that point, directly or
|
||||
indirectly, at the store paths paths.
|
||||
indirectly, at the store paths *paths*.
|
||||
|
||||
## Examples
|
||||
|
||||
|
@ -708,8 +710,8 @@ path
|
|||
## Description
|
||||
|
||||
The operation `--dump` produces a NAR (Nix ARchive) file containing the
|
||||
contents of the file system tree rooted at path. The archive is written
|
||||
to standard output.
|
||||
contents of the file system tree rooted at *path*. The archive is
|
||||
written to standard output.
|
||||
|
||||
A NAR archive is like a TAR or Zip archive, but it contains only the
|
||||
information that Nix considers important. For instance, timestamps are
|
||||
|
@ -745,8 +747,8 @@ path
|
|||
|
||||
## Description
|
||||
|
||||
The operation `--restore` unpacks a NAR archive to path, which must not
|
||||
already exist. The archive is read from standard input.
|
||||
The operation `--restore` unpacks a NAR archive to *path*, which must
|
||||
not already exist. The archive is read from standard input.
|
||||
|
||||
# Operation `--export`
|
||||
|
||||
|
|
|
@ -44,9 +44,9 @@ Most Nix commands accept the following command-line options:
|
|||
This option may be specified repeatedly. See the previous verbosity
|
||||
levels list.
|
||||
|
||||
- `--log-format` format
|
||||
- `--log-format` *format*
|
||||
This option can be used to change the output of the log format, with
|
||||
format being one of:
|
||||
*format* being one of:
|
||||
|
||||
- raw
|
||||
This is the raw format, as outputted by nix-build.
|
||||
|
@ -68,7 +68,7 @@ Most Nix commands accept the following command-line options:
|
|||
output and error are always written to a log file in
|
||||
`prefix/nix/var/log/nix`.
|
||||
|
||||
- `--max-jobs` / `-j` number
|
||||
- `--max-jobs` / `-j` *number*
|
||||
Sets the maximum number of build jobs that Nix will perform in
|
||||
parallel to the specified number. Specify `auto` to use the number
|
||||
of CPUs in the system. The default is specified by the
|
||||
|
@ -144,7 +144,7 @@ Most Nix commands accept the following command-line options:
|
|||
database. Most Nix operations do need database access, so those
|
||||
operations will fail.
|
||||
|
||||
- `--arg` name value
|
||||
- `--arg` *name* *value*
|
||||
This option is accepted by `nix-env`, `nix-instantiate`, `nix-shell`
|
||||
and `nix-build`. When evaluating Nix expressions, the expression
|
||||
evaluator will automatically try to call functions that it
|
||||
|
@ -153,8 +153,8 @@ Most Nix commands accept the following command-line options:
|
|||
defaultValue }:
|
||||
...`). With `--arg`, you can also call functions that have arguments
|
||||
without a default value (or override a default value). That is, if
|
||||
the evaluator encounters a function with an argument named name, it
|
||||
will call it with value value.
|
||||
the evaluator encounters a function with an argument named *name*,
|
||||
it will call it with value *value*.
|
||||
|
||||
For instance, the top-level `default.nix` in Nixpkgs is actually a
|
||||
function:
|
||||
|
@ -172,18 +172,18 @@ Most Nix commands accept the following command-line options:
|
|||
\"i686-freebsd\"`. (Note that since the argument is a Nix string
|
||||
literal, you have to escape the quotes.)
|
||||
|
||||
- `--argstr` name value
|
||||
- `--argstr` *name* *value*
|
||||
This option is like `--arg`, only the value is not a Nix expression
|
||||
but a string. So instead of `--arg system \"i686-linux\"` (the outer
|
||||
quotes are to keep the shell happy) you can say `--argstr system
|
||||
i686-linux`.
|
||||
|
||||
- `--attr` / `-A` attrPath
|
||||
- `--attr` / `-A` *attrPath*
|
||||
Select an attribute from the top-level Nix expression being
|
||||
evaluated. (`nix-env`, `nix-instantiate`, `nix-build` and
|
||||
`nix-shell` only.) The *attribute path* attrPath is a sequence of
|
||||
`nix-shell` only.) The *attribute path* *attrPath* is a sequence of
|
||||
attribute names separated by dots. For instance, given a top-level
|
||||
Nix expression e, the attribute path `xorg.xorgserver` would cause
|
||||
Nix expression *e*, the attribute path `xorg.xorgserver` would cause
|
||||
the expression `e.xorg.xorgserver` to be used. See [`nix-env
|
||||
--install`](#refsec-nix-env-install-examples) for some concrete
|
||||
examples.
|
||||
|
@ -204,14 +204,14 @@ Most Nix commands accept the following command-line options:
|
|||
use, give your expression to the `nix-shell -p` convenience flag
|
||||
instead.
|
||||
|
||||
- `-I` path
|
||||
- `-I` *path*
|
||||
Add a path to the Nix expression search path. This option may be
|
||||
given multiple times. See the NIX\_PATH\</literal\> environment
|
||||
variable for information on the semantics of the Nix search path.
|
||||
Paths added through `-I` take precedence over `NIX_PATH`.
|
||||
|
||||
- `--option` name value
|
||||
Set the Nix configuration option name to value. This overrides
|
||||
- `--option` *name* *value*
|
||||
Set the Nix configuration option *name* to *value*. This overrides
|
||||
settings in the Nix configuration file (see nix.conf5).
|
||||
|
||||
- `--repair`
|
||||
|
|
|
@ -54,9 +54,9 @@ Derivations can declare some infrequently used optional attributes.
|
|||
attribute should be a list of pairs `[ name1
|
||||
path1 name2
|
||||
path2 ...
|
||||
]`. The references graph of each pathN will be stored in a text file
|
||||
nameN in the temporary build directory. The text files have the
|
||||
format used by `nix-store
|
||||
]`. The references graph of each *pathN* will be stored in a text
|
||||
file *nameN* in the temporary build directory. The text files have
|
||||
the format used by `nix-store
|
||||
--register-validity` (with the deriver fields left empty). For
|
||||
example, when the following derivation is built:
|
||||
|
||||
|
@ -204,9 +204,9 @@ Derivations can declare some infrequently used optional attributes.
|
|||
then when the builder runs, the environment variable `bigPath` will
|
||||
contain the absolute path to a temporary file containing `a very
|
||||
long
|
||||
string`. That is, for any attribute x listed in `passAsFile`, Nix
|
||||
string`. That is, for any attribute *x* listed in `passAsFile`, Nix
|
||||
will pass an environment variable `xPath` holding the path of the
|
||||
file containing the value of attribute x. This is useful when you
|
||||
file containing the value of attribute *x*. This is useful when you
|
||||
need to pass large strings to a builder, since most operating
|
||||
systems impose a limit on the size of the environment (typically, a
|
||||
few hundred kilobyte).
|
||||
|
|
|
@ -9,42 +9,42 @@ scope. Instead, you can access them through the `builtins` built-in
|
|||
value, which is a set that contains all built-in functions and values.
|
||||
For instance, `derivation` is also available as `builtins.derivation`.
|
||||
|
||||
- `abort` s; `builtins.abort` s
|
||||
Abort Nix expression evaluation, print error message s.
|
||||
- `abort` *s*; `builtins.abort` *s*
|
||||
Abort Nix expression evaluation, print error message *s*.
|
||||
|
||||
- `builtins.add` e1 e2
|
||||
Return the sum of the numbers e1 and e2.
|
||||
- `builtins.add` *e1* *e2*
|
||||
Return the sum of the numbers *e1* and *e2*.
|
||||
|
||||
- `builtins.all` pred list
|
||||
Return `true` if the function pred returns `true` for all elements
|
||||
of list, and `false` otherwise.
|
||||
- `builtins.all` *pred* *list*
|
||||
Return `true` if the function *pred* returns `true` for all elements
|
||||
of *list*, and `false` otherwise.
|
||||
|
||||
- `builtins.any` pred list
|
||||
Return `true` if the function pred returns `true` for at least one
|
||||
element of list, and `false` otherwise.
|
||||
- `builtins.any` *pred* *list*
|
||||
Return `true` if the function *pred* returns `true` for at least one
|
||||
element of *list*, and `false` otherwise.
|
||||
|
||||
- `builtins.attrNames` set
|
||||
Return the names of the attributes in the set set in an
|
||||
- `builtins.attrNames` *set*
|
||||
Return the names of the attributes in the set *set* in an
|
||||
alphabetically sorted list. For instance, `builtins.attrNames { y
|
||||
= 1; x = "foo"; }` evaluates to `[ "x" "y" ]`.
|
||||
|
||||
- `builtins.attrValues` set
|
||||
Return the values of the attributes in the set set in the order
|
||||
- `builtins.attrValues` *set*
|
||||
Return the values of the attributes in the set *set* in the order
|
||||
corresponding to the sorted attribute names.
|
||||
|
||||
- `baseNameOf` s
|
||||
Return the *base name* of the string s, that is, everything
|
||||
- `baseNameOf` *s*
|
||||
Return the *base name* of the string *s*, that is, everything
|
||||
following the final slash in the string. This is similar to the GNU
|
||||
`basename` command.
|
||||
|
||||
- `builtins.bitAnd` e1 e2
|
||||
Return the bitwise AND of the integers e1 and e2.
|
||||
- `builtins.bitAnd` *e1* *e2*
|
||||
Return the bitwise AND of the integers *e1* and *e2*.
|
||||
|
||||
- `builtins.bitOr` e1 e2
|
||||
Return the bitwise OR of the integers e1 and e2.
|
||||
- `builtins.bitOr` *e1* *e2*
|
||||
Return the bitwise OR of the integers *e1* and *e2*.
|
||||
|
||||
- `builtins.bitXor` e1 e2
|
||||
Return the bitwise XOR of the integers e1 and e2.
|
||||
- `builtins.bitXor` *e1* *e2*
|
||||
Return the bitwise XOR of the integers *e1* and *e2*.
|
||||
|
||||
- `builtins`
|
||||
The set `builtins` contains all the built-in functions and values.
|
||||
|
@ -56,17 +56,17 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
This allows a Nix expression to fall back gracefully on older Nix
|
||||
installations that don’t have the desired built-in function.
|
||||
|
||||
- `builtins.compareVersions` s1 s2
|
||||
- `builtins.compareVersions` *s1* *s2*
|
||||
Compare two strings representing versions and return `-1` if version
|
||||
s1 is older than version s2, `0` if they are the same, and `1` if s1
|
||||
is newer than s2. The version comparison algorithm is the same as
|
||||
the one used by [`nix-env
|
||||
*s1* is older than version *s2*, `0` if they are the same, and `1`
|
||||
if *s1* is newer than *s2*. The version comparison algorithm is the
|
||||
same as the one used by [`nix-env
|
||||
-u`](#ssec-version-comparisons).
|
||||
|
||||
- `builtins.concatLists` lists
|
||||
- `builtins.concatLists` *lists*
|
||||
Concatenate a list of lists into a single list.
|
||||
|
||||
- `builtins.concatStringsSep` separator list
|
||||
- `builtins.concatStringsSep` *separator* *list*
|
||||
Concatenate a list of strings with a separator between each element,
|
||||
e.g. `concatStringsSep "/"
|
||||
["usr" "local" "bin"] == "usr/local/bin"`
|
||||
|
@ -76,37 +76,37 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
identifier for the Nix installation on which the expression is being
|
||||
evaluated, such as `"i686-linux"` or `"x86_64-darwin"`.
|
||||
|
||||
- `builtins.deepSeq` e1 e2
|
||||
- `builtins.deepSeq` *e1* *e2*
|
||||
This is like `seq
|
||||
e1
|
||||
e2`, except that e1 is evaluated *deeply*: if it’s a list or set,
|
||||
e2`, except that *e1* is evaluated *deeply*: if it’s a list or set,
|
||||
its elements or attributes are also evaluated recursively.
|
||||
|
||||
- `derivation` attrs; `builtins.derivation` attrs
|
||||
- `derivation` *attrs*; `builtins.derivation` *attrs*
|
||||
`derivation` is described in [???](#ssec-derivation).
|
||||
|
||||
- `dirOf` s; `builtins.dirOf` s
|
||||
Return the directory part of the string s, that is, everything
|
||||
- `dirOf` *s*; `builtins.dirOf` *s*
|
||||
Return the directory part of the string *s*, that is, everything
|
||||
before the final slash in the string. This is similar to the GNU
|
||||
`dirname` command.
|
||||
|
||||
- `builtins.div` e1 e2
|
||||
Return the quotient of the numbers e1 and e2.
|
||||
- `builtins.div` *e1* *e2*
|
||||
Return the quotient of the numbers *e1* and *e2*.
|
||||
|
||||
- `builtins.elem` x xs
|
||||
Return `true` if a value equal to x occurs in the list xs, and
|
||||
- `builtins.elem` *x* *xs*
|
||||
Return `true` if a value equal to *x* occurs in the list *xs*, and
|
||||
`false` otherwise.
|
||||
|
||||
- `builtins.elemAt` xs n
|
||||
Return element n from the list xs. Elements are counted starting
|
||||
- `builtins.elemAt` *xs* *n*
|
||||
Return element *n* from the list *xs*. Elements are counted starting
|
||||
from 0. A fatal error occurs if the index is out of bounds.
|
||||
|
||||
- `builtins.fetchurl` url
|
||||
- `builtins.fetchurl` *url*
|
||||
Download the specified URL and return the path of the downloaded
|
||||
file. This function is not available if [restricted evaluation
|
||||
mode](#conf-restrict-eval) is enabled.
|
||||
|
||||
- `fetchTarball` url; `builtins.fetchTarball` url
|
||||
- `fetchTarball` *url*; `builtins.fetchTarball` *url*
|
||||
Download the specified URL, unpack it and return the path of the
|
||||
unpacked tree. The file must be a tape archive (`.tar`) compressed
|
||||
with `gzip`, `bzip2` or `xz`. The top-level path component of the
|
||||
|
@ -142,10 +142,10 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
This function is not available if [restricted evaluation
|
||||
mode](#conf-restrict-eval) is enabled.
|
||||
|
||||
- `builtins.fetchGit` args
|
||||
Fetch a path from git. args can be a URL, in which case the HEAD of
|
||||
the repo at that URL is fetched. Otherwise, it can be an attribute
|
||||
with the following attributes (all except `url` optional):
|
||||
- `builtins.fetchGit` *args*
|
||||
Fetch a path from git. *args* can be a URL, in which case the HEAD
|
||||
of the repo at that URL is fetched. Otherwise, it can be an
|
||||
attribute with the following attributes (all except `url` optional):
|
||||
|
||||
- url
|
||||
The URL of the repo.
|
||||
|
@ -240,11 +240,11 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
>
|
||||
> This behavior is disabled in *Pure evaluation mode*.
|
||||
|
||||
- `builtins.filter` f xs
|
||||
Return a list consisting of the elements of xs for which the
|
||||
function f returns `true`.
|
||||
- `builtins.filter` *f* *xs*
|
||||
Return a list consisting of the elements of *xs* for which the
|
||||
function *f* returns `true`.
|
||||
|
||||
- `builtins.filterSource` e1 e2
|
||||
- `builtins.filterSource` *e1* *e2*
|
||||
This function allows you to copy sources into the Nix store while
|
||||
filtering certain files. For instance, suppose that you want to use
|
||||
the directory `source-dir` as an input to a Nix expression, e.g.
|
||||
|
@ -266,9 +266,9 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
./source-dir;
|
||||
```
|
||||
|
||||
Thus, the first argument e1 must be a predicate function that is
|
||||
Thus, the first argument *e1* must be a predicate function that is
|
||||
called for each regular file, directory or symlink in the source
|
||||
tree e2. If the function returns `true`, the file is copied to the
|
||||
tree *e2*. If the function returns `true`, the file is copied to the
|
||||
Nix store, otherwise it is omitted. The function is called with two
|
||||
arguments. The first is the full path of the file. The second is a
|
||||
string that identifies the type of the file, which is either
|
||||
|
@ -276,19 +276,19 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
kinds of files such as device nodes or fifos — but note that those
|
||||
cannot be copied to the Nix store, so if the predicate returns
|
||||
`true` for them, the copy will fail). If you exclude a directory,
|
||||
the entire corresponding subtree of e2 will be excluded.
|
||||
the entire corresponding subtree of *e2* will be excluded.
|
||||
|
||||
- `builtins.foldl’` op nul list
|
||||
- `builtins.foldl’` *op* *nul* *list*
|
||||
Reduce a list by applying a binary operator, from left to right,
|
||||
e.g. `foldl’ op nul [x0 x1 x2 ...] = op (op
|
||||
(op nul x0) x1) x2) ...`. The operator is applied strictly, i.e.,
|
||||
its arguments are evaluated first. For example, `foldl’ (x: y: x +
|
||||
y) 0 [1 2 3]` evaluates to 6.
|
||||
|
||||
- `builtins.functionArgs` f
|
||||
- `builtins.functionArgs` *f*
|
||||
Return a set containing the names of the formal arguments expected
|
||||
by the function f. The value of each attribute is a Boolean denoting
|
||||
whether the corresponding argument has a default value. For
|
||||
by the function *f*. The value of each attribute is a Boolean
|
||||
denoting whether the corresponding argument has a default value. For
|
||||
instance, `functionArgs ({ x, y ? 123}: ...) = { x = false; y =
|
||||
true; }`.
|
||||
|
||||
|
@ -296,7 +296,7 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
the function. Plain lambdas are not included, e.g. `functionArgs (x:
|
||||
...) = { }`.
|
||||
|
||||
- `builtins.fromJSON` e
|
||||
- `builtins.fromJSON` *e*
|
||||
Convert a JSON string to a Nix value. For example,
|
||||
|
||||
builtins.fromJSON ''{"x": [1, 2, 3], "y": null}''
|
||||
|
@ -304,21 +304,22 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
returns the value `{ x = [ 1 2 3 ]; y = null;
|
||||
}`.
|
||||
|
||||
- `builtins.genList` generator length
|
||||
Generate list of size length, with each element i equal to the value
|
||||
returned by generator `i`. For example,
|
||||
- `builtins.genList` *generator* *length*
|
||||
Generate list of size *length*, with each element *i* equal to the
|
||||
value returned by *generator* `i`. For example,
|
||||
|
||||
builtins.genList (x: x * x) 5
|
||||
|
||||
returns the list `[ 0 1 4 9 16 ]`.
|
||||
|
||||
- `builtins.getAttr` s set
|
||||
`getAttr` returns the attribute named s from set. Evaluation aborts
|
||||
if the attribute doesn’t exist. This is a dynamic version of the `.`
|
||||
operator, since s is an expression rather than an identifier.
|
||||
- `builtins.getAttr` *s* *set*
|
||||
`getAttr` returns the attribute named *s* from *set*. Evaluation
|
||||
aborts if the attribute doesn’t exist. This is a dynamic version of
|
||||
the `.` operator, since *s* is an expression rather than an
|
||||
identifier.
|
||||
|
||||
- `builtins.getEnv` s
|
||||
`getEnv` returns the value of the environment variable s, or an
|
||||
- `builtins.getEnv` *s*
|
||||
`getEnv` returns the value of the environment variable *s*, or an
|
||||
empty string if the variable doesn’t exist. This function should be
|
||||
used with care, as it can introduce all sorts of nasty environment
|
||||
dependencies in your Nix expression.
|
||||
|
@ -328,29 +329,29 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
Packages. (That is, it does a `getEnv "HOME"` to locate the user’s
|
||||
home directory.)
|
||||
|
||||
- `builtins.hasAttr` s set
|
||||
`hasAttr` returns `true` if set has an attribute named s, and
|
||||
- `builtins.hasAttr` *s* *set*
|
||||
`hasAttr` returns `true` if *set* has an attribute named *s*, and
|
||||
`false` otherwise. This is a dynamic version of the `?` operator,
|
||||
since s is an expression rather than an identifier.
|
||||
since *s* is an expression rather than an identifier.
|
||||
|
||||
- `builtins.hashString` type s
|
||||
- `builtins.hashString` *type* *s*
|
||||
Return a base-16 representation of the cryptographic hash of string
|
||||
s. The hash algorithm specified by type must be one of `"md5"`,
|
||||
*s*. The hash algorithm specified by *type* must be one of `"md5"`,
|
||||
`"sha1"`, `"sha256"` or `"sha512"`.
|
||||
|
||||
- `builtins.hashFile` type p
|
||||
- `builtins.hashFile` *type* *p*
|
||||
Return a base-16 representation of the cryptographic hash of the
|
||||
file at path p. The hash algorithm specified by type must be one of
|
||||
`"md5"`, `"sha1"`, `"sha256"` or `"sha512"`.
|
||||
file at path *p*. The hash algorithm specified by *type* must be one
|
||||
of `"md5"`, `"sha1"`, `"sha256"` or `"sha512"`.
|
||||
|
||||
- `builtins.head` list
|
||||
- `builtins.head` *list*
|
||||
Return the first element of a list; abort evaluation if the argument
|
||||
isn’t a list or is an empty list. You can test whether a list is
|
||||
empty by comparing it with `[]`.
|
||||
|
||||
- `import` path; `builtins.import` path
|
||||
Load, parse and return the Nix expression in the file path. If path
|
||||
is a directory, the file ` default.nix
|
||||
- `import` *path*; `builtins.import` *path*
|
||||
Load, parse and return the Nix expression in the file *path*. If
|
||||
*path* is a directory, the file ` default.nix
|
||||
` in that directory is loaded. Evaluation aborts if the file
|
||||
doesn’t exist or contains an incorrect Nix expression. `import`
|
||||
implements Nix’s module system: you can put any Nix expression (such
|
||||
|
@ -361,7 +362,8 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
>
|
||||
> Unlike some languages, `import` is a regular function in Nix.
|
||||
> Paths using the angle bracket syntax (e.g., `
|
||||
> > > > > import` \<foo\>) are normal path values (see [???](#ssec-values)).
|
||||
> > > > > import` *\<foo\>*) are normal path values (see
|
||||
> [???](#ssec-values)).
|
||||
|
||||
A Nix expression loaded by `import` must not contain any *free
|
||||
variables* (identifiers that are not defined in the Nix expression
|
||||
|
@ -393,50 +395,50 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
(The function argument doesn’t have to be called `x` in `foo.nix`;
|
||||
any name would work.)
|
||||
|
||||
- `builtins.intersectAttrs` e1 e2
|
||||
Return a set consisting of the attributes in the set e2 that also
|
||||
exist in the set e1.
|
||||
- `builtins.intersectAttrs` *e1* *e2*
|
||||
Return a set consisting of the attributes in the set *e2* that also
|
||||
exist in the set *e1*.
|
||||
|
||||
- `builtins.isAttrs` e
|
||||
Return `true` if e evaluates to a set, and `false` otherwise.
|
||||
- `builtins.isAttrs` *e*
|
||||
Return `true` if *e* evaluates to a set, and `false` otherwise.
|
||||
|
||||
- `builtins.isList` e
|
||||
Return `true` if e evaluates to a list, and `false` otherwise.
|
||||
- `builtins.isList` *e*
|
||||
Return `true` if *e* evaluates to a list, and `false` otherwise.
|
||||
|
||||
- `builtins.isFunction` e
|
||||
Return `true` if e evaluates to a function, and `false` otherwise.
|
||||
- `builtins.isFunction` *e*
|
||||
Return `true` if *e* evaluates to a function, and `false` otherwise.
|
||||
|
||||
- `builtins.isString` e
|
||||
Return `true` if e evaluates to a string, and `false` otherwise.
|
||||
- `builtins.isString` *e*
|
||||
Return `true` if *e* evaluates to a string, and `false` otherwise.
|
||||
|
||||
- `builtins.isInt` e
|
||||
Return `true` if e evaluates to an int, and `false` otherwise.
|
||||
- `builtins.isInt` *e*
|
||||
Return `true` if *e* evaluates to an int, and `false` otherwise.
|
||||
|
||||
- `builtins.isFloat` e
|
||||
Return `true` if e evaluates to a float, and `false` otherwise.
|
||||
- `builtins.isFloat` *e*
|
||||
Return `true` if *e* evaluates to a float, and `false` otherwise.
|
||||
|
||||
- `builtins.isBool` e
|
||||
Return `true` if e evaluates to a bool, and `false` otherwise.
|
||||
- `builtins.isBool` *e*
|
||||
Return `true` if *e* evaluates to a bool, and `false` otherwise.
|
||||
|
||||
- `builtins.isPath` e
|
||||
Return `true` if e evaluates to a path, and `false` otherwise.
|
||||
- `builtins.isPath` *e*
|
||||
Return `true` if *e* evaluates to a path, and `false` otherwise.
|
||||
|
||||
- `isNull` e; `builtins.isNull` e
|
||||
Return `true` if e evaluates to `null`, and `false` otherwise.
|
||||
- `isNull` *e*; `builtins.isNull` *e*
|
||||
Return `true` if *e* evaluates to `null`, and `false` otherwise.
|
||||
|
||||
> **Warning**
|
||||
>
|
||||
> This function is *deprecated*; just write `e == null` instead.
|
||||
|
||||
- `builtins.length` e
|
||||
Return the length of the list e.
|
||||
- `builtins.length` *e*
|
||||
Return the length of the list *e*.
|
||||
|
||||
- `builtins.lessThan` e1 e2
|
||||
Return `true` if the number e1 is less than the number e2, and
|
||||
`false` otherwise. Evaluation aborts if either e1 or e2 does not
|
||||
- `builtins.lessThan` *e1* *e2*
|
||||
Return `true` if the number *e1* is less than the number *e2*, and
|
||||
`false` otherwise. Evaluation aborts if either *e1* or *e2* does not
|
||||
evaluate to a number.
|
||||
|
||||
- `builtins.listToAttrs` e
|
||||
- `builtins.listToAttrs` *e*
|
||||
Construct a set from a list specifying the names and values of each
|
||||
attribute. Each element of the list should be a set consisting of a
|
||||
string-valued attribute `name` specifying the name of the attribute,
|
||||
|
@ -451,19 +453,20 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
|
||||
{ foo = 123; bar = 456; }
|
||||
|
||||
- `map` f list; `builtins.map` f list
|
||||
Apply the function f to each element in the list list. For example,
|
||||
- `map` *f* *list*; `builtins.map` *f* *list*
|
||||
Apply the function *f* to each element in the list *list*. For
|
||||
example,
|
||||
|
||||
map (x: "foo" + x) [ "bar" "bla" "abc" ]
|
||||
|
||||
evaluates to `[ "foobar" "foobla" "fooabc"
|
||||
]`.
|
||||
|
||||
- `builtins.match` regex str
|
||||
- `builtins.match` *regex* *str*
|
||||
Returns a list if the [extended POSIX regular
|
||||
expression](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04)
|
||||
regex matches str precisely, otherwise returns `null`. Each item in
|
||||
the list is a regex group.
|
||||
*regex* matches *str* precisely, otherwise returns `null`. Each item
|
||||
in the list is a regex group.
|
||||
|
||||
builtins.match "ab" "abc"
|
||||
|
||||
|
@ -481,21 +484,21 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
|
||||
Evaluates to `[ "foo" ]`.
|
||||
|
||||
- `builtins.mul` e1 e2
|
||||
Return the product of the numbers e1 and e2.
|
||||
- `builtins.mul` *e1* *e2*
|
||||
Return the product of the numbers *e1* and *e2*.
|
||||
|
||||
- `builtins.parseDrvName` s
|
||||
Split the string s into a package name and version. The package name
|
||||
is everything up to but not including the first dash followed by a
|
||||
digit, and the version is everything following that dash. The result
|
||||
is returned in a set `{ name, version }`. Thus,
|
||||
- `builtins.parseDrvName` *s*
|
||||
Split the string *s* into a package name and version. The package
|
||||
name is everything up to but not including the first dash followed
|
||||
by a digit, and the version is everything following that dash. The
|
||||
result is returned in a set `{ name, version }`. Thus,
|
||||
`builtins.parseDrvName "nix-0.12pre12876"` returns `{ name = "nix";
|
||||
version = "0.12pre12876";
|
||||
}`.
|
||||
|
||||
- `builtins.path` args
|
||||
- `builtins.path` *args*
|
||||
An enrichment of the built-in path type, based on the attributes
|
||||
present in args. All are optional except `path`:
|
||||
present in *args*. All are optional except `path`:
|
||||
|
||||
- path
|
||||
The underlying path.
|
||||
|
@ -523,20 +526,20 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
providing a hash allows `builtins.path` to be used even when the
|
||||
`pure-eval` nix config option is on.
|
||||
|
||||
- `builtins.pathExists` path
|
||||
Return `true` if the path path exists at evaluation time, and
|
||||
- `builtins.pathExists` *path*
|
||||
Return `true` if the path *path* exists at evaluation time, and
|
||||
`false` otherwise.
|
||||
|
||||
- `builtins.placeholder` output
|
||||
Return a placeholder string for the specified output that will be
|
||||
- `builtins.placeholder` *output*
|
||||
Return a placeholder string for the specified *output* that will be
|
||||
substituted by the corresponding output path at build time. Typical
|
||||
outputs would be `"out"`, `"bin"` or `"dev"`.
|
||||
|
||||
- `builtins.readDir` path
|
||||
Return the contents of the directory path as a set mapping directory
|
||||
entries to the corresponding file type. For instance, if directory
|
||||
`A` contains a regular file `B` and another directory `C`, then
|
||||
`builtins.readDir
|
||||
- `builtins.readDir` *path*
|
||||
Return the contents of the directory *path* as a set mapping
|
||||
directory entries to the corresponding file type. For instance, if
|
||||
directory `A` contains a regular file `B` and another directory `C`,
|
||||
then `builtins.readDir
|
||||
./A` will return the set
|
||||
|
||||
{ B = "regular"; C = "directory"; }
|
||||
|
@ -544,33 +547,33 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
The possible values for the file type are `"regular"`,
|
||||
`"directory"`, `"symlink"` and `"unknown"`.
|
||||
|
||||
- `builtins.readFile` path
|
||||
Return the contents of the file path as a string.
|
||||
- `builtins.readFile` *path*
|
||||
Return the contents of the file *path* as a string.
|
||||
|
||||
- `removeAttrs` set list; `builtins.removeAttrs` set list
|
||||
Remove the attributes listed in list from set. The attributes don’t
|
||||
have to exist in set. For instance,
|
||||
- `removeAttrs` *set* *list*; `builtins.removeAttrs` *set* *list*
|
||||
Remove the attributes listed in *list* from *set*. The attributes
|
||||
don’t have to exist in *set*. For instance,
|
||||
|
||||
removeAttrs { x = 1; y = 2; z = 3; } [ "a" "x" "z" ]
|
||||
|
||||
evaluates to `{ y = 2; }`.
|
||||
|
||||
- `builtins.replaceStrings` from to s
|
||||
Given string s, replace every occurrence of the strings in from with
|
||||
the corresponding string in to. For example,
|
||||
- `builtins.replaceStrings` *from* *to* *s*
|
||||
Given string *s*, replace every occurrence of the strings in *from*
|
||||
with the corresponding string in *to*. For example,
|
||||
|
||||
builtins.replaceStrings ["oo" "a"] ["a" "i"] "foobar"
|
||||
|
||||
evaluates to `"fabir"`.
|
||||
|
||||
- `builtins.seq` e1 e2
|
||||
Evaluate e1, then evaluate and return e2. This ensures that a
|
||||
computation is strict in the value of e1.
|
||||
- `builtins.seq` *e1* *e2*
|
||||
Evaluate *e1*, then evaluate and return *e2*. This ensures that a
|
||||
computation is strict in the value of *e1*.
|
||||
|
||||
- `builtins.sort` comparator list
|
||||
Return list in sorted order. It repeatedly calls the function
|
||||
comparator with two elements. The comparator should return `true` if
|
||||
the first element is less than the second, and `false` otherwise.
|
||||
- `builtins.sort` *comparator* *list*
|
||||
Return *list* in sorted order. It repeatedly calls the function
|
||||
*comparator* with two elements. The comparator should return `true`
|
||||
if the first element is less than the second, and `false` otherwise.
|
||||
For example,
|
||||
|
||||
builtins.sort builtins.lessThan [ 483 249 526 147 42 77 ]
|
||||
|
@ -581,12 +584,12 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
This is a stable sort: it preserves the relative order of elements
|
||||
deemed equal by the comparator.
|
||||
|
||||
- `builtins.split` regex str
|
||||
- `builtins.split` *regex* *str*
|
||||
Returns a list composed of non matched strings interleaved with the
|
||||
lists of the [extended POSIX regular
|
||||
expression](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04)
|
||||
regex matches of str. Each item in the lists of matched sequences is
|
||||
a regex group.
|
||||
*regex* matches of *str*. Each item in the lists of matched
|
||||
sequences is a regex group.
|
||||
|
||||
builtins.split "(a)b" "abc"
|
||||
|
||||
|
@ -604,44 +607,44 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
|
||||
Evaluates to `[ " " [ "FOO" ] " " ]`.
|
||||
|
||||
- `builtins.splitVersion` s
|
||||
- `builtins.splitVersion` *s*
|
||||
Split a string representing a version into its components, by the
|
||||
same version splitting logic underlying the version comparison in
|
||||
[`nix-env -u`](#ssec-version-comparisons).
|
||||
|
||||
- `builtins.stringLength` e
|
||||
Return the length of the string e. If e is not a string, evaluation
|
||||
is aborted.
|
||||
- `builtins.stringLength` *e*
|
||||
Return the length of the string *e*. If *e* is not a string,
|
||||
evaluation is aborted.
|
||||
|
||||
- `builtins.sub` e1 e2
|
||||
Return the difference between the numbers e1 and e2.
|
||||
- `builtins.sub` *e1* *e2*
|
||||
Return the difference between the numbers *e1* and *e2*.
|
||||
|
||||
- `builtins.substring` start len s
|
||||
Return the substring of s from character position start (zero-based)
|
||||
up to but not including start + len. If start is greater than the
|
||||
length of the string, an empty string is returned, and if start +
|
||||
len lies beyond the end of the string, only the substring up to the
|
||||
end of the string is returned. start must be non-negative. For
|
||||
example,
|
||||
- `builtins.substring` *start* *len* *s*
|
||||
Return the substring of *s* from character position *start*
|
||||
(zero-based) up to but not including *start + len*. If *start* is
|
||||
greater than the length of the string, an empty string is returned,
|
||||
and if *start + len* lies beyond the end of the string, only the
|
||||
substring up to the end of the string is returned. *start* must be
|
||||
non-negative. For example,
|
||||
|
||||
builtins.substring 0 3 "nixos"
|
||||
|
||||
evaluates to `"nix"`.
|
||||
|
||||
- `builtins.tail` list
|
||||
- `builtins.tail` *list*
|
||||
Return the second to last elements of a list; abort evaluation if
|
||||
the argument isn’t a list or is an empty list.
|
||||
|
||||
- `throw` s; `builtins.throw` s
|
||||
Throw an error message s. This usually aborts Nix expression
|
||||
- `throw` *s*; `builtins.throw` *s*
|
||||
Throw an error message *s*. This usually aborts Nix expression
|
||||
evaluation, but in `nix-env -qa` and other commands that try to
|
||||
evaluate a set of derivations to get information about those
|
||||
derivations, a derivation that throws an error is silently skipped
|
||||
(which is not the case for `abort`).
|
||||
|
||||
- `builtins.toFile` name s
|
||||
Store the string s in a file in the Nix store and return its path.
|
||||
The file has suffix name. This file can be used as an input to
|
||||
- `builtins.toFile` *name* *s*
|
||||
Store the string *s* in a file in the Nix store and return its path.
|
||||
The file has suffix *name*. This file can be used as an input to
|
||||
derivations. One application is to write builders “inline”. For
|
||||
instance, the following Nix expression combines [???](#ex-hello-nix)
|
||||
and [???](#ex-hello-builder) into one file:
|
||||
|
@ -705,20 +708,20 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
you are using Nixpkgs, the `writeTextFile` function is able to do
|
||||
that.
|
||||
|
||||
- `builtins.toJSON` e
|
||||
Return a string containing a JSON representation of e. Strings,
|
||||
- `builtins.toJSON` *e*
|
||||
Return a string containing a JSON representation of *e*. Strings,
|
||||
integers, floats, booleans, nulls and lists are mapped to their JSON
|
||||
equivalents. Sets (except derivations) are represented as objects.
|
||||
Derivations are translated to a JSON string containing the
|
||||
derivation’s output path. Paths are copied to the store and
|
||||
represented as a JSON string of the resulting store path.
|
||||
|
||||
- `builtins.toPath` s
|
||||
- `builtins.toPath` *s*
|
||||
DEPRECATED. Use `/. + "/path"` to convert a string into an absolute
|
||||
path. For relative paths, use `./. + "/path"`.
|
||||
|
||||
- `toString` e; `builtins.toString` e
|
||||
Convert the expression e to a string. e can be:
|
||||
- `toString` *e*; `builtins.toString` *e*
|
||||
Convert the expression *e* to a string. *e* can be:
|
||||
|
||||
- A string (in which case the string is returned unmodified).
|
||||
|
||||
|
@ -735,8 +738,8 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
|
||||
- `null`, which yields the empty string.
|
||||
|
||||
- `builtins.toXML` e
|
||||
Return a string containing an XML representation of e. The main
|
||||
- `builtins.toXML` *e*
|
||||
Return a string containing an XML representation of *e*. The main
|
||||
application for `toXML` is to communicate information with the
|
||||
builder in a more structured format than plain environment
|
||||
variables.
|
||||
|
@ -822,22 +825,23 @@ For instance, `derivation` is also available as `builtins.derivation`.
|
|||
of the stylesheet is spliced into the builder using the syntax
|
||||
`xsltproc ${stylesheet}`.
|
||||
|
||||
- `builtins.trace` e1 e2
|
||||
Evaluate e1 and print its abstract syntax representation on standard
|
||||
error. Then return e2. This function is useful for debugging.
|
||||
- `builtins.trace` *e1* *e2*
|
||||
Evaluate *e1* and print its abstract syntax representation on
|
||||
standard error. Then return *e2*. This function is useful for
|
||||
debugging.
|
||||
|
||||
- `builtins.tryEval` e
|
||||
Try to shallowly evaluate e. Return a set containing the attributes
|
||||
`success` (`true` if e evaluated successfully, `false` if an error
|
||||
was thrown) and `value`, equalling e if successful and `false`
|
||||
otherwise. Note that this doesn't evaluate e deeply, so ` let e = {
|
||||
x = throw ""; }; in (builtins.tryEval e).success
|
||||
- `builtins.tryEval` *e*
|
||||
Try to shallowly evaluate *e*. Return a set containing the
|
||||
attributes `success` (`true` if *e* evaluated successfully, `false`
|
||||
if an error was thrown) and `value`, equalling *e* if successful and
|
||||
`false` otherwise. Note that this doesn't evaluate *e* deeply, so
|
||||
` let e = { x = throw ""; }; in (builtins.tryEval e).success
|
||||
` will be `true`. Using ` builtins.deepSeq
|
||||
` one can get the expected result: `let e = { x = throw "";
|
||||
}; in (builtins.tryEval (builtins.deepSeq e e)).success` will be
|
||||
`false`.
|
||||
|
||||
- `builtins.typeOf` e
|
||||
Return a string representing the type of the value e, namely
|
||||
- `builtins.typeOf` *e*
|
||||
Return a string representing the type of the value *e*, namely
|
||||
`"int"`, `"bool"`, `"string"`, `"path"`, `"null"`, `"set"`,
|
||||
`"list"`, `"lambda"` or `"float"`.
|
||||
|
|
|
@ -33,7 +33,7 @@ elements (referenced from the figure by number):
|
|||
|
||||
Nix functions generally have the form `{ x, y, ...,
|
||||
z }: e` where `x`, `y`, etc. are the names of the expected
|
||||
arguments, and where e is the body of the function. So here, the
|
||||
arguments, and where *e* is the body of the function. So here, the
|
||||
entire remainder of the file is the body of the function; when given
|
||||
the required arguments, the body should describe how to build an
|
||||
instance of the Hello package.
|
||||
|
|
|
@ -147,7 +147,7 @@ three kinds of patterns:
|
|||
It is possible to provide *default values* for attributes, in which
|
||||
case they are allowed to be missing. A default value is specified by
|
||||
writing `name ?
|
||||
e`, where e is an arbitrary expression. For example,
|
||||
e`, where *e* is an arbitrary expression. For example,
|
||||
|
||||
{ x, y ? "foo", z ? "bar" }: z + y + x
|
||||
|
||||
|
@ -201,7 +201,7 @@ Conditionals look like this:
|
|||
|
||||
if e1 then e2 else e3
|
||||
|
||||
where e1 is an expression that should evaluate to a Boolean value
|
||||
where *e1* is an expression that should evaluate to a Boolean value
|
||||
(`true` or `false`).
|
||||
|
||||
## Assertions
|
||||
|
@ -211,9 +211,9 @@ between features and dependencies hold. They look like this:
|
|||
|
||||
assert e1; e2
|
||||
|
||||
where e1 is an expression that should evaluate to a Boolean value. If it
|
||||
evaluates to `true`, e2 is returned; otherwise expression evaluation is
|
||||
aborted and a backtrace is printed.
|
||||
where *e1* is an expression that should evaluate to a Boolean value. If
|
||||
it evaluates to `true`, *e2* is returned; otherwise expression
|
||||
evaluation is aborted and a backtrace is printed.
|
||||
|
||||
Here is a Nix expression for the Subversion package that shows how
|
||||
assertions can be used:.
|
||||
|
@ -275,8 +275,8 @@ A *with-expression*,
|
|||
|
||||
with e1; e2
|
||||
|
||||
introduces the set e1 into the lexical scope of the expression e2. For
|
||||
instance,
|
||||
introduces the set *e1* into the lexical scope of the expression *e2*.
|
||||
For instance,
|
||||
|
||||
let as = { x = "foo"; y = "bar"; };
|
||||
in with as; x + y
|
||||
|
|
|
@ -4,29 +4,29 @@
|
|||
expression language, in order of precedence (from strongest to weakest
|
||||
binding).
|
||||
|
||||
| Name | Syntax | Associativity | Description | Precedence |
|
||||
| ------------------------ | ----------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
|
||||
| Select | e `.` attrpath \[ `or` def \] | none | Select attribute denoted by the attribute path attrpath from set e. (An attribute path is a dot-separated list of attribute names.) If the attribute doesn’t exist, return def if provided, otherwise abort evaluation. | 1 |
|
||||
| Application | e1 e2 | left | Call function e1 with argument e2. | 2 |
|
||||
| Arithmetic Negation | `-` e | none | Arithmetic negation. | 3 |
|
||||
| Has Attribute | e `?` attrpath | none | Test whether set e contains the attribute denoted by attrpath; return `true` or `false`. | 4 |
|
||||
| List Concatenation | e1 `++` e2 | right | List concatenation. | 5 |
|
||||
| Multiplication | e1 `*` e2, | left | Arithmetic multiplication. | 6 |
|
||||
| Division | e1 `/` e2 | left | Arithmetic division. | 6 |
|
||||
| Addition | e1 `+` e2 | left | Arithmetic addition. | 7 |
|
||||
| Subtraction | e1 `-` e2 | left | Arithmetic subtraction. | 7 |
|
||||
| String Concatenation | string1 `+` string2 | left | String concatenation. | 7 |
|
||||
| Not | `!` e | none | Boolean negation. | 8 |
|
||||
| Update | e1 `//` e2 | right | Return a set consisting of the attributes in e1 and e2 (with the latter taking precedence over the former in case of equally named attributes). | 9 |
|
||||
| Less Than | e1 `<` e2, | none | Arithmetic comparison. | 10 |
|
||||
| Less Than or Equal To | e1 `<=` e2 | none | Arithmetic comparison. | 10 |
|
||||
| Greater Than | e1 `>` e2 | none | Arithmetic comparison. | 10 |
|
||||
| Greater Than or Equal To | e1 `>=` e2 | none | Arithmetic comparison. | 10 |
|
||||
| Equality | e1 `==` e2 | none | Equality. | 11 |
|
||||
| Inequality | e1 `!=` e2 | none | Inequality. | 11 |
|
||||
| Logical AND | e1 `&&` e2 | left | Logical AND. | 12 |
|
||||
| Logical OR | e1 `\|\|` e2 | left | Logical OR. | 13 |
|
||||
| Logical Implication | e1 `->` e2 | none | Logical implication (equivalent to `!e1 \|\|
|
||||
e2`). | 14 |
|
||||
| Name | Syntax | Associativity | Description | Precedence |
|
||||
| ------------------------ | ----------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
|
||||
| Select | *e* `.` *attrpath* \[ `or` *def* \] | none | Select attribute denoted by the attribute path *attrpath* from set *e*. (An attribute path is a dot-separated list of attribute names.) If the attribute doesn’t exist, return *def* if provided, otherwise abort evaluation. | 1 |
|
||||
| Application | *e1* *e2* | left | Call function *e1* with argument *e2*. | 2 |
|
||||
| Arithmetic Negation | `-` *e* | none | Arithmetic negation. | 3 |
|
||||
| Has Attribute | *e* `?` *attrpath* | none | Test whether set *e* contains the attribute denoted by *attrpath*; return `true` or `false`. | 4 |
|
||||
| List Concatenation | *e1* `++` *e2* | right | List concatenation. | 5 |
|
||||
| Multiplication | *e1* `*` *e2*, | left | Arithmetic multiplication. | 6 |
|
||||
| Division | *e1* `/` *e2* | left | Arithmetic division. | 6 |
|
||||
| Addition | *e1* `+` *e2* | left | Arithmetic addition. | 7 |
|
||||
| Subtraction | *e1* `-` *e2* | left | Arithmetic subtraction. | 7 |
|
||||
| String Concatenation | *string1* `+` *string2* | left | String concatenation. | 7 |
|
||||
| Not | `!` *e* | none | Boolean negation. | 8 |
|
||||
| Update | *e1* `//` *e2* | right | Return a set consisting of the attributes in *e1* and *e2* (with the latter taking precedence over the former in case of equally named attributes). | 9 |
|
||||
| Less Than | *e1* `<` *e2*, | none | Arithmetic comparison. | 10 |
|
||||
| Less Than or Equal To | *e1* `<=` *e2* | none | Arithmetic comparison. | 10 |
|
||||
| Greater Than | *e1* `>` *e2* | none | Arithmetic comparison. | 10 |
|
||||
| Greater Than or Equal To | *e1* `>=` *e2* | none | Arithmetic comparison. | 10 |
|
||||
| Equality | *e1* `==` *e2* | none | Equality. | 11 |
|
||||
| Inequality | *e1* `!=` *e2* | none | Inequality. | 11 |
|
||||
| Logical AND | *e1* `&&` *e2* | left | Logical AND. | 12 |
|
||||
| Logical OR | *e1* `\|\|` *e2* | left | Logical OR. | 13 |
|
||||
| Logical Implication | *e1* `->` *e2* | none | Logical implication (equivalent to `!e1 \|\|
|
||||
e2`). | 14 |
|
||||
|
||||
Operators
|
||||
|
|
|
@ -17,7 +17,7 @@ command:
|
|||
The installation path can be specified by passing the `--prefix=prefix`
|
||||
to `configure`. The default installation directory is `/usr/local`. You
|
||||
can change this to any location you like. You must have write permission
|
||||
to the prefix path.
|
||||
to the *prefix* path.
|
||||
|
||||
Nix keeps its *store* (the place where packages are stored) in
|
||||
`/nix/store` by default. This can be changed using
|
||||
|
|
|
@ -60,7 +60,8 @@ Nixpkgs tree using the `-f` flag:
|
|||
|
||||
$ nix-env -qaf /path/to/nixpkgs
|
||||
|
||||
where /path/to/nixpkgs is where you’ve unpacked or checked out Nixpkgs.
|
||||
where */path/to/nixpkgs* is where you’ve unpacked or checked out
|
||||
Nixpkgs.
|
||||
|
||||
You can select specific packages by name:
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
- `nix-env -i
|
||||
pkgname` will now install the highest available version of
|
||||
pkgname, rather than installing all available versions (which
|
||||
*pkgname*, rather than installing all available versions (which
|
||||
would probably give collisions) (`NIX-31`).
|
||||
|
||||
- `nix-env (-i|-u) --dry-run` now shows exactly which missing
|
||||
|
|
|
@ -41,10 +41,10 @@
|
|||
|
||||
- The garbage collector has a number of new options to allow only some
|
||||
of the garbage to be deleted. The option `--max-freed N` tells the
|
||||
collector to stop after at least N bytes have been deleted. The
|
||||
collector to stop after at least *N* bytes have been deleted. The
|
||||
option `--max-links
|
||||
N` tells it to stop after the link count on `/nix/store` has dropped
|
||||
below N. This is useful for very large Nix stores on filesystems
|
||||
below *N*. This is useful for very large Nix stores on filesystems
|
||||
with a 32000 subdirectories limit (like `ext3`). The option
|
||||
`--use-atime` causes store paths to be deleted in order of ascending
|
||||
last access time. This allows non-recently used stuff to be deleted.
|
||||
|
|
|
@ -51,5 +51,5 @@ This is primarily a bug fix release. It has some new features:
|
|||
option is used.
|
||||
|
||||
- The scoping rules for `inherit
|
||||
(e) ...` in recursive attribute sets have changed. The expression e
|
||||
can now refer to the attributes defined in the containing set.
|
||||
(e) ...` in recursive attribute sets have changed. The expression
|
||||
*e* can now refer to the attributes defined in the containing set.
|
||||
|
|
|
@ -15,7 +15,7 @@ This release has the following improvements:
|
|||
`--cores
|
||||
N` as well as a configuration setting `build-cores =
|
||||
N` that causes the environment variable `NIX_BUILD_CORES` to be set
|
||||
to N when the builder is invoked. The builder can use this at its
|
||||
to *N* when the builder is invoked. The builder can use this at its
|
||||
discretion to perform a parallel build, e.g., by calling `make -j
|
||||
N`. In Nixpkgs, this can be enabled on a per-package basis by
|
||||
setting the derivation attribute `enableParallelBuilding` to `true`.
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
|
||||
- New language construct: `with
|
||||
E1;
|
||||
E2` brings all attributes defined in the attribute set E1 in
|
||||
scope in E2.
|
||||
E2` brings all attributes defined in the attribute set *E1* in
|
||||
scope in *E2*.
|
||||
|
||||
- Added a `map` function.
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ features:
|
|||
derivations, and in `builtins.hashString`.
|
||||
|
||||
- The new flag `--option build-repeat
|
||||
N` will cause every build to be executed N+1 times. If the build
|
||||
N` will cause every build to be executed *N*+1 times. If the build
|
||||
output differs between any round, the build is rejected, and the
|
||||
output paths are not registered as valid. This is primarily useful
|
||||
to verify build determinism. (We already had a `--check` option to
|
||||
|
|
|
@ -10,7 +10,7 @@ There are also the following improvements:
|
|||
|
||||
- New built-in function: `builtins.hashString`.
|
||||
|
||||
- Build logs are now stored in `/nix/var/log/nix/drvs/XX/`, where XX
|
||||
- Build logs are now stored in `/nix/var/log/nix/drvs/XX/`, where *XX*
|
||||
is the first two characters of the derivation. This is useful on
|
||||
machines that keep a lot of build logs (such as Hydra servers).
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ This is primarily a bug fix release. Changes of interest are:
|
|||
strings, such as `"${/foo}/bar"`. This release reverts to the Nix
|
||||
1.5.3 behaviour.
|
||||
|
||||
- Previously, Nix optimised expressions such as `"${expr}"` to expr.
|
||||
Thus it neither checked whether expr could be coerced to a string,
|
||||
- Previously, Nix optimised expressions such as `"${expr}"` to *expr*.
|
||||
Thus it neither checked whether *expr* could be coerced to a string,
|
||||
nor applied such coercions. This meant that `"${123}"` evaluatued to
|
||||
`123`, and `"${./foo}"` evaluated to `./foo` (even though `"${./foo}
|
||||
"` evaluates to `"/nix/store/hash-foo "`). Nix now checks the type
|
||||
|
|
|
@ -89,10 +89,10 @@ features:
|
|||
specifier. For example, `nix-store --gc --max-freed
|
||||
1G` will free up to 1 gigabyte of disk space.
|
||||
|
||||
- `nix-collect-garbage` has a new flag `--delete-older-than` N`d`,
|
||||
which deletes all user environment generations older than N days.
|
||||
- `nix-collect-garbage` has a new flag `--delete-older-than` *N*`d`,
|
||||
which deletes all user environment generations older than *N* days.
|
||||
Likewise, `nix-env
|
||||
--delete-generations` accepts a N`d` age limit.
|
||||
--delete-generations` accepts a *N*`d` age limit.
|
||||
|
||||
- Nix now heuristically detects whether a build failure was due to a
|
||||
disk-full condition. In that case, the build is not flagged as
|
||||
|
|
Loading…
Reference in a new issue