mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 15:56:18 +02:00
* Remove references to __XXX primops.
This commit is contained in:
parent
8b2a01a8c2
commit
435a93b5d8
2 changed files with 4 additions and 14 deletions
|
@ -77,18 +77,8 @@ attrValues = attrs: map (name: builtins.getAttr name attrs) (builtins.attrNames
|
||||||
if builtins ? getEnv then builtins.getEnv "PATH" else ""</programlisting>
|
if builtins ? getEnv then builtins.getEnv "PATH" else ""</programlisting>
|
||||||
|
|
||||||
This allows a Nix expression to fall back gracefully on older Nix
|
This allows a Nix expression to fall back gracefully on older Nix
|
||||||
installations that don’t have the desired built-in function.
|
installations that don’t have the desired built-in
|
||||||
However, in that case you should not write
|
function.</para></listitem>
|
||||||
|
|
||||||
<programlisting>
|
|
||||||
if builtins ? getEnv then __getEnv "PATH" else ""</programlisting>
|
|
||||||
|
|
||||||
This Nix expression will trigger an “undefined variable” error on
|
|
||||||
older Nix versions since <function>__getEnv</function> doesn’t
|
|
||||||
exist. <literal>builtins.getEnv</literal>, on the other hand, is
|
|
||||||
safe since <literal>builtins</literal> always exists and attribute
|
|
||||||
selection is lazy, so it’s only performed if the test
|
|
||||||
succeeds.</para></listitem>
|
|
||||||
|
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
|
|
@ -251,14 +251,14 @@
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
{ # The system (e.g., `i686-linux') for which to build the packages.
|
{ # The system (e.g., `i686-linux') for which to build the packages.
|
||||||
system ? __currentSystem
|
system ? builtins.currentSystem
|
||||||
<replaceable>...</replaceable>
|
<replaceable>...</replaceable>
|
||||||
}: <replaceable>...</replaceable></programlisting>
|
}: <replaceable>...</replaceable></programlisting>
|
||||||
|
|
||||||
So if you call this Nix expression (e.g., when you do
|
So if you call this Nix expression (e.g., when you do
|
||||||
<literal>nix-env -i <replaceable>pkgname</replaceable></literal>),
|
<literal>nix-env -i <replaceable>pkgname</replaceable></literal>),
|
||||||
the function will be called automatically using the value <link
|
the function will be called automatically using the value <link
|
||||||
linkend='builtin-currentSystem'><literal>__currentSystem</literal></link>
|
linkend='builtin-currentSystem'><literal>builtins.currentSystem</literal></link>
|
||||||
for the <literal>system</literal> argument. You can override this
|
for the <literal>system</literal> argument. You can override this
|
||||||
using <option>--arg</option>, e.g., <literal>nix-env -i
|
using <option>--arg</option>, e.g., <literal>nix-env -i
|
||||||
<replaceable>pkgname</replaceable> --arg system
|
<replaceable>pkgname</replaceable> --arg system
|
||||||
|
|
Loading…
Reference in a new issue