Skip to content

Commit

Permalink
Merge branch 'master' into ocaml-utop
Browse files Browse the repository at this point in the history
  • Loading branch information
7c6f434c authored May 1, 2017
2 parents 1a7586c + 69250aa commit 9ae5487
Show file tree
Hide file tree
Showing 579 changed files with 18,524 additions and 11,973 deletions.
5 changes: 5 additions & 0 deletions doc/cross-compilation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@
Because of this, a best-of-both-worlds solution is in the works with no splicing or explicit access of <varname>buildPackages</varname> needed.
For now, feel free to use either method.
</para>
<note><para>
There is also a "backlink" <varname>__targetPackages</varname>, yielding a package set whose <varname>buildPackages</varname> is the current package set.
This is a hack, though, to accommodate compilers with lousy build systems.
Please do not use this unless you are absolutely sure you are packaging such a compiler and there is no other way.
</para></note>
</section>

</section>
Expand Down
3 changes: 1 addition & 2 deletions doc/languages-frameworks/ruby.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ $ cd sensu
$ cat > Gemfile
source 'https://rubygems.org'
gem 'sensu'
$ nix-shell -p bundler --command "bundler package --path /tmp/vendor/bundle"
$ $(nix-build '<nixpkgs>' -A bundix)/bin/bundix
$ $(nix-build '<nixpkgs>' -A bundix)/bin/bundix --magic
$ cat > default.nix
{ lib, bundlerEnv, ruby }:
Expand Down
1 change: 0 additions & 1 deletion doc/multiple-output.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

<section><title>Installing a split package</title>
<para>When installing a package via <varname>systemPackages</varname> or <command>nix-env</command> you have several options:</para>
<warning><para>Currently <command>nix-env</command> almost always installs all outputs until https://github.com/NixOS/nix/pull/815 gets merged.</para></warning>
<itemizedlist>
<listitem><para>You can install particular outputs explicitly, as each is available in the Nix language as an attribute of the package. The <varname>outputs</varname> attribute contains a list of output names.</para></listitem>
<listitem><para>You can let it use the default outputs. These are handled by <varname>meta.outputsToInstall</varname> attribute that contains a list of output names.</para>
Expand Down
4 changes: 2 additions & 2 deletions lib/customisation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ rec {
/* Make a set of packages with a common scope. All packages called
with the provided `callPackage' will be evaluated with the same
arguments. Any package in the set may depend on any other. The
`override' function allows subsequent modification of the package
`overrideScope' function allows subsequent modification of the package
set in a consistent way, i.e. all packages in the set will be
called with the overridden packages. The package sets may be
hierarchical: the packages in the set are called with the scope
Expand All @@ -177,7 +177,7 @@ rec {
let self = f self // {
newScope = scope: newScope (self // scope);
callPackage = self.newScope {};
override = g:
overrideScope = g:
makeScope newScope
(self_: let super = f self_; in super // g super self_);
packages = f;
Expand Down
5 changes: 5 additions & 0 deletions lib/licenses.nix
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
fullName = "Do What The F*ck You Want To Public License";
};

wxWindows = spdx {
spdxId = "WXwindows";
fullName = "wxWindows Library Licence, Version 3.1";
};

zlib = spdx {
spdxId = "Zlib";
fullName = "zlib License";
Expand Down
8 changes: 7 additions & 1 deletion lib/maintainers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
heel = "Sergii Paryzhskyi <[email protected]>";
henrytill = "Henry Till <[email protected]>";
hinton = "Tom Hinton <[email protected]>";
hodapp = "Chris Hodapp <[email protected]>";
hrdinka = "Christoph Hrdinka <[email protected]>";
iand675 = "Ian Duncan <[email protected]>";
ianwookim = "Ian-Woo Kim <[email protected]>";
Expand Down Expand Up @@ -388,6 +389,7 @@
paholg = "Paho Lurie-Gregg <[email protected]>";
pakhfn = "Fedor Pakhomov <[email protected]>";
palo = "Ingolf Wanger <[email protected]>";
panaeon = "Vitalii Voloshyn <[email protected]";
paperdigits = "Mica Semrick <[email protected]>";
pashev = "Igor Pashev <[email protected]>";
patternspandemic = "Brad Christensen <[email protected]>";
Expand Down Expand Up @@ -452,7 +454,7 @@
romildo = "José Romildo Malaquias <[email protected]>";
rongcuid = "Rongcui Dong <[email protected]>";
ronny = "Ronny Pfannschmidt <[email protected]>";
rszibele = "Richard Szibele <richard_szibele@hotmail.com>";
rszibele = "Richard Szibele <richard@szibele.com>";
rtreffer = "Rene Treffer <[email protected]>";
rushmorem = "Rushmore Mushambi <[email protected]>";
rvl = "Rodney Lorrimar <[email protected]>";
Expand All @@ -466,6 +468,7 @@
s1lvester = "Markus Silvester <[email protected]>";
samuelrivas = "Samuel Rivas <[email protected]>";
sander = "Sander van der Burg <[email protected]>";
sargon = "Daniel Ehlers <[email protected]>";
schmitthenner = "Fabian Schmitthenner <[email protected]>";
schneefux = "schneefux <[email protected]>";
schristo = "Scott Christopher <[email protected]>";
Expand All @@ -488,6 +491,7 @@
skrzyp = "Jakub Skrzypnik <[email protected]>";
sleexyz = "Sean Lee <[email protected]>";
smironov = "Sergey Mironov <[email protected]>";
snyh = "Xia Bin <[email protected]>";
solson = "Scott Olson <[email protected]>";
spacefrogg = "Michael Raitza <[email protected]>";
spencerjanssen = "Spencer Janssen <[email protected]>";
Expand All @@ -500,6 +504,7 @@
sternenseemann = "Lukas Epple <[email protected]>";
stesie = "Stefan Siegl <[email protected]>";
steveej = "Stefan Junker <[email protected]>";
SuprDewd = "Bjarki Ágúst Guðmundsson <[email protected]>";
swarren83 = "Shawn Warren <[email protected]>";
swistak35 = "Rafał Łasocha <[email protected]>";
szczyp = "Szczyp <[email protected]>";
Expand All @@ -509,6 +514,7 @@
takikawa = "Asumu Takikawa <[email protected]>";
taktoa = "Remy Goldschmidt <[email protected]>";
taku0 = "Takuo Yonezawa <[email protected]>";
tari = "Peter Marheine <[email protected]>";
tavyc = "Octavian Cerna <[email protected]>";
teh = "Tom Hunger <[email protected]>";
telotortium = "Robert Irelan <[email protected]>";
Expand Down
2 changes: 1 addition & 1 deletion lib/systems/doubles.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ in rec {
mips = filterDoubles (matchAttrs { cpu = { family = "mips"; }; });
x86_64 = filterDoubles parse.isx86_64;

cygwin = filterDoubles (matchAttrs { kernel = parse.kernels.cygwin; });
cygwin = filterDoubles parse.isCygwin;
darwin = filterDoubles parse.isDarwin;
freebsd = filterDoubles (matchAttrs { kernel = parse.kernels.freebsd; });
gnu = filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnu; }); # Should be better
Expand Down
60 changes: 34 additions & 26 deletions lib/systems/parse.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Define the list of system with their properties. Only systems tested for
# Nixpkgs are listed below
# Define the list of system with their properties.
#
# See https://clang.llvm.org/docs/CrossCompilation.html and
# http://llvm.org/docs/doxygen/html/Triple_8cpp_source.html especially
# Triple::normalize. Parsing should essentially act as a more conservative
# version of that last function.

with import ../lists.nix;
with import ../types.nix;
Expand All @@ -9,7 +13,7 @@ let
lib = import ../default.nix;
setTypesAssert = type: pred:
mapAttrs (name: value:
#assert pred value;
assert pred value;
setType type ({ inherit name; } // value));
setTypes = type: setTypesAssert type (_: true);

Expand All @@ -23,7 +27,6 @@ rec {
littleEndian = {};
};


isCpuType = isType "cpu-type";
cpuTypes = with significantBytes; setTypesAssert "cpu-type"
(x: elem x.bits [8 16 32 64 128]
Expand All @@ -47,6 +50,7 @@ rec {
vendors = setTypes "vendor" {
apple = {};
pc = {};

unknown = {};
};

Expand All @@ -56,39 +60,42 @@ rec {
elf = {};
macho = {};
pe = {};

unknown = {};
};

isKernelFamily = isType "kernel-family";
kernelFamilies = setTypes "kernel-family" {
bsd = {};
unix = {};
windows-nt = {};
dos = {};
};

isKernel = x: isType "kernel" x;
kernels = with execFormats; with kernelFamilies; setTypesAssert "kernel"
(x: isExecFormat x.execFormat && all isKernelFamily (attrValues x.families))
{
cygwin = { execFormat = pe; families = { inherit /*unix*/ windows-nt; }; };
darwin = { execFormat = macho; families = { inherit unix; }; };
freebsd = { execFormat = elf; families = { inherit unix bsd; }; };
linux = { execFormat = elf; families = { inherit unix; }; };
netbsd = { execFormat = elf; families = { inherit unix bsd; }; };
none = { execFormat = unknown; families = { inherit unix; }; };
openbsd = { execFormat = elf; families = { inherit unix bsd; }; };
solaris = { execFormat = elf; families = { inherit unix; }; };
win32 = { execFormat = pe; families = { inherit dos; }; };
windows = { execFormat = pe; families = { }; };
} // { # aliases
win32 = kernels.windows;
};


isAbi = isType "abi";
abis = setTypes "abi" {
cygnus = {};
gnu = {};
msvc = {};
eabi = {};
androideabi = {};
gnueabi = {};
gnueabihf = {};

unknown = {};
};

Expand All @@ -107,19 +114,25 @@ rec {
isDarwin = matchAttrs { kernel = kernels.darwin; };
isLinux = matchAttrs { kernel = kernels.linux; };
isUnix = matchAttrs { kernel = { families = { inherit (kernelFamilies) unix; }; }; };
isWindows = s: matchAttrs { kernel = { families = { inherit (kernelFamilies) windows-nt; }; }; } s
|| matchAttrs { kernel = { families = { inherit (kernelFamilies) dos; }; }; } s;
isWindows = matchAttrs { kernel = kernels.windows; };
isCygwin = matchAttrs { kernel = kernels.windows; abi = abis.cygnus; };
isMinGW = matchAttrs { kernel = kernels.windows; abi = abis.gnu; };


mkSkeletonFromList = l: {
"2" = { cpu = elemAt l 0; kernel = elemAt l 1; };
"4" = { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; abi = elemAt l 3; };
"2" = # We only do 2-part hacks for things Nix already supports
if elemAt l 1 == "cygwin"
then { cpu = elemAt l 0; kernel = "windows"; abi = "cygnus"; }
else { cpu = elemAt l 0; kernel = elemAt l 1; };
"3" = # Awkwards hacks, beware!
if elemAt l 1 == "apple"
then { cpu = elemAt l 0; vendor = "apple"; kernel = elemAt l 2; }
else if (elemAt l 1 == "linux") || (elemAt l 2 == "gnu")
then { cpu = elemAt l 0; kernel = elemAt l 1; abi = elemAt l 2; }
else if (elemAt l 2 == "mingw32") # autotools breaks on -gnu for window
then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "windows"; abi = "gnu"; }
else throw "Target specification with 3 components is ambiguous";
"4" = { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; abi = elemAt l 3; };
}.${toString (length l)}
or (throw "system string has invalid number of hyphen-separated components");

Expand All @@ -132,18 +145,10 @@ rec {
, # Also inferred below
abi ? assert false; null
} @ args: let
getCpu = name:
attrByPath [name] (throw "Unknown CPU type: ${name}")
cpuTypes;
getVendor = name:
attrByPath [name] (throw "Unknown vendor: ${name}")
vendors;
getKernel = name:
attrByPath [name] (throw "Unknown kernel: ${name}")
kernels;
getAbi = name:
attrByPath [name] (throw "Unknown ABI: ${name}")
abis;
getCpu = name: cpuTypes.${name} or (throw "Unknown CPU type: ${name}");
getVendor = name: vendors.${name} or (throw "Unknown vendor: ${name}");
getKernel = name: kernels.${name} or (throw "Unknown kernel: ${name}");
getAbi = name: abis.${name} or (throw "Unknown ABI: ${name}");

system = rec {
cpu = getCpu args.cpu;
Expand All @@ -164,7 +169,10 @@ rec {

mkSystemFromString = s: mkSystemFromSkeleton (mkSkeletonFromList (lib.splitString "-" s));

doubleFromSystem = { cpu, vendor, kernel, abi, ... }: "${cpu.name}-${kernel.name}";
doubleFromSystem = { cpu, vendor, kernel, abi, ... }:
if vendor == kernels.windows && abi == abis.cygnus
then "${cpu.name}-cygwin"
else "${cpu.name}-${kernel.name}";

tripleFromSystem = { cpu, vendor, kernel, abi, ... } @ sys: assert isSystem sys; let
optAbi = lib.optionalString (abi != abis.unknown) "-${abi.name}";
Expand Down
70 changes: 70 additions & 0 deletions lib/systems/platforms.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,39 @@ rec {
kernelAutoModules = false;
};

pogoplug4 = {
name = "pogoplug4";

gcc = {
arch = "armv5te";
float = "soft";
};

kernelMajor = "2.6";
kernelHeadersBaseConfig = "multi_v5_defconfig";
kernelBaseConfig = "multi_v5_defconfig";
kernelArch = "arm";
kernelAutoModules = false;
kernelExtraConfig =
''
# Ubi for the mtd
MTD_UBI y
UBIFS_FS y
UBIFS_FS_XATTR y
UBIFS_FS_ADVANCED_COMPR y
UBIFS_FS_LZO y
UBIFS_FS_ZLIB y
UBIFS_FS_DEBUG n
'';
kernelMakeFlags = [ "LOADADDR=0x8000" ];
kernelTarget = "uImage";
# TODO reenable once manual-config's config actually builds a .dtb and this is checked to be working
#kernelDTB = true;

# XXX can be anything non-null, pkgs actually only cares if it is set or not
uboot = "pogoplug4";
};

sheevaplug = {
name = "sheevaplug";
kernelMajor = "2.6";
Expand Down Expand Up @@ -307,6 +340,43 @@ rec {
uboot = null;
};

scaleway-c1 = armv7l-hf-multiplatform // {
gcc = {
cpu = "cortex-a9";
fpu = "vfpv3";
float = "hard";
};
};

utilite = {
name = "utilite";
kernelMajor = "2.6";
kernelHeadersBaseConfig = "multi_v7_defconfig";
kernelBaseConfig = "multi_v7_defconfig";
kernelArch = "arm";
kernelAutoModules = false;
kernelExtraConfig =
''
# Ubi for the mtd
MTD_UBI y
UBIFS_FS y
UBIFS_FS_XATTR y
UBIFS_FS_ADVANCED_COMPR y
UBIFS_FS_LZO y
UBIFS_FS_ZLIB y
UBIFS_FS_DEBUG n
'';
kernelMakeFlags = [ "LOADADDR=0x10800000" ];
kernelTarget = "uImage";
kernelDTB = true;
uboot = true; #XXX: any non-null value here is needed so that mkimage is present to build kernelTarget uImage
gcc = {
cpu = "cortex-a9";
fpu = "neon";
float = "hard";
};
};

guruplug = sheevaplug // {
# Define `CONFIG_MACH_GURUPLUG' (see
# <http://kerneltrap.org/mailarchive/git-commits-head/2010/5/19/33618>)
Expand Down
2 changes: 1 addition & 1 deletion lib/trivial.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ rec {
/* Merge two attribute sets shallowly, right side trumps left
Example:
mergeAttrs { a = 1; b = 2; } // { b = 3; c = 4; }
mergeAttrs { a = 1; b = 2; } { b = 3; c = 4; }
=> { a = 1; b = 3; c = 4; }
*/
mergeAttrs = x: y: x // y;
Expand Down
13 changes: 9 additions & 4 deletions nixos/doc/manual/administration/imperative-containers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ line. For instance, to create a container that has
<literal>root</literal>:

<screen>
# nixos-container create foo --config 'services.openssh.enable = true; \
users.extraUsers.root.openssh.authorizedKeys.keys = ["ssh-dss AAAAB3N…"];'
# nixos-container create foo --config '
services.openssh.enable = true;
users.extraUsers.root.openssh.authorizedKeys.keys = ["ssh-dss AAAAB3N…"];
'
</screen>

</para>
Expand Down Expand Up @@ -97,8 +99,11 @@ This will build and activate the new configuration. You can also
specify a new configuration on the command line:

<screen>
# nixos-container update foo --config 'services.httpd.enable = true; \
services.httpd.adminAddr = "[email protected]";'
# nixos-container update foo --config '
services.httpd.enable = true;
services.httpd.adminAddr = "[email protected]";
networking.firewall.allowedTCPPorts = [ 80 ];
'

# curl http://$(nixos-container show-ip foo)/
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">…
Expand Down
Loading

0 comments on commit 9ae5487

Please sign in to comment.