mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Merge pull request #6762 from lethalman/nixos-install
nixos-install: support -j, --cores and --option. Closes #6755
This commit is contained in:
commit
f72b0c43f6
2 changed files with 55 additions and 3 deletions
|
@ -25,6 +25,22 @@
|
||||||
<arg choice='plain'><option>--root</option></arg>
|
<arg choice='plain'><option>--root</option></arg>
|
||||||
<replaceable>root</replaceable>
|
<replaceable>root</replaceable>
|
||||||
</arg>
|
</arg>
|
||||||
|
<arg>
|
||||||
|
<group choice='req'>
|
||||||
|
<arg choice='plain'><option>--max-jobs</option></arg>
|
||||||
|
<arg choice='plain'><option>-j</option></arg>
|
||||||
|
</group>
|
||||||
|
<replaceable>number</replaceable>
|
||||||
|
</arg>
|
||||||
|
<arg>
|
||||||
|
<option>--cores</option>
|
||||||
|
<replaceable>number</replaceable>
|
||||||
|
</arg>
|
||||||
|
<arg>
|
||||||
|
<option>--option</option>
|
||||||
|
<replaceable>name</replaceable>
|
||||||
|
<replaceable>value</replaceable>
|
||||||
|
</arg>
|
||||||
<arg>
|
<arg>
|
||||||
<arg choice='plain'><option>--show-trace</option></arg>
|
<arg choice='plain'><option>--show-trace</option></arg>
|
||||||
</arg>
|
</arg>
|
||||||
|
@ -96,6 +112,37 @@ it.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry><term><option>--max-jobs</option></term>
|
||||||
|
<term><option>-j</option></term>
|
||||||
|
|
||||||
|
<listitem><para>Sets the maximum number of build jobs that Nix will
|
||||||
|
perform in parallel to the specified number. The default is <literal>1</literal>.
|
||||||
|
A higher value is useful on SMP systems or to exploit I/O latency.</para></listitem>
|
||||||
|
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
|
||||||
|
<varlistentry><term><option>--cores</option></term>
|
||||||
|
|
||||||
|
<listitem><para>Sets the value of the <envar>NIX_BUILD_CORES</envar>
|
||||||
|
environment variable in the invocation of builders. Builders can
|
||||||
|
use this variable at their discretion to control the maximum amount
|
||||||
|
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.
|
||||||
|
The value <literal>0</literal> means that the builder should use all
|
||||||
|
available CPU cores in the system.</para></listitem>
|
||||||
|
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry><term><option>--option</option> <replaceable>name</replaceable> <replaceable>value</replaceable></term>
|
||||||
|
|
||||||
|
<listitem><para>Set the Nix configuration option
|
||||||
|
<replaceable>name</replaceable> to <replaceable>value</replaceable>.</para></listitem>
|
||||||
|
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>--show-trace</option></term>
|
<term><option>--show-trace</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
|
|
|
@ -28,9 +28,14 @@ chrootCommand=(/run/current-system/sw/bin/bash)
|
||||||
while [ "$#" -gt 0 ]; do
|
while [ "$#" -gt 0 ]; do
|
||||||
i="$1"; shift 1
|
i="$1"; shift 1
|
||||||
case "$i" in
|
case "$i" in
|
||||||
-I)
|
--max-jobs|-j|--cores|-I)
|
||||||
given_path="$1"; shift 1
|
j="$1"; shift 1
|
||||||
extraBuildFlags+=("$i" "$given_path")
|
extraBuildFlags+=("$i" "$j")
|
||||||
|
;;
|
||||||
|
--option)
|
||||||
|
j="$1"; shift 1
|
||||||
|
k="$1"; shift 1
|
||||||
|
extraBuildFlags+=("$i" "$j" "$k")
|
||||||
;;
|
;;
|
||||||
--root)
|
--root)
|
||||||
mountPoint="$1"; shift 1
|
mountPoint="$1"; shift 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue