Skip to content

Commit

Permalink
Merge branch 'master' into staging
Browse files Browse the repository at this point in the history
A few trivial conflicts due to *Platforms mass replace.
  • Loading branch information
vcunat committed Sep 1, 2018
2 parents 2e7cb61 + 9a56eee commit 2d6179d
Show file tree
Hide file tree
Showing 678 changed files with 57,199 additions and 58,305 deletions.
6 changes: 6 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ if ! builtins ? nixVersion || builtins.compareVersions requiredVersion builtins.
it is safe to upgrade by running it again:
curl https://nixos.org/nix/install | sh
For more information, please see the NixOS release notes at
https://nixos.org/nixos/manual or locally at
${toString ./doc/manual/release-notes}.
If you need further help, see https://nixos.org/nixos/support.html
''

else
Expand Down
14 changes: 7 additions & 7 deletions doc/languages-frameworks/node.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ project.

The package set also provides support for multiple Node.js versions. The policy
is that a new package should be added to the collection for the latest stable LTS
release (which is currently 6.x), unless there is an explicit reason to support
release (which is currently 8.x), unless there is an explicit reason to support
a different release.

If your package uses native addons, you need to examine what kind of native
Expand All @@ -26,7 +26,7 @@ build system it uses. Here are some examples:

After you have identified the correct system, you need to override your package
expression while adding in build system as a build input. For example, `dat`
requires `node-gyp-build`, so we override its expression in `default-v6.nix`:
requires `node-gyp-build`, so we override its expression in `default-v8.nix`:

```nix
dat = nodePackages.dat.override (oldAttrs: {
Expand All @@ -36,14 +36,14 @@ dat = nodePackages.dat.override (oldAttrs: {

To add a package from NPM to nixpkgs:

1. Modify `pkgs/development/node-packages/node-packages-v6.json` to add, update
or remove package entries. (Or `pkgs/development/node-packages/node-packages-v4.json`
for packages depending on Node.js 4.x)
1. Modify `pkgs/development/node-packages/node-packages-v8.json` to add, update
or remove package entries. (Or `pkgs/development/node-packages/node-packages-v10.json`
for packages depending on Node.js 10.x)
2. Run the script: `(cd pkgs/development/node-packages && ./generate.sh)`.
3. Build your new package to test your changes:
`cd /path/to/nixpkgs && nix-build -A nodePackages.<new-or-updated-package>`.
To build against a specific Node.js version (e.g. 4.x):
`nix-build -A nodePackages_4_x.<new-or-updated-package>`
To build against a specific Node.js version (e.g. 10.x):
`nix-build -A nodePackages_10_x.<new-or-updated-package>`
4. Add and commit all modified and generated files.

For more information about the generation process, consult the
Expand Down
3 changes: 2 additions & 1 deletion doc/languages-frameworks/python.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -1074,4 +1074,5 @@ Following rules are desired to be respected:
* Make sure libraries build for all Python interpreters.
* By default we enable tests. Make sure the tests are found and, in the case of libraries, are passing for all interpreters. If certain tests fail they can be disabled individually. Try to avoid disabling the tests altogether. In any case, when you disable tests, leave a comment explaining why.
* Commit names of Python libraries should reflect that they are Python libraries, so write for example `pythonPackages.numpy: 1.11 -> 1.12`.

* Attribute names in `python-packages.nix` should be normalized according to [PEP 0503](https://www.python.org/dev/peps/pep-0503/#normalized-names).
This means that characters should be converted to lowercase and `.` and `_` should be replaced by a single `-` (foo-bar-baz instead of Foo__Bar.baz )
8 changes: 4 additions & 4 deletions doc/languages-frameworks/rust.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ Now, the file produced by the call to `carnix`, called `hello.nix`, looks like:

```
# Generated by carnix 0.6.5: carnix -o hello.nix --src ./. Cargo.lock --standalone
{ lib, buildPlatform, buildRustCrate, fetchgit }:
let kernel = buildPlatform.parsed.kernel.name;
{ lib, stdenv, buildRustCrate, fetchgit }:
let kernel = stdenv.buildPlatform.parsed.kernel.name;
# ... (content skipped)
in
rec {
Expand Down Expand Up @@ -122,8 +122,8 @@ following nix file:

```
# Generated by carnix 0.6.5: carnix -o hello.nix --src ./. Cargo.lock --standalone
{ lib, buildPlatform, buildRustCrate, fetchgit }:
let kernel = buildPlatform.parsed.kernel.name;
{ lib, stdenv, buildRustCrate, fetchgit }:
let kernel = stdenv.buildPlatform.parsed.kernel.name;
# ... (content skipped)
in
rec {
Expand Down
2 changes: 1 addition & 1 deletion doc/old/cross.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Step 2: build kernel headers for the target architecture
---
{stdenv, fetchurl}:

assert stdenv.system == "i686-linux";
assert stdenv.buildPlatform.system == "i686-linux";

stdenv.mkDerivation {
name = "linux-headers-2.6.13.1-arm";
Expand Down
25 changes: 24 additions & 1 deletion doc/stdenv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1732,14 +1732,37 @@ set debug-file-directory ~/.nix-profile/lib/debug
Controls whether the installCheck phase is executed. By default it is
skipped, but if <varname>doInstallCheck</varname> is set to true, the
installCheck phase is usually executed. Thus you should set
<programlisting>doInstallCheck = true;</programlisting>
<programlisting>doInstallCheck = true;</programlisting>
in the derivation to enable install checks. The exception is cross
compilation. Cross compiled builds never run tests, no matter how
<varname>doInstallCheck</varname> is set, as the newly-built program
won't run on the platform used to build it.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>installCheckTarget</varname>
</term>
<listitem>
<para>
The make target that runs the install tests. Defaults to
<literal>installcheck</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>installCheckFlags</varname> / <varname>installCheckFlagsArray</varname>
</term>
<listitem>
<para>
A list of strings passed as additional flags to <command>make</command>.
Like <varname>makeFlags</varname> and <varname>makeFlagsArray</varname>,
but only used by the installCheck phase.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>installCheckInputs</varname>
Expand Down
2 changes: 1 addition & 1 deletion lib/attrsets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ rec {
foldAttrs = op: nul: list_of_attrs:
fold (n: a:
fold (name: o:
o // (listToAttrs [{inherit name; value = op n.${name} (a.${name} or nul); }])
o // { ${name} = op n.${name} (a.${name} or nul); }
) a (attrNames n)
) {} list_of_attrs;

Expand Down
2 changes: 1 addition & 1 deletion lib/minver.nix
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Expose the minimum required version for evaluating Nixpkgs
"1.11"
"2.0"
66 changes: 45 additions & 21 deletions lib/modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -192,29 +192,53 @@ rec {
(concatMap (m: map (config: { inherit (m) file; inherit config; }) (pushDownProperties m.config)) modules);

mergeModules' = prefix: options: configs:
listToAttrs (map (name: {
let
/* byName is like foldAttrs, but will look for attributes to merge in the
specified attribute name.
byName "foo" (module: value: ["module.hidden=${module.hidden},value=${value}"])
[
{
hidden="baz";
foo={qux="bar"; gla="flop";};
}
{
hidden="fli";
foo={qux="gne"; gli="flip";};
}
]
===>
{
gla = [ "module.hidden=baz,value=flop" ];
gli = [ "module.hidden=fli,value=flip" ];
qux = [ "module.hidden=baz,value=bar" "module.hidden=fli,value=gne" ];
}
*/
byName = attr: f: modules: foldl' (acc: module:
foldl' (inner: name:
inner // { ${name} = (acc.${name} or []) ++ (f module module.${attr}.${name}); }
) acc (attrNames module.${attr})
) {} modules;
# an attrset 'name' => list of submodules that declare ‘name’.
declsByName = byName "options"
(module: option: [{ inherit (module) file; options = option; }])
options;
# an attrset 'name' => list of submodules that define ‘name’.
defnsByName = byName "config" (module: value:
map (config: { inherit (module) file; inherit config; }) (pushDownProperties value)
) configs;
# extract the definitions for each loc
defnsByName' = byName "config"
(module: value: [{ inherit (module) file; inherit value; }])
configs;
in
(flip mapAttrs declsByName (name: decls:
# We're descending into attribute ‘name’.
inherit name;
value =
let
loc = prefix ++ [name];
# Get all submodules that declare ‘name’.
decls = concatMap (m:
if m.options ? ${name}
then [ { inherit (m) file; options = m.options.${name}; } ]
else []
) options;
# Get all submodules that define ‘name’.
defns = concatMap (m:
if m.config ? ${name}
then map (config: { inherit (m) file; inherit config; })
(pushDownProperties m.config.${name})
else []
) configs;
defns = defnsByName.${name} or [];
defns' = defnsByName'.${name} or [];
nrOptions = count (m: isOption m.options) decls;
# Extract the definitions for this loc
defns' = map (m: { inherit (m) file; value = m.config.${name}; })
(filter (m: m.config ? ${name}) configs);
in
if nrOptions == length decls then
let opt = fixupOptionType loc (mergeOptionDecls loc decls);
Expand All @@ -226,8 +250,8 @@ rec {
in
throw "The option `${showOption loc}' in `${firstOption.file}' is a prefix of options in `${firstNonOption.file}'."
else
mergeModules' loc decls defns;
}) (concatMap (m: attrNames m.options) options))
mergeModules' loc decls defns
))
// { _definedNames = map (m: { inherit (m) file; names = attrNames m.config; }) configs; };

/* Merge multiple option declarations into a single declaration. In
Expand Down
5 changes: 5 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
github = "a1russell";
name = "Adam Russell";
};
aanderse = {
email = "aaron@fosslib.net";
github = "aanderse";
name = "Aaron Andersen";
};
aaronschif = {
email = "aaronschif@gmail.com";
github = "aaronschif";
Expand Down
10 changes: 10 additions & 0 deletions nixos/doc/manual/administration/cleaning-store.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,14 @@ $ nix-store --optimise
Since this command needs to read the entire Nix store, it can take quite a
while to finish.
</para>
<section xml:id="sect-nixos-gc-boot-entries">
<title>NixOS Boot Entries</title>

<para>
If your <filename>/boot</filename> partition runs out of space, after
clearing old profiles you must rebuild your system with
<literal>nixos-rebuild</literal> to update the <filename>/boot</filename>
partition and clear space.
</para>
</section>
</chapter>
47 changes: 47 additions & 0 deletions nixos/doc/manual/installation/installing-behind-a-proxy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="sec-installing-behind-proxy">
<title>Installing behind a proxy</title>

<para>
To install NixOS behind a proxy, do the following before running
<literal>nixos-install</literal>.
</para>
<orderedlist numeration="arabic">
<listitem>
<para>
Update proxy configuration in
<literal>/mnt/etc/nixos/configuration.nix</literal> to keep the
internet accessible after reboot.
</para>
<programlisting>
networking.proxy.default = &quot;http://user:password@proxy:port/&quot;;
networking.proxy.noProxy = &quot;127.0.0.1,localhost,internal.domain&quot;;
</programlisting>
</listitem>
<listitem>
<para>
Setup the proxy environment variables in the shell where you are
running <literal>nixos-install</literal>.
</para>
<programlisting>
# proxy_url=&quot;http://user:password@proxy:port/&quot;
# export http_proxy=&quot;$proxy_url&quot;
# export HTTP_PROXY=&quot;$proxy_url&quot;
# export https_proxy=&quot;$proxy_url&quot;
# export HTTPS_PROXY=&quot;$proxy_url&quot;
</programlisting>
</listitem>
</orderedlist>

<note>
<para>
If you are switching networks with different proxy configurations, use the
<literal>nesting.clone</literal> option in
<literal>configuration.nix</literal> to switch proxies at runtime.
Refer to <xref linkend="ch-options" /> for more information.
</para>
</note>
</section>
1 change: 1 addition & 0 deletions nixos/doc/manual/installation/installing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -443,4 +443,5 @@ $ nix-env -i w3m</screen>
<xi:include href="installing-pxe.xml" />
<xi:include href="installing-virtualbox-guest.xml" />
<xi:include href="installing-from-other-distro.xml" />
<xi:include href="installing-behind-a-proxy.xml" />
</chapter>
51 changes: 51 additions & 0 deletions nixos/doc/manual/release-notes/rl-1809.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,50 @@ $ nix-instantiate -E '(import &lt;nixpkgsunstable&gt; {}).gitFull'
seen a complete rewrite. (See above.)
</para>
</listitem>
<listitem>
<para>
The minimum version of Nix required to evaluate Nixpkgs is now 2.0.
</para>
<itemizedlist>
<listitem>
<para>
For users of NixOS 18.03, NixOS 18.03 defaulted to Nix 2.0, but
supported using Nix 1.11 by setting <literal>nix.package =
pkgs.nix1;</literal>. If this option is set to a Nix 1.11 package, you
will need to either unset the option or upgrade it to Nix 2.0.
</para>
</listitem>
<listitem>
<para>
For users of NixOS 17.09, you will first need to upgrade Nix by setting
<literal>nix.package = pkgs.nixStable2;</literal> and run
<command>nixos-rebuild switch</command> as the <literal>root</literal>
user.
</para>
</listitem>
<listitem>
<para>
For users of a daemon-less Nix installation on Linux or macOS, you can
upgrade Nix by running <command>curl https://nixos.org/nix/install |
sh</command>, or prior to doing a channel update, running
<command>nix-env -iA nix</command>.
</para>
<para>
If you have already run a channel update and Nix is no longer able to
evaluate Nixpkgs, the error message printed should provide adequate
directions for upgrading Nix.
</para>
</listitem>
<listitem>
<para>
For users of the Nix daemon on macOS, you can upgrade Nix by running
<command>sudo -i sh -c 'nix-channel --update &amp;&amp; nix-env -iA
nixpkgs.nix'; sudo launchctl stop org.nixos.nix-daemon; sudo launchctl
start org.nixos.nix-daemon</command>.
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>
<literal>lib.strict</literal> is removed. Use
Expand Down Expand Up @@ -477,6 +521,13 @@ inherit (pkgs.nixos {
all user units for each authenticated user.
</para>
</listitem>
<listitem>
<para>
The default display manager is now LightDM.
To use SLiM set <literal>services.xserver.displayManager.slim.enable</literal>
to <literal>true</literal>.
</para>
</listitem>
</itemizedlist>
</section>
</section>
2 changes: 1 addition & 1 deletion nixos/lib/make-system-tarball.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ stdenv, perl, pixz, pathsFromGraph

, # The file name of the resulting tarball
fileName ? "nixos-system-${stdenv.system}"
fileName ? "nixos-system-${stdenv.hostPlatform.system}"

, # The files and directories to be placed in the tarball.
# This is a list of attribute sets {source, target} where `source'
Expand Down
4 changes: 2 additions & 2 deletions nixos/lib/qemu-flags.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ in

qemuSerialDevice = if pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64 then "ttyS0"
else if pkgs.stdenv.isAarch32 || pkgs.stdenv.isAarch64 then "ttyAMA0"
else throw "Unknown QEMU serial device for system '${pkgs.stdenv.system}'";
else throw "Unknown QEMU serial device for system '${pkgs.stdenv.hostPlatform.system}'";

qemuBinary = qemuPkg: {
"x86_64-linux" = "${qemuPkg}/bin/qemu-kvm -cpu kvm64";
"armv7l-linux" = "${qemuPkg}/bin/qemu-system-arm -enable-kvm -machine virt -cpu host";
"aarch64-linux" = "${qemuPkg}/bin/qemu-system-aarch64 -enable-kvm -machine virt,gic-version=host -cpu host";
"x86_64-darwin" = "${qemuPkg}/bin/qemu-kvm -cpu kvm64";
}.${pkgs.stdenv.system} or "${qemuPkg}/bin/qemu-kvm";
}.${pkgs.stdenv.hostPlatform.system} or "${qemuPkg}/bin/qemu-kvm";
}

0 comments on commit 2d6179d

Please sign in to comment.