Compare commits

..

631 Commits

Author SHA1 Message Date
James Cook
ca323ed1bb expat: patch for CVE-2015-1283 from Mozilla
(Cherry-picked from commit fba4a950685023bc792422665b2dbe9934ebc9c6.)
2015-07-27 22:44:07 -07:00
Domen Kožar
8a3eea0548 Merge pull request #6287 from eborden/release-14.04
Update flash version
2015-02-16 12:08:28 +01:00
Evan Rutledge Borden
e4ee5c797c updated SHA on flash player. 2015-02-10 17:34:03 -05:00
Evan Rutledge Borden
92dd442e43 update flash version. 2015-02-10 11:50:00 -05:00
Vladimír Čunát
ed574b950a linux_3_{10,12,14}: fix upstream regression, fixes #6231
Some modules wouldn't load crc32c dependency due to module renaming.

(cherry picked from commit 57f2d329ac)

Conflicts (simple):
	pkgs/top-level/all-packages.nix
2015-02-10 13:54:43 +01:00
Vladimír Čunát
d16b0e3ae5 xdg-utils: update from git to fix CVE-2014-9622
Fixes #6193.
Disabling docs generation might be another alternative
to the build-time dependency blowup.

(cherry picked from commit 346c8d7a98)

Conflicts (simple):
	pkgs/tools/X11/xdg-utils/default.nix
2015-02-07 07:39:33 +01:00
Vladimír Čunát
592b4f7a3e kernel-*: updates from master
This probably breaks grsecurity build,
but I don't think anyone with that is still using this half-dead branch.
2015-02-04 21:33:02 +01:00
Eelco Dolstra
11ba869ae7 Paranoia
(cherry picked from commit efa8fc2b0a)

Conflicts:
	nixos/modules/virtualisation/ec2-data.nix
	nixos/modules/virtualisation/google-compute-image.nix
2015-01-15 21:18:50 +01:00
Eelco Dolstra
cf3d27a6e9 nixos-install: Create /root with 700 permission
(cherry picked from commit b9c4569b6b)

Conflicts:
	nixos/modules/installer/tools/nixos-install.sh
2015-01-15 21:18:50 +01:00
Eelco Dolstra
924fe493df NixOS containers: Create /root with 700 permission
Systemd-nspawn creates /root with 755 permission if it doesn't exist,
which is bad. So we have to create it ourselves before calling
systemd-nspawn.

(cherry picked from commit 3ca275d7ba)

Conflicts:
	nixos/modules/virtualisation/containers.nix
2015-01-15 21:18:50 +01:00
Lluís Batlle i Rossell
9be183955d Adding scantailor.
(cherry picked from commit 7eda68709e)
(cherry picked from commit b985a9e0a1)
2015-01-14 20:32:05 +01:00
Rob Vermaas
a4e0357cae Use callPackage for nodePackages, to allow easier overriding of node-packages set.
(cherry picked from commit 65a89fcce7)
2015-01-12 10:05:56 +01:00
Domen Kožar
92466a8454 openssl: 1.0.1j -> 1.0.1k
(cherry picked from commit 70a7d4bd16)
Signed-off-by: Domen Kožar <domen@dev.si>
(cherry picked from commit dbbd849ce8)
Signed-off-by: Domen Kožar <domen@dev.si>
2015-01-09 20:22:22 +01:00
Rob Vermaas
c343d80490 Ugly hack until we can update openjdk. Without this openjdk fails with:
Error: time is more than 10 years from present: 1104530400000

See also:
   http://permalink.gmane.org/gmane.os.netbsd.devel.pkgsrc.user/20888
2015-01-08 22:11:24 +01:00
James Cook
3fa379d9a3 unzip: Patch for CVE-2014-81{39,40,41}.
(Cherry-picked from 173f41cf0bc618f0b2c313b1915fee8d8a6d0ee2.)
2015-01-08 11:36:54 -08:00
Rob Vermaas
b9d5e14d1b Update dd-agent to 5.1.1
(cherry picked from commit 7f02b1f350)
2015-01-05 13:08:55 +01:00
Rob Vermaas
7c238fbd59 Add pythonPackages.ntplib, needed for dd-agent update. 2015-01-05 13:08:50 +01:00
Marco Maggesi
0e04ba396e Bumb BLCR 2014-12-27 14:54:24 +01:00
James Cook
f83b2c4178 jasper: Patch for CVE-2014-8138 via RedHat.
(Cherry-picked from commit 1b5c9c24dea9d5241f4a46a471d77d185b31b524.)
2014-12-25 02:12:25 -08:00
James Cook
e501adfb64 jasper: Patch for CVE-2014-8137 via RedHat.
(Cherry-picked from commit 951ac10ae15bf53ea919802a8c3570518f34d86b.)
2014-12-25 02:12:11 -08:00
James Cook
6173acfd98 jasper: Patch for CVE-2014-9029 via RedHat.
Also update homepage.

(Cherry-picked from commit 90162e7dbd5b96f04e277e6d208c9a9940d818a9.)
2014-12-25 02:11:53 -08:00
Vladimír Čunát
71c13be184 libssh: security+maintenance to fix CVE-2014-8132
Also switched to openssl instead of libgcrypt (wouldn't compile otherwise),
and fixed meta.license.

(cherry picked from commit 7357f0ae24)
2014-12-20 14:52:02 +01:00
Vladimír Čunát
f4bc92fb99 kde4.kmplayer: use gentoo mirror (fixes #5407)
The upstream server is down.

(cherry picked from commit ca850deb9e)
2014-12-20 10:35:07 +01:00
Vladimír Čunát
d91bffeb13 kernel: 3.14.17 -> 3.14.27
This most likely solves some vulnerabilities.
The grsecurity stuff were out of sync before this commit,
and maybe didn't get fixed by this.
CC #5386.

(cherry-picked from 7e8c5b578a)
2014-12-18 14:14:22 +01:00
Rob Vermaas
0efa789071 cron: fix location 2014-12-16 11:31:36 +01:00
Rob Vermaas
3365f39da4 cron: make into systemd.service and make it depend on /etc/localtime
so that changes in timezone will trigger a restart of cron service.

(cherry picked from commit b48e41b8d7)
2014-12-15 14:52:57 +01:00
Vladimír Čunát
9ff4738e5f kde: move patch to the correct location
I see git detects file moves well but not "directory moves".
Thanks to Travis for fast notification.
2014-12-11 11:30:12 +01:00
Vladimír Čunát
20fb57a528 kde: fix CVE-2014-8600 by upstream patches
https://www.kde.org/info/security/advisory-20141113-1.txt
I couldn't find kio-extras, so I hope we don't have it disguised somewhere.

(cherry picked from commit 15b9626a3d)
2014-12-10 21:09:51 +01:00
Vladimír Čunát
a3b3205179 libyaml: fix CVE-2014-9130 by upstream patch
(cherry picked from commit c8a53923fc)
2014-12-10 21:09:50 +01:00
Vladimír Čunát
3b43da9fa5 cpio: fix CVE-2014-9112 by Fedora patch
(cherry picked from commit 225ddcda9a)
2014-12-10 21:09:50 +01:00
Eelco Dolstra
7e7f00c898 php: Really update to 5.4.34
75738437a4 only updated the version string...

(cherry picked from commit 55d59eefb3)
2014-12-10 17:19:34 +01:00
William A. Kennington III
1f2d6a022e kernel: 3.12.33 -> 3.12.34
(cherry picked from commit 845f647b86)
2014-12-10 13:26:45 +01:00
Ricardo M. Correia
e7a8157372 flashplayer: Update from 11.2.202.424 -> 11.2.202.425
(cherry picked from commit e660a70872)
2014-12-10 13:26:44 +01:00
Vladimír Čunát
dbbe29e095 root: fix build by upstream patch
Also refactor the expression a little.

(cherry picked from commit 7ce485ff0f)
2014-12-10 13:03:19 +01:00
Lluís Batlle i Rossell
167dcce8ff Enable parallel building in octave.
Let's wait for problems.
2014-12-09 15:03:10 +01:00
Rüdiger Sonderfeld
55170645ef octave: Update to 3.8.2.
Also change "," placement to be consistent and remove unnecessary let.

(cherry picked from commit 05b83fe6a2)
2014-12-09 15:03:10 +01:00
Lluís Batlle i Rossell
2253aa9b75 Updating octave to 3.8.1
(cherry picked from commit 43ed6b8f62)
2014-12-09 15:03:10 +01:00
Lluís Batlle i Rossell
0420a025e3 Updating xpdf to 3.04 2014-12-09 14:35:54 +01:00
Vladimír Čunát
b2cb57e1c3 nss: security update fixing CVE-2014-1569
(cherry picked from commit 2e1bb14b93)
2014-12-05 11:36:41 +01:00
Eelco Dolstra
58c9322244 firefox: Update to 34.0.5
(cherry picked from commit d6c3b564c4)
2014-12-05 11:36:28 +01:00
Rob Vermaas
aa61c12112 Update dd-agent to 4.4.0 2014-12-03 16:11:40 +01:00
Domen Kožar
1ed7214396 openvpn: fix build 2014-12-02 15:30:38 +01:00
Domen Kožar
bcd78d6564 openvpn: 2.3.4 -> 2.3.6 (CVE-2014-8104)
Conflicts:
	pkgs/tools/networking/openvpn/default.nix
2014-12-02 13:12:32 +01:00
Shea Levy
7fcafc09a5 nixUnstable: bump
Bug fixed in b0c5c2a was giving me segfaults...

(cherry picked from commit 97f35cf29a)

Conflicts:
	pkgs/tools/package-management/nix/unstable.nix
2014-12-02 11:51:57 +01:00
William A. Kennington III
f77806acdf kernel: 3.12.32 -> 3.12.33
(cherry picked from commit 30597a9c7a)
2014-12-02 11:48:29 +01:00
Rob Vermaas
0521f9d125 sysklogd: update from 1.5 to 1.5.1, potentially fixes CVE-2014-3634, CVE-2014-3683
(cherry picked from commit c4ab4ce59b)
2014-12-02 11:46:17 +01:00
Pascal Wittmann
fa0adad077 php: update from 5.4.34 to 5.4.35 (fixes CVE-2014-3710)
(cherry picked from commit 75738437a4)
2014-12-02 11:45:50 +01:00
aszlig
4290f2c74b nixos: Use vendor zones instead of N.pool.ntp.org.
Closes #4824, thanks to @abh for processing my stupidity.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit c37611f3e5)
2014-11-28 19:40:34 +01:00
Lluís Batlle i Rossell
410a4ea663 Updating pcl to 1.7.2, making it build. 2014-11-27 16:16:32 +01:00
Ricardo M. Correia
8183166846 flashplayer: Update from 11.2.202.418 -> 11.2.202.424
It's a critical security fix.
http://helpx.adobe.com/security/products/flash-player/apsb14-26.html
(cherry picked from commit a4beb6a2b6)
2014-11-27 01:26:45 +01:00
Eelco Dolstra
cd261645fa okular: Add mobi support 2014-11-19 23:24:42 +01:00
Vladimír Čunát
1901da5bbd fontconfig: stop using xml:space; vital for nixos+2.11
This is a proper fix for problems described in ec985c8ffa .
The code is from @lethalman.

(cherry picked from commit b16994f7ce)
2014-11-19 23:19:17 +01:00
Eelco Dolstra
59ce92eb62 checkinstall: Fix RPM builds
https://bugzilla.novell.com/show_bug.cgi?id=561317
(cherry picked from commit 9073d554a5)
2014-11-18 15:32:07 +01:00
Eelco Dolstra
c3a8624ac2 firefox: Use regular linker
It builds on Nix >= 1.8pre3890 due to the removal of the
ADDR_LIMIT_3GB personality flag.

(cherry picked from commit bf17f43fe9)
2014-11-18 15:31:54 +01:00
Eelco Dolstra
969090442b firefox: Update to 33.1.1
(cherry picked from commit c4364d5914)
2014-11-18 15:31:27 +01:00
Eelco Dolstra
a34c0c58d3 Manual: Remove some option defaults that refer to store paths
Option defaults should not refer to store paths, because they cause
the manual to be rebuilt gratuitously. It's especially bad to refer to
a highly variable path like a computed configuration file.

(cherry picked from commit ec4f38c56f)
2014-11-17 15:32:08 +01:00
Eelco Dolstra
ef67865e5d Backport generation of options.json 2014-11-17 15:31:45 +01:00
Ricardo M. Correia
fbd732860a flashplayer: Update from 11.2.202.411 -> 11.2.202.418
(cherry picked from commit ace49e400c)
2014-11-14 19:15:59 +01:00
Ricardo M. Correia
6a9e7582b4 flashplayer: Update from 11.2.202.406 -> 11.2.202.411
(cherry picked from commit 2838c2a7bc)
2014-11-14 19:15:59 +01:00
Eelco Dolstra
2b0caccb7b imagemagick: Use --with-gcc-arch
Without this, ImageMagick's configure script will generate code
specific to the machine building the package. This code may then fail
on other CPU types.

http://hydra.nixos.org/build/16564129
Signed-off-by: Domen Kožar <domen@dev.si>
(cherry picked from commit 6f53886360)
2014-11-11 13:12:52 +01:00
Justin Bedo
5b1015578c Update ImageMagick version
(cherry picked from commit cd1bacb03d)
2014-11-11 13:12:47 +01:00
Vladimír Čunát
0a24b3da2d firefox: update to 33.1
(cherry picked from commit fb3e83d091)
2014-11-11 13:11:02 +01:00
Michael Raskin
a40ea27684 Update firefox source build, too
(cherry picked from commit 0934ddf3e0)
2014-11-11 13:10:55 +01:00
Eelco Dolstra
6b704bcdcc httpd-2.2: Enable building of mod_cache and friends
(cherry picked from commit db4053fb59)
2014-11-11 13:09:44 +01:00
Rob Vermaas
37edf304b8 Fix hash for linux 3.12.32 2014-11-06 20:50:00 +01:00
Eelco Dolstra
910364a0af linux: Update to 3.12.32
(cherry picked from commit 1d5147dd17)
2014-11-06 15:16:56 +01:00
Rob Vermaas
89dda7a106 php: update from 5.4.33 to 5.4.34, potentially fixes CVE-2014-3668, CVE-2014-3669, CVE-2014-3670
(cherry picked from commit 6d79132553)
2014-11-06 15:09:58 +01:00
Vladimír Čunát
c9de7b93c0 subversion+serf: security update to fix CVE-2014-3504
Thanks to nixpkgs monitor again.

(cherry picked from commit 3775fa9ea2)
2014-11-06 15:05:21 +01:00
Eelco Dolstra
2b022ca153 serf: Update to 1.3.6
(cherry picked from commit 542373f305)
2014-11-06 15:05:10 +01:00
Eelco Dolstra
c19dd1e04a subversion: Update to 1.8.9
(cherry picked from commit b4c4e2d28d)
2014-11-06 14:59:15 +01:00
Eelco Dolstra
975f36b68a apr-util: Update to 1.5.4
(cherry picked from commit 64982966dc)
2014-11-06 13:13:54 +01:00
Eelco Dolstra
a640ee54b2 apache-httpd: Update to 2.2.29
CVE-2014-0118, CVE-2014-0231, CVE-2014-0226, CVE-2013-5704.

(cherry picked from commit 8e40703f6c)
2014-11-06 13:13:02 +01:00
Eelco Dolstra
ffb3ead6c5 firefox: Don't use system sqlite
I don't want to upgrade SQLite in the stable branch, but Firefox 33
requires a more recent version.
2014-11-05 15:01:32 +01:00
Eelco Dolstra
dbb8603c5d nss: Update to 3.17.2
(cherry picked from commit f445fb8240)
2014-11-05 14:08:35 +01:00
Michael Raskin
0c9dad3bde Update firefox
(cherry picked from commit ed6babd391)
2014-11-05 14:07:43 +01:00
Eelco Dolstra
e6e9bdf846 firefox: Update to 33.0.1
(cherry picked from commit 240665d906)
2014-11-05 14:07:32 +01:00
Eelco Dolstra
211914a4a6 firefox: Fix evaluation on non-Linux
Actually we only support Firefox on Linux, but we hit the “attribute
‘gcc.override’ missing” error before the platform check.

(cherry picked from commit a5262a9000)
2014-11-05 14:07:18 +01:00
Eelco Dolstra
cbacb16cee firefox: Fix build on 32-bit by using the gold linker
(cherry picked from commit f4b5671b0d)
2014-11-05 14:07:05 +01:00
Eelco Dolstra
3a6555c18a firefox: Update to 33.0
(cherry picked from commit fc964fa924)
2014-11-05 14:06:23 +01:00
Pascal Wittmann
d7ceaf4f4e wget: Update to 1.16 (fix CVE-2014-4877) (#4728)
(cherry picked from commit c7e4290fcc)

Picker deleted the maintainer, as (s)he is missing in this brang

Conflicts (auto-solved):
	pkgs/tools/networking/wget/default.nix
2014-11-01 21:42:30 +01:00
Domen Kožar
c3ddfef8f6 python: 3.3.5 -> 3.3.6 2014-11-01 04:54:30 +01:00
Domen Kožar
d7d593b57f python: 3.2.5 -> 3.2.6 2014-11-01 04:54:30 +01:00
Longrin Wischnewski
8fc1927e2d rdesktop: update to version 1.8.2
rdesktop: add meta fields
(cherry picked from commit 6ad299460c)

Conflicts:
	pkgs/applications/networking/remote/rdesktop/default.nix
2014-10-29 14:44:19 +01:00
Eelco Dolstra
ae1c5b8783 linux: Update to 3.12.31
(cherry picked from commit bac50c5c1f)
2014-10-27 11:22:06 +01:00
Eelco Dolstra
1fc25b90dd sqlite: Enable optimization
Commit a28940d9d5 changed the SQLite
build to use CFLAGS instead of NIX_CFLAGS_COMPILE, but that's really
bad because it clobbers the default -O2 flag. So all this time we had
an unoptimized SQLite build. (This is one of the reasons why
NIX_CFLAGS_COMPILE exists - messing with CFLAGS is almost never a good
idea.)

(cherry picked from commit 2b5ccf8a53)
2014-10-27 10:50:40 +01:00
Eelco Dolstra
997e1ebb2c Remove obsolete Hydra package
(cherry picked from commit d4d0e449d7)
2014-10-27 10:50:40 +01:00
Eelco Dolstra
6f91248649 Add openjdk to the small channel
(cherry picked from commit 4ecb762ee5)
2014-10-27 10:50:40 +01:00
Eelco Dolstra
d0ccb711a0 chatzilla: Update to 0.9.91
(cherry picked from commit 71c34a45e1)
2014-10-27 10:50:40 +01:00
Eelco Dolstra
ba886d92ae chatzilla: Use firefox instead of xulrunner
Thanks to @nbp for pointing out that we don't need xulrunner anymore.

(cherry picked from commit 4de72baf03)
2014-10-27 10:50:39 +01:00
Vladimír Čunát
4c9ef9f75c pidgin: maintenance+security update
Fixes CVE-2014-3694..3698

Added a note to clean the expression, CC #4602.

(cherry picked from commit e63d9554b4)

Conflicts:
	pkgs/applications/networking/instant-messengers/pidgin/default.nix
2014-10-23 13:05:06 +02:00
Lluís Batlle i Rossell
71b2df28fc Adding a patch that brings the windows key to rdesktop
Taken from upstream, will be on next release.

(cherry picked from commit 8997cac785)
2014-10-23 09:47:53 +02:00
Lluís Batlle i Rossell
15efb9ccf9 Making hydra build ddd. 2014-10-23 09:47:48 +02:00
Shea Levy
6982c7ccf8 Debain 7.6-amd64 tarball was updated in place
(cherry picked from commit 3fe41ca763)
2014-10-20 15:26:59 -04:00
Shea Levy
af217bae29 debian packages tarball was updated in place
(cherry picked from commit 652030e85d)
2014-10-20 15:24:17 -04:00
Eelco Dolstra
29b8c6a4e6 Fix semicolon 2014-10-20 12:00:23 +02:00
William A. Kennington III
6aa0a568ab kernel: 3.12.29 -> 3.12.30
(cherry picked from commit 8c138fd489)
2014-10-20 12:00:23 +02:00
William A. Kennington III
054d9939b5 kernel: 3.12.28 -> 3.12.29
(cherry picked from commit 4a2ecb2c62)
2014-10-20 12:00:23 +02:00
Wout Mertens
66af731b14 Travis build: update script from master 2014-10-15 21:53:51 +02:00
Domen Kožar
fec11dcecb openssl: 1.0.1i -> 1.0.1j (CVE-2014-3513, CVE-2014-3567, CVE-2014-3568) 2014-10-15 16:13:16 +02:00
wmertens
852cecdd39 Travis build: source environment before build
💩
(cherry picked from commit 5e6b6df33e)
2014-10-15 12:01:18 +02:00
Wout Mertens
26b37474e7 Travis: Set up for release-14.04 2014-10-15 11:25:20 +02:00
Lluís Batlle i Rossell
3f0360927e nixos nfs: allow setting the lockd ports.
This helps in setting a fixed firewall open port for NFS lockd.

Based on:
http://rlworkman.net/howtos/NFS_Firewall_HOWTO
2014-10-15 10:59:51 +02:00
Rob Vermaas
b7451d91e8 Dohh 2014-10-14 11:43:42 +02:00
Rob Vermaas
654eaeb2ca amazon-image.nix: Pass --option build-users-group '' to nix tools to make Amazon generation work with nix-1.8+ 2014-10-14 11:38:59 +02:00
Shea Levy
0e935f1eb2 Update nixUnstable
(cherry picked from commit aa847f4772)
2014-10-07 15:53:26 +02:00
Peter Simons
dbadfad0a2 orc: disable test suite to fix spurious failures
Example: http://hydra.nixos.org/build/15550338/nixlog/2/raw
2014-10-03 21:32:12 +02:00
Emery Hemingway
3d86e80ef3 cjdns: update from 20140919 20140922
package installs to .../bin
fix service module to look in .../bin

Closes #4240

(cherry picked from commit 61f0d9b251)
2014-10-01 23:29:13 +02:00
Emery Hemingway
e903ad0fa5 cjdns: update 20140829 to 20140919
Closes #4186

(cherry picked from commit 95c72a5f60)
2014-10-01 23:29:12 +02:00
Emery Hemingway
8aa0157de9 cjdns: package update from 20140303 to 20140829
(cherry picked from commit fc6ccd1080)
2014-10-01 23:29:12 +02:00
Emery Hemingway
964d18d89e cjdns: new declarative service expression
systemd service wants network-interfaces.target rather than network.target
assertion on config.networking.enableIPv6

(cherry picked from commit f60ac82cac)
2014-10-01 23:29:12 +02:00
Peter Simons
41d3d1b306 bash: drop obsolete cve-2014-7169.patch to fix the build 2014-10-01 23:15:25 +02:00
Peter Simons
56b7e164eb bash: add patch sets 49, 50, and 51 to fix http://lcamtuf.blogspot.de/2014/10/bash-bug-how-we-finally-cracked.html 2014-10-01 23:07:40 +02:00
Eelco Dolstra
b9bde98161 tests/kde4.nix: Don't build kdeedu
This prevents a dependency on liblapack (which randomly fails) and
TeXlive (which is huge).

http://hydra.nixos.org/build/14897240
2014-09-29 13:31:37 +02:00
Lluís Batlle i Rossell
01dfd5a44a Updating toxic to 0.5.1 2014-09-29 10:40:09 +02:00
Lluís Batlle i Rossell
562ff9c1e1 Updating utox/libtoxcore to the latest, to fix utox build.
There was a test failing. I also renamed the attr uTox to utox, for the more
common lowercase in all-packages.

Conflicts:
	pkgs/top-level/all-packages.nix

(cherry pick of 93fd8fb3a5 )
2014-09-29 10:39:44 +02:00
Lluís Batlle i Rossell
fece51a8a6 Fixing libtoxcore libvpx propagate. 2014-09-29 10:38:53 +02:00
Lluís Batlle i Rossell
9a66026234 Fix toxic install for DHTnodes and other share files. 2014-09-29 10:38:52 +02:00
Lluís Batlle i Rossell
c294fe0f53 Making tox/toxic A/V libs disabled in ARM. 2014-09-29 10:38:51 +02:00
Lluís Batlle i Rossell
4f85481ce0 Adding qtox. Making libtoxcore propagate libvpx. 2014-09-29 10:38:50 +02:00
Domen Kožar
9766bd2f4e libtoxcore: disable tests for now
(cherry picked from commit 4742c886dd)
2014-09-29 10:38:36 +02:00
Lluís Batlle i Rossell
9eb8f47666 Updating utox (fixing PREFIX too)
(cherry picked from commit 1b6101775d)
2014-09-29 10:38:11 +02:00
Lluís Batlle i Rossell
77cda0aa83 Updating toxic/libtoxcore/libsodium
(cherry picked from commit 1955da1b8c)
2014-09-29 10:38:04 +02:00
Domen Kožar
3baef65dc6 toxic: git -> 0.4.7
(cherry picked from commit 13ca3624a7)
2014-09-29 10:35:30 +02:00
aszlig
d530f889ed toxic: Update to latest upstream Git master.
Unfortunately they've changed their build system to be makefile-only and
they don't seem to include test cases in the CLI anymore, so we needed
to adapt accordingly. Also added freealut and openal to the buildInputs,
in order to allow audio support.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit 9edfad2717)
2014-09-29 10:35:27 +02:00
Domen Kožar
6e1a74d284 uTox: downgrade to work with current libtoxcore
(cherry picked from commit 2099db4d00)
2014-09-29 10:34:44 +02:00
Domen Kožar
eb02ca8c03 add uTox
(cherry picked from commit e07c2c2cfd)
2014-09-29 10:34:29 +02:00
Domen Kožar
d2739c17ef libtoxcore: upgrade for a few rev to get i686-linux build working
(cherry picked from commit be6ae818dc)
2014-09-29 10:33:35 +02:00
aszlig
4438e5d9d8 libtoxcore: Enable and fix up running test suite.
We not only require libcheck but also needed to disable a few tests,
without providing the former, test cases were signalled as being run
successfully but weren't actually run.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit e542ff7288)
2014-09-29 10:33:27 +02:00
aszlig
847ec71960 libtoxcore: Add libopus and libvpx to buildInputs.
Those are necessary to do audio/video calls, which I guess is the whole
point of the Tox project.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit 40548fce62)
2014-09-29 10:33:22 +02:00
aszlig
a0f9aa8184 libtoxcore: Update to latest Git master.
The GitHub repository has changed the name to "toxcore".
Also indented buildInputs/configureFlags a bit less messy.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit 2aa89519a0)
2014-09-29 10:33:17 +02:00
Lluís Batlle i Rossell
0115853aa9 Updating lesstif to 0.95.2 (2009).
Some patches can be removed.
I updated it because the scroll wheel was going the oposite direction in ddd.
https://bugs.launchpad.net/ubuntu/+source/ddd/+bug/37664
2014-09-29 10:23:17 +02:00
Vladimír Čunát
8da96f6b0e lyx: maintenance update
This is supposed to be the last version of the 2.0.x branch
2014-09-27 13:19:10 +02:00
Vladimír Čunát
5f2f1b05e3 lib/platforms: add "armv6l-linux" to all platforms
It was only in mesaPlatforms, which caused nix appear unsupported in there.

(cherry picked from commit 7323d5e128)
2014-09-27 11:24:55 +02:00
Eelco Dolstra
8cf5281744 Add some more stuff to the small channel 2014-09-25 17:52:25 +02:00
Eelco Dolstra
4dfca8e14a Add an entire NixOS build to the channel
This causes some cruft to be uploaded (such as unit files) but it
ensures that every package used by the base system ends up in the
channel, not just environment.systemPackages.
2014-09-25 17:51:09 +02:00
Eelco Dolstra
7185fc1054 bash: Fix for CVE-2014-7169
(cherry picked from commit 0a0ebd8c44)
2014-09-25 14:41:20 +02:00
Eelco Dolstra
d927ce03e4 Add nodejs to the small channel 2014-09-25 12:50:36 +02:00
Rob Vermaas
095d42101c nixUnstable: Update to nix-1.8pre3823_53b044c 2014-09-25 11:57:21 +02:00
Eelco Dolstra
caeba6f22a nss: Update to 3.16.5
CVE-2014-1568

(cherry picked from commit 711d67263a)
2014-09-25 11:46:25 +02:00
Eelco Dolstra
f1ce80f98e firefox: Update to 32.0.3
CVE-2014-1568

(cherry picked from commit d265c213b4)
2014-09-25 11:46:25 +02:00
Eelco Dolstra
f963f57b62 Remove missing attribute 2014-09-25 01:01:54 +02:00
Eelco Dolstra
2c7acc6731 Add a jobset for a "nixos-small" channel
This channel only builds a small subset of Nixpkgs, mostly suitable
for servers. Since the channel update doesn't require thousands of
packages to be built first, it should provide much faster turnaround
in case of security updates.
2014-09-25 00:28:18 +02:00
Eelco Dolstra
360b0a7b70 Add all default NixOS packages to the channel
The job ‘dummy’ depends on the default contents of
‘environment.systemPackages’, thus ensuring that those packages all
end up in the channel.

(cherry picked from commit 1cd727180e)
2014-09-25 00:27:45 +02:00
Eelco Dolstra
a296abde48 Installer test: Use the minimal ISO
So we don't depend on KDE etc. (which we don't even test here).

(cherry picked from commit 0a967b9268)
2014-09-25 00:27:03 +02:00
Eelco Dolstra
ebacaf95f9 test-driver: Use netpbm instead of imagemagick
Imagemagick pulls in 100s of megabytes of dependencies.

(cherry picked from commit 51c349d0cc)
2014-09-25 00:27:03 +02:00
Eelco Dolstra
6bee20d12f netpbm: Update to 10.66.00
Also, borrow a tarball from Gentoo so we don't have to use
fetchsvn. And don't depend on libX11 by default.

(cherry picked from commit 08732891e1)
2014-09-25 00:27:03 +02:00
Shell Turner
eda84cb2fd Update bash patchset to fix CVE-2014-6271 2014-09-24 17:36:25 +02:00
James Cook
4e5c8b34f8 firefox: Update to 32.0.2.
(cherry picked from commit 27f3301650)
2014-09-23 10:44:29 +02:00
Mathijs Kwik
1361e2f97e xulrunner: stick to firefox's src attribute
(cherry picked from commit 04369b6819)
2014-09-23 10:44:15 +02:00
Eelco Dolstra
ef2f94c6fe systemd: Fix uninitialised memory issue in veth setup
This caused containers to randomly fail, in particular if the machine
name was 8 characters.

(cherry picked from commit 97d6afafaa)
2014-09-22 19:21:09 +02:00
Eelco Dolstra
0a3dc55ffc systemd: Apply backport fixes
In particular, added a few patches that improve systemd-nspawn
container behaviour.

(cherry picked from commit 38567ddc80)
2014-09-22 19:20:43 +02:00
Vladimír Čunát
4962edc4d0 gcc: bugfix update 4.8.2 -> .3
It's supposed to fix over 140 problems from upstream bugzilla.
https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=4.8.3

A previously separate patch got included in the release.

I tested that stdenv still builds.

(cherry picked from commit 610370f844)
2014-09-22 19:14:27 +02:00
Eelco Dolstra
f446555c23 nixos-rebuild: Don't pass -K by default
(cherry picked from commit 05163e99db)
2014-09-22 19:12:38 +02:00
Eelco Dolstra
83f7e4689b smem: Add package
This is a memory reporting tool that accounts for shared memory.

(cherry picked from commit 9a6484b255)
2014-09-22 19:12:18 +02:00
Eelco Dolstra
9e580c1944 boehm-gc: Support --enable-large-config
(cherry picked from commit 8e2e4216ba)
2014-09-22 19:11:54 +02:00
Eelco Dolstra
c0d4ce3e5b httpd: Add option for specifying robots.txt
(cherry picked from commit 0de982d75b)
2014-09-22 19:11:31 +02:00
Eelco Dolstra
0569cc408a httpd: Don't emit robots.txt if there are no robots entries
(cherry picked from commit 837a0c05e5)
2014-09-22 19:11:13 +02:00
Eelco Dolstra
5900bfb4ee valgrind: Update to 3.10.0
(cherry picked from commit 9f12c8bde8)
2014-09-22 19:11:07 +02:00
Eelco Dolstra
6797cb5c3b Net::Amazon::S3: Add to channel
(cherry picked from commit d49991e40a)
2014-09-22 19:10:59 +02:00
Michael Raskin
953433939b nixos-iso: Use a simpler disk label (#2838)
(cherry picked from commit 8ec5d0fd0f)
2014-09-20 08:21:30 +02:00
Marco Maggesi
494b315d3a Update OpenAFS client to version 1.6.9 2014-09-19 23:19:25 +02:00
Marco Maggesi
b951b618e8 Merge pull request #4123 from falsifian/krb5
krb5: Update to 12.2.2.  (Please test before merging.)
2014-09-19 16:59:59 +02:00
Marco Maggesi
7d8cffa31a Update hol_light to r198. Add myself as a maintainer 2014-09-17 13:52:57 +02:00
Eelco Dolstra
8954ea814e firefox: Update to 32.0.1
(cherry picked from commit 0c152324d2)
2014-09-15 20:09:35 +02:00
Vladimír Čunát
a617e80aa4 liferea: maintenance update
(cherry picked from commit 4031707138)

Conflicts (one update skipped):
	pkgs/applications/networking/newsreaders/liferea/default.nix
2014-09-13 19:47:39 +02:00
Vladimír Čunát
4800bbbe57 flashplayer-11: update, including security fixes
(cherry picked from commit 0047db47bd)
2014-09-13 16:16:31 +02:00
aszlig
300e25cfaa python-hetzner: Update to bugfix version 0.7.2.
From version 0.7.1 this fixes encoding problems with some DELL servers
while running the CLI.

And more importantly in version 0.7.2, it fixes the SSL certificate
error (Hetzner changed CA) which renders the library pretty much
useless.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit 415c31372c)
2014-09-11 14:16:08 +02:00
Blaz Bratanic
9e170188ee Fixed download path
(cherry picked from commit 1ecfba4391)
2014-09-09 20:29:32 +02:00
Eelco Dolstra
8d9f9d5b87 linux: Update to 3.12.28
(cherry picked from commit 19b1fafe5f)
2014-09-08 15:49:48 +02:00
Eelco Dolstra
72162706a7 firefox: Workaround for building on i686-linux
http://hydra.nixos.org/build/13992569
(cherry picked from commit 4ead67b785)
2014-09-08 15:46:27 +02:00
Eelco Dolstra
03bec38123 Remove reference to icecat
(cherry picked from commit d2539605e1)
2014-09-05 15:42:07 +02:00
Eelco Dolstra
f9c24179f1 /dev/sda1 -> "/dev/sda1"
Otherwise Nix might try to copy /dev/sda1 under certain circumstances
:-)

(cherry picked from commit f6b4214567)
2014-09-05 15:41:50 +02:00
Eelco Dolstra
c0182b6b07 lttng-modules: Mark as broken
These do not build for any kernel:

  http://hydra.nixos.org/eval/1149989?filter=lttng&compare=1149981

(cherry picked from commit 4b7f1a9be3)
2014-09-05 15:40:31 +02:00
Eelco Dolstra
ec17cf89cc Cache::Cache: Disable tests
(cherry picked from commit aa8a728b04)
2014-09-05 15:40:18 +02:00
Eelco Dolstra
9203f22238 firefox: Update to 32.0
(cherry picked from commit 88964f37a0)
2014-09-05 15:40:06 +02:00
Eelco Dolstra
a5e7f0831c nss: Update to 3.16.4
(cherry picked from commit b3b06af89a)
2014-09-05 15:40:05 +02:00
Eelco Dolstra
0aeed5baa6 nspr: Update to 4.10.7
(cherry picked from commit 0dbdc857d7)
2014-09-05 15:40:05 +02:00
Eelco Dolstra
c5d63cb35e linux: Update to 3.12.27
CVE-2014-3534
2014-09-03 19:44:00 +02:00
Eelco Dolstra
e4805e3d34 Bump the amount of memory for the installer test
It randomly OOMs.

http://hydra.nixos.org/build/13587153
(cherry picked from commit 619f18956d)
2014-09-03 19:43:09 +02:00
Ricardo M. Correia
41f8b13fa1 flashplayer: Update from 11.2.202.394 -> 11.2.202.400
Signed-off-by: Domen Kožar <domen@dev.si>
2014-09-01 21:15:58 +02:00
Ricardo M. Correia
5a6541ec28 flashplayer: Update from 11.2.202.378 -> 11.2.202.394
Signed-off-by: Domen Kožar <domen@dev.si>
2014-09-01 21:15:09 +02:00
Ricardo M. Correia
3b9fceab24 flashplayer: Update from 11.2.202.359 -> 11.2.202.378
Signed-off-by: Domen Kožar <domen@dev.si>
2014-09-01 21:15:02 +02:00
Rüdiger Sonderfeld
e64237cdb4 man-pages: Update to 3.71.
(cherry picked from commit f61fb466eb)
2014-08-25 10:06:59 +02:00
Eelco Dolstra
2bc3109460 Don't barf if /var/log doesn't support ACLs
http://hydra.nixos.org/build/13462892
(cherry picked from commit 7c4591d010)
2014-08-25 10:06:18 +02:00
Eelco Dolstra
521399f5cd linux: Enable ACLs in ext3
http://hydra.nixos.org/build/13462892
(cherry picked from commit e4752d7877)
2014-08-25 10:06:13 +02:00
Eelco Dolstra
2a6fee4c06 man-pages: Update to 3.70
(cherry picked from commit c37057240f)
2014-08-25 10:05:55 +02:00
Eelco Dolstra
41df91401e types.nix: Add ‘either’ type
(cherry picked from commit f932910323)
2014-08-25 10:03:38 +02:00
Eelco Dolstra
1e42f0625a lockfreeQueue: Don't build on Hydra
It times out: http://hydra.nixos.org/job/nixos/release-14.04/nixpkgs.haskellPackages_ghc763_profiling.lockfreeQueue.x86_64-linux
2014-08-21 17:23:00 +02:00
Eelco Dolstra
3e8072659a cedet: Mark as broken
It has been timing out since forever:

  http://hydra.nixos.org/job/nixos/release-14.04/nixpkgs.emacs23Packages.cedet.x86_64-linux
2014-08-21 14:51:21 +02:00
Rob Vermaas
1aa1cb700b Update node-packages-generated. Remove packages from node-packages.json that use an npm package that has a cyclic dependency. See also npm2nix#3 2014-08-21 11:37:55 +02:00
Vladimír Čunát
77fcd5fc23 twinkle eval: fix the typo
(cherry picked from commit 2d03fbf752)
2014-08-20 23:39:16 +02:00
Vladimír Čunát
2a173d70c2 twinkle: fix build (fixes #3673)
Pulled patches from Debian and hacked around linking errors.
I'm able to ring my mobile phone now.
However, on exit the process is stuck and needs kill -9.

CC: maintainer @MarcWeber.
(cherry picked from commit c198a36898)

Conflicts (trivial):
	pkgs/applications/networking/instant-messengers/twinkle/default.nix
2014-08-20 21:43:31 +02:00
Vladimír Čunát
2b27053695 thrift: disable parallel building, as it fails on hydra
(cherry picked from commit 45371d380c)
2014-08-20 01:38:48 +02:00
Rickard Nilsson
233a5db368 obnam: Update from 1.6.1 to 1.8
(cherry picked from commit bdea35d98b)
2014-08-19 16:12:25 +02:00
Vladimír Čunát
75fb186f50 Re-revert the previous and fix tarball
This reverts commit 155996ebde.

I'm sorry for the problems. Now I checked the tarball does build locally.
2014-08-18 21:12:47 +02:00
Eelco Dolstra
155996ebde Revert "Turn some license strings into lib.licenses values"
This reverts commit f9f5be6113 because
it breaks Nixpkgs evaluation.

http://hydra.nixos.org/build/13476850
2014-08-18 14:52:56 +02:00
Eelco Dolstra
1c9afeed07 nixos-container destroy: Make idempotent
(cherry picked from commit e6c00e60c3)
2014-08-17 23:33:31 +02:00
Eelco Dolstra
4d8f020912 nixos-container destroy: Remove gcroots
(cherry picked from commit 883fa4f920)
2014-08-17 23:33:21 +02:00
Vladimír Čunát
e8b62a519a xorg: revert larger updates from master
I'll better be more conservative.
2014-08-15 02:08:17 +02:00
Vladimír Čunát
a0e7caac60 llvm: fixup the paxmark phase (not here yet) 2014-08-15 00:04:52 +02:00
Vladimír Čunát
bd5036c890 ffmpeg: fix forgotten hash 2014-08-14 23:46:51 +02:00
Eelco Dolstra
5a06477a3d Merge pull request #3595 from wkennington/master.kernel
Kernel Updates
(cherry picked from commit 08b8eaae1c)

Conflicts (skipping some intermediate bump commits):
	pkgs/os-specific/linux/kernel/linux-3.10.nix
	pkgs/os-specific/linux/kernel/linux-3.14.nix
	pkgs/os-specific/linux/kernel/linux-3.15.nix
	pkgs/os-specific/linux/kernel/linux-3.16.nix
	pkgs/os-specific/linux/kernel/linux-3.4.nix
2014-08-14 23:13:41 +02:00
Marc Weber
b7f86f56d1 apache 2_4 update, fixes some CVE's
See http://www.apache.org/dist/httpd/Announcement2.4.html It compiles,
didn't run it. I guess minor update doesn't cause much trouble even
though there are some new features

(cherry picked from commit ba154ec9d4)
2014-08-14 23:11:51 +02:00
Cillian de Róiste
7d031e5a2c kde4_next.kde_wacomtablet: update from 2.0 to 2.0.2, potentially fixes CVE-2012-4514, CVE-2012-4514
(cherry picked from commit d4fb2e83db)
2014-08-14 23:11:37 +02:00
Vladimír Čunát
9cc04de7eb sync from master: xorg 2014-08-14 23:08:42 +02:00
Vladimír Čunát
f0a363c910 sync from master: llvm-3.4 maintenance update 2014-08-14 23:08:32 +02:00
Vladimír Čunát
2048460bdf sync from master: xfce minor updates 2014-08-14 23:01:48 +02:00
Vladimír Čunát
aed21bd6d5 sync from master: doc/* 2014-08-14 22:56:50 +02:00
Vladimír Čunát
48a10fc66e sync from master: pkgs/development/libraries/*
Picked what looked like non-intrusive changes to relatively used libs.
2014-08-14 22:51:27 +02:00
Gergely Risko
b79e3ce6a7 Get rid of bootstrap-tools dependency from xz (and therefore stdenv)
0769fc5b77 broke this by setting CONFIG_SHELL.

(cherry picked from commit 59291fdbf4)
2014-08-14 22:37:19 +02:00
Gergely Risko
1c0068a0c9 Enable parallel building for GCC.
Even if using profiledbootstrap.  This was unsafe before 4.8, and
then the documentation was not fixed on time.

The documentation got fixed here:
  c763997f34

But the actual code was already fixed here:
  5d2fca09d5

So this is safe both for GCC 4.8 and GCC 4.9.

(cherry picked from commit f199e115d2)
2014-08-14 22:37:18 +02:00
Vladimír Čunát
23789cc23e SDL: minor sync from master 2014-08-14 22:16:55 +02:00
Peter Simons
217724b340 Partially revert 7a45996 some more.
Removing more references to the non-existent license "stdenv.lib.licenses.perl5".
Thanks to @FlashKorten for catching those.

(cherry picked from commit 5cc55e9523)
2014-08-14 22:02:44 +02:00
Peter Simons
0d133f7c62 perl-packages.nix: partially revert 7a45996233
The commit referred to non-existent license "stdenv.lib.licenses.perl5".

(cherry picked from commit 4895ace127)

Conflicts:
	pkgs/top-level/perl-packages.nix
2014-08-14 22:02:25 +02:00
Mateusz Kowalczyk
f9f5be6113 Turn some license strings into lib.licenses values
(cherry picked from commit 7a45996233)

Conflicts:
	pkgs/applications/audio/espeak/default.nix
	pkgs/applications/audio/espeak/edit.nix
	pkgs/applications/editors/emacs-modes/metaweblog/default.nix
	pkgs/applications/editors/emacs-modes/proofgeneral/default.nix
	pkgs/applications/editors/sublime3/default.nix
	pkgs/applications/graphics/potrace/default.nix
	pkgs/applications/science/electronics/tkgate/2.x.nix
	pkgs/desktops/gnome-3/3.10/core/folks/default.nix
	pkgs/desktops/gnome-3/3.10/misc/goffice/default.nix
	pkgs/desktops/gnome-3/3.12/core/evince/default.nix
	pkgs/desktops/gnome-3/3.12/core/vte/default.nix
	pkgs/development/compilers/jdk/jdk7-linux.nix
	pkgs/development/compilers/opendylan/bin.nix
	pkgs/development/compilers/opendylan/default.nix
	pkgs/development/libraries/clutter/1.18.nix
	pkgs/development/libraries/gsl/default.nix
	pkgs/development/libraries/gstreamer/legacy/gstreamermm/default.nix
	pkgs/development/libraries/science/math/liblbfgs/default.nix
	pkgs/development/libraries/sword/default.nix
	pkgs/development/libraries/tbb/default.nix
	pkgs/development/ocaml-modules/lablgl/default.nix
	pkgs/games/crrcsim/default.nix
	pkgs/games/openxcom/default.nix
	pkgs/games/tibia/default.nix
	pkgs/os-specific/linux/disk-indicator/default.nix
	pkgs/os-specific/linux/keyutils/default.nix
	pkgs/os-specific/linux/usermount/default.nix
	pkgs/servers/mpd/clientlib.nix
	pkgs/servers/search/elasticsearch/default.nix
	pkgs/tools/misc/t1utils/default.nix
	pkgs/top-level/perl-packages.nix
	pkgs/top-level/python-packages-generated.nix
	pkgs/top-level/python-packages.nix
2014-08-14 22:00:30 +02:00
Austin Seipp
2abcf20f7b Merge pull request #2924 from doublec/tor_0_2_4_22
Update tor to 0.2.4.22 and tor browser to 3.6.2 (close #3136)
(cherry picked from commit cf4b0a1222)
2014-08-14 21:31:29 +02:00
Vladimír Čunát
8d413eb4a7 glibc: fix CVE-2014-0475 by upstream patches (close #3445)
https://sourceware.org/bugzilla/show_bug.cgi?id=17137
(cherry picked from commit 9253a95f6b)
2014-08-12 19:03:55 +02:00
Eelco Dolstra
351aec7002 Add a bunch of Hydra dependencies to the channel
(cherry picked from commit 688824cc60)
2014-08-11 20:33:07 +02:00
robberer
48c543c32f add nvidia-uvm module which is necessary for blender GPU support
(cherry picked from commit 9683c6e806)
2014-08-11 14:08:32 +02:00
Eelco Dolstra
1b117a59d2 nvidia-x11: Update to 340.24
(cherry picked from commit 6c0002ec8d)
2014-08-11 14:07:08 +02:00
Nikita Mikhailov
1ec17b2585 skype: 4.2.0.13 -> 4.3.0.37 2014-08-11 11:55:06 +02:00
Eelco Dolstra
f4eaaee52a debian: Update to 6.0.10
(cherry picked from commit 05e81e0d9f)
2014-08-10 15:17:19 +02:00
Eelco Dolstra
71e68bb52c tests/ipv6.nix: Fix race
http://hydra.nixos.org/build/13119647
(cherry picked from commit c7ca46904f)
2014-08-10 14:56:08 +02:00
Eelco Dolstra
e592a0e94b test-instrumentation.nix: Set an empty root password
This makes it easier to log in during interactive sessions.

(cherry picked from commit 2b9ea7fd90)
2014-08-10 14:38:30 +02:00
Eelco Dolstra
526be644a8 test-instrumentation.nix: Improve logging
In particular, don't clobber the serial console with duplicate output
from systemd and the journal, and increase the log level.

(cherry picked from commit eab25b104a)
2014-08-10 14:38:27 +02:00
Eelco Dolstra
11e57b88ee systemd: Use the default log target ("journal-or-kmsg")
This ensures that early systemd messages end up in the journal (via
the kmsg buffer).

(cherry picked from commit 0d3b3bd01b)
2014-08-10 14:38:17 +02:00
Cillian de Róiste
e6da853ad1 inkscape: add python to the PATH, fixes #3449
(cherry picked from commit d597651949)
2014-08-09 17:09:12 +02:00
Eelco Dolstra
9425114fbd debBuild: Allow setting the package name and overriding the install command
(cherry picked from commit 940eb8bfc1)
2014-08-08 14:17:12 +02:00
Peter Simons
dd1e64444d openssl: update to version 1.0.1i
See https://www.openssl.org/news/secadv_20140806.txt for a long list of CVE numbers.
Fixes <https://github.com/NixOS/nixpkgs/issues/3485>.

(cherry picked from commit 5c276c4f68)
2014-08-08 09:53:12 +02:00
Eelco Dolstra
857d14dbba openjdk: Update to 7u65-b32
(cherry picked from commit b4c971b14a)
2014-08-05 20:16:30 +02:00
Eelco Dolstra
71dce79daa openjdk: Set more informative version string
Also, disable full debug symbols. Don't know if this matters because
we're already stripping everything.

(cherry picked from commit 1b391e6bf9)
2014-08-05 20:16:30 +02:00
Eelco Dolstra
c3cce5d11f openjdk: Update to 7u60-b30
(cherry picked from commit 639f117ec4)
2014-08-05 20:16:30 +02:00
Eelco Dolstra
a8df3f1166 openjdk: Drop dependency on CUPS
We only need the CUPS headers, not the whole package.

(cherry picked from commit c4877df388)
2014-08-05 20:16:30 +02:00
Eelco Dolstra
3e4e106674 cacert: Update to 20140715
This is generated with a more recent version of mk-ca-bundle.pl. The
previous version mistakenly dropped some certificates, like "Verisign
Class 3 Public Primary Certification Authority".

(cherry picked from commit 6b67028383)
2014-08-05 10:45:59 +02:00
Eelco Dolstra
7f5d30572d nixUnstable: Update to 1.8pre3718_51485dc
(cherry picked from commit a9a4cdd3d0)
2014-08-04 14:09:25 +02:00
William A. Kennington III
a6cdb424ba kernel: 3.12.25 -> 3.12.26
(cherry picked from commit eb9ee180d9)
2014-08-04 14:02:42 +02:00
Lluís Batlle i Rossell
379116980f Update mumble to 1.2.7. 2014-08-01 16:56:44 +02:00
Lluís Batlle i Rossell
2def4e4b64 freecad: updating to 0.14
I had to update all the pyside programs, or freecad failed to build.  I picked
the versions advertised in http://qt-project.org/wiki/PySideDownloads . The
rest I took for github latest releases.
2014-08-01 16:56:44 +02:00
Eelco Dolstra
6593a986a9 Shut up a warning in stage 2
(cherry picked from commit 39a6750362)
2014-07-31 16:27:39 +02:00
Eelco Dolstra
8e338e3a0b Remove Subversion from the installation CD
(cherry picked from commit 5e96158234)
2014-07-31 16:27:34 +02:00
Eelco Dolstra
de12367e89 postgresql: Update to 9.0.18, 9.1.14, 9.2.9, 9.3.5
(cherry picked from commit e4e5502966)
2014-07-31 16:27:08 +02:00
Eelco Dolstra
937ee6c191 nixos/tests/containers.nix: Don't ping
This randomly fails with "Destination Host Unreachable". That
shouldn't happen, since all interfaces/routes should be up after
"nixos-container start" returns. Need more investigation...

(cherry picked from commit 19fc92a8ed)
2014-07-31 16:26:38 +02:00
Lluís Batlle i Rossell
3f95644a28 Setting retroshare 0.6 as lowPrio, it's unstable. 2014-07-31 10:14:23 +02:00
Vladimír Čunát
6077ef462e Merge #3400: kernel updates
(cherry picked from commit 33e4a7f623)
2014-07-30 20:47:59 +02:00
Eelco Dolstra
ca377078b2 Check for systemd environment variables that are too long
Issue #3403. For the case of $PATH being too long, we could call
buildEnv automatically.

(cherry picked from commit 9956b97b2f)
2014-07-30 10:52:43 +02:00
Eelco Dolstra
33afc8161e cacert: Update to 20140704
(cherry picked from commit b9c457ba12)
2014-07-30 10:52:43 +02:00
Eelco Dolstra
6de89bfa66 Fix evaluation
http://hydra.nixos.org/build/12958569
2014-07-30 10:19:13 +02:00
Petr Rockai
bee9b9c2d1 gnu: Fix (evaluation of the) call to forceSystem.
(cherry picked from commit 559f423417)
2014-07-29 15:30:25 +02:00
Petr Rockai
94e0149a18 pkgsi686Linux: Use 32b kernels (x86_64 kernels can't be built with 32b gcc).
(cherry picked from commit bde992bbbc)
2014-07-29 15:30:19 +02:00
Eelco Dolstra
e3cf157d15 firefox: Build without xulrunner
Fixes #2950.

(cherry picked from commit 5c5f115603)

Conflicts:
	pkgs/applications/networking/browsers/firefox/default.nix
	pkgs/top-level/all-packages.nix
	pkgs/top-level/release.nix
2014-07-29 15:16:59 +02:00
Eelco Dolstra
85a15ddfd7 Remove unused function
(cherry picked from commit ee3db692e6)
2014-07-28 20:32:39 +02:00
Eelco Dolstra
d1fddb2698 firefox: Update to 31.0
Also boldly re-enable parallel building.

(cherry picked from commit 21c7ed54e3)
2014-07-28 20:29:41 +02:00
Eelco Dolstra
2227e07345 nss: Update to 3.16.3
(cherry picked from commit ea0013a0d9)
2014-07-28 20:28:02 +02:00
Eelco Dolstra
085ef8f1b4 linux: Update to 3.12.25
(cherry picked from commit 0852d9e364)
2014-07-28 20:27:55 +02:00
Sebastian Korten
1d480b97ba at: upgrade to 3.1.14 - seems to solve problem with kernel 3.6
(cherry picked from commit e57249ab20)
2014-07-27 23:07:30 +02:00
Vladimir Kirillov
f6ad69a9d8 rsync: sha256 for the patch was updated
(cherry picked from commit 2dfb036a30)
2014-07-20 20:25:51 +02:00
Emery Hemingway
57f53ed84e rsyncd: default read/write permissions should be nobody:nogroup
(cherry picked from commit 265c489391)
2014-07-20 20:25:41 +02:00
Eelco Dolstra
6c4b4c146f Revert "go 1.3 and darwin support"
This reverts commit 6a89670576. It
breaks evaluation:

http://hydra.nixos.org/build/12580541
2014-07-18 00:25:40 +02:00
Eelco Dolstra
6ec5022ac6 Don't restart systemd-journal-flush
It only needs to be started during boot. Starting it at other times
shouldn't hurt, except that if systemd-journald is restarting at the
same time, the latter might not have a SIGUSR1 signal handler
installed yet, so it might be killed by systemd-journal-flush. (At
least that's my theory about the dead systemd-journald instances in
the build farm...)

(cherry picked from commit 1a1442db74)
2014-07-17 21:06:59 +02:00
Charles Strahan
6a89670576 go 1.3 and darwin support 2014-07-17 15:52:36 +02:00
Eelco Dolstra
735bfb9847 Don't mount /sys/fs/fuse/connections and /sys/kernel/config
These fail to mount if you don't have the appropriate kernel support,
and this confuses NixOps' ‘check’ command. We should teach NixOps not
to complain about non-essential mount points, but in the meantime it's
better to turn them off.

(cherry picked from commit 6eaced3582)
2014-07-14 22:48:33 +02:00
Eelco Dolstra
e5fe68dd34 Don't restart systemd-remount-fs
It's only needed during early boot (in fact, it's probably not needed
at all on NixOS). Restarting it is expensive because it does a sync()
of the root file system.

(cherry picked from commit 3b2609deec)
2014-07-14 14:40:15 +02:00
Eelco Dolstra
87d2fbb50a debian: Update to 7.6
(cherry picked from commit 1245ca3ff7)
2014-07-14 14:39:35 +02:00
Eelco Dolstra
6756ec27dd Fix info command
The "info" command has been broken on NixOS since
457fdb3842 (proving that nobody uses
info).

(cherry picked from commit 973c9abdbe)
2014-07-11 22:48:13 +02:00
Eelco Dolstra
7b19f22bb4 tzdata: Update to 2014e
(cherry picked from commit 0a11e40596)
2014-07-11 22:48:05 +02:00
Vladimír Čunát
a351ad3edd linux_*: update, including CVE-2014-4699 (most likely)
CC #3196. No updates yet on 3.2 and 3.12 branches.

(cherry picked from commit eb659e89b4)

Conflicts (some updates previously not backported before):
	pkgs/os-specific/linux/kernel/linux-3.10.nix
	pkgs/os-specific/linux/kernel/linux-3.14.nix
	pkgs/os-specific/linux/kernel/linux-3.15.nix
	pkgs/os-specific/linux/kernel/linux-3.4.nix
2014-07-09 22:58:45 +02:00
Lluís Batlle i Rossell
0f6f98755e Adding retroshare 0.6 (unstable) 2014-07-09 22:23:57 +02:00
aszlig
971b92057a nixos/log2html: Remove schema from jQuery URLs.
This allows viewing test logs for example when using a Hydra running
with HTTPS.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit 622673495b)
2014-07-08 00:39:17 +02:00
Moritz Maxeiner
235cceac93 eclipse: add Eclipse Standard 4.4 Luna 2014-07-08 00:37:57 +02:00
Vladimír Čunát
99a7a9cd34 libxklavier: fix not finding xkbcomp (fixes #3173)
Also refactor the expression a bit,
and add description+license.

(cherry picked from commit 45ad922763)
2014-07-07 19:05:00 +02:00
Eelco Dolstra
ea433712c2 gperftools: Support Darwin
(cherry picked from commit 63aff93c9b)
2014-07-07 18:24:52 +02:00
Eelco Dolstra
93160b855e Manual: html -> xhtml
(cherry picked from commit 2737291b5d)
2014-07-07 18:23:41 +02:00
Eelco Dolstra
c920b9f9f7 linux: Update to 3.12.24
CVE-2014-4508, CVE-2014-0206.

(cherry picked from commit 1596c3a012)
2014-07-07 18:23:33 +02:00
Rob Vermaas
9c4ea0631e Upgrade rsyslog to latest (v7) stable release. Added liblogging (new dependency of rsyslog).
(cherry picked from commit 83e1ff846c)
2014-07-07 16:24:46 +02:00
Vladimír Čunát
67b4e3ff73 mariadb: switch to a working download URL
(cherry picked from commit 114b75ce97)
2014-07-04 13:35:58 +02:00
Domen Kožar
6c47697e72 Revert "Revert "python: 2.7.7 -> 2.7.8""
This reverts commit 7bd5fb33ee.

Fixed in next commit
2014-07-02 19:56:24 +02:00
Domen Kožar
a94ce55ddb python: link gcc_s 2014-07-02 19:55:57 +02:00
Rob Vermaas
7bd5fb33ee Revert "python: 2.7.7 -> 2.7.8"
This reverts commit 7bb5592d59.
2014-07-02 19:46:25 +02:00
Domen Kožar
7bb5592d59 python: 2.7.7 -> 2.7.8
Signed-off-by: Domen Kožar <domen@dev.si>
2014-07-02 18:46:00 +02:00
Lluís Batlle i Rossell
5179b515da sqlcipher: missing semicolon on nix syntax 2014-07-02 11:27:54 +02:00
Lluís Batlle i Rossell
d2cc427e6d Adding sqlcipher. 2014-07-02 11:21:19 +02:00
Rob Vermaas
a8f6601fc6 Merge pull request #3099 from Calrama/release-14.04
Fix network-manager-applet startup issue
2014-06-27 10:23:20 +02:00
Austin Seipp
713e7482f3 php: 5.4.27 -> 5.4.30
CVE-2014-3981, CVE-2014-0207, CVE-2014-3478, CVE-2014-3479,
CVE-2014-3480, CVE-2014-3487, CVE-2014-4049, CVE-2014-3515

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2014-06-27 00:26:49 -05:00
Vladimír Čunát
d0bd55da53 samba: security-only updates 2.6.22 -> .24
Fixes CVE-2014-{0244,3493} and CVE-2013-4496

(cherry picked from commit db1afc01d2)
2014-06-26 22:34:37 +02:00
Moritz Maxeiner
51dc1ddb7c Fix network-manager-applet startup issue 'GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.' 2014-06-26 19:41:43 +02:00
Vladimír Čunát
1c5a92c530 linux-3.13: remove, as it's vulnerable
CC #3090.

(cherry picked from commit 7998a598b6)
2014-06-26 13:10:26 +02:00
Vladimír Čunát
79b206e63f linux-*: pull version updates from master 2014-06-26 13:10:26 +02:00
Eelco Dolstra
9093b344ae Handle <nixpkgs> being a symlink
Fixes #1898.

(cherry picked from commit a7d31fe449)
2014-06-26 12:44:28 +02:00
Eelco Dolstra
c0121397f8 Fix generation of synergy-{client,server} when disabled
(cherry picked from commit 9ae3654fd6)
2014-06-26 12:44:15 +02:00
Eelco Dolstra
d62d4704de Don't suggest using --arg config '{ allowUnfree = true; }'
This doesn't work when using the Nixpkgs/NixOS channel.

Issue #2998.

(cherry picked from commit e5d63646a0)
2014-06-26 12:44:03 +02:00
Eelco Dolstra
a4060bbb98 winetricks: Update to 1199
(cherry picked from commit 429bdef9bd)
2014-06-26 12:44:03 +02:00
Vladimír Čunát
4076129dcb gnupg: security update 2.0.22 -> .24, CVE-2014-4617
Close #3091.

(cherry picked from commit 99da7b85cb)
2014-06-26 11:06:24 +02:00
Peter Simons
5ccfe62082 gnupg1: security update to version 1.4.17 (CVE-2014-4617)
(cherry picked from commit fd73d2b13b)
2014-06-26 11:00:29 +02:00
Rob Vermaas
03f1e336c7 Make openjre default jre on darwin, just like jdk.
(cherry picked from commit 00d9b5dfeb)
2014-06-25 14:19:21 +02:00
Rob Vermaas
73c4148685 Fix toolset argument to boost > 1.55 2014-06-25 12:50:13 +02:00
Daniel Zinn
3106853c1b Added cuda6 compiler as package cudatoolkit6.
(cherry picked from commit ca0de0f1f7)
(cherry picked from commit 01bbc61364)
2014-06-23 15:30:10 +02:00
Lluís Batlle i Rossell
231d76abe0 Making retroshare bootstrap the DHT fine. 2014-06-23 15:03:25 +02:00
Vladimír Čunát
c7e73e8436 xorg: add xkbprint
Suggested by @KoviRobi on ML.

(cherry picked from commit 3f15312b44)
2014-06-22 10:04:33 +02:00
Lluís Batlle i Rossell
c4245c8e7b retroshare: place plugins at proper place
Now they can be used.
2014-06-21 15:54:44 +02:00
Rob Vermaas
05543ef6e0 Change size of Amazon EC2 S3-backed images to 8GB (was 4GB). 2014-06-19 11:27:49 +02:00
Rob Vermaas
e007559e95 EC2: allow building S3-backed HVM ami's 2014-06-19 10:56:52 +02:00
Austin Seipp
5591fb606c duo-unix: upgrade, fix full name + version
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit fd4c2d893f)
2014-06-17 17:06:58 -05:00
Eelco Dolstra
e66d3953ae Revert "firefox: bump to 30.0."
This reverts commit 69852b1c64. Firefox
30.0 breaks restoring sessions (#2950).
2014-06-16 10:27:55 -04:00
Eelco Dolstra
acc00a7ee1 linux: Update to 3.12.22
Fixes CVE-2014-3153 (local privilege escalation via futex()).

(cherry picked from commit 27c72f337b)
2014-06-13 17:45:42 +02:00
James Cook
a4ad3b8127 nspr: update to 4.10.6
Required for Firefox 30.0.

(cherry picked from commit 4b55530bd2)
2014-06-13 17:37:46 +02:00
James Cook
69852b1c64 firefox: bump to 30.0.
(cherry picked from commit 2fec892959)
2014-06-13 17:37:32 +02:00
Rob Vermaas
dfcb042f67 elasticsearch: run preStart as root, to allow creating the necessary directories.
(cherry picked from commit 40566790d3)
2014-06-13 13:43:07 +02:00
Sönke Hahn
74859a88e5 better error message in case of missing uids
(cherry picked from commit 089b293019)
2014-06-12 22:23:01 +02:00
Vladimír Čunát
d22d14f878 fix licenCe typos 2014-06-12 09:09:39 +02:00
Vladimír Čunát
e6fe1e0e86 Revert "Update node packages." to fix tarball evaluation
The same was done on master in 8d8c761
This reverts commit 96d1ffd082.
2014-06-12 09:02:00 +02:00
Peter Simons
aedffc6b62 esniper: update to version 2.31.0
(cherry picked from commit 9b899d8600)
2014-06-11 12:05:29 +02:00
Rob Vermaas
9024912a53 Fix configuring httpd with custom user/group.
(cherry picked from commit 08f9da2e8e)
2014-06-11 10:21:45 +02:00
Rob Vermaas
764d0effa4 filezilla: update from 3.8.0 to 3.8.1, potentially fixes CVE-2013-4668
(cherry picked from commit 3d2091b9fa)

Conflicts:
	pkgs/applications/networking/ftp/filezilla/default.nix
2014-06-10 13:38:49 +02:00
Eelco Dolstra
368e66cd0b Revert "Merge #2692: Use pam_env to properly setup system-wide env"
This reverts commit b9c312fe27.
2014-06-10 13:07:57 +02:00
Vladimír Čunát
b9c312fe27 Merge #2692: Use pam_env to properly setup system-wide env
(cherry picked from commit 18a0cdd864)
2014-06-10 12:00:13 +02:00
Georges Dubus
f6f9e85e25 fish: Fixed tab completion with sudo (close #2705)
We don't have /sbin and /usr/sbin, so fish complains.

(cherry picked from commit 927c41e258)
2014-06-10 11:37:12 +02:00
Domen Kožar
b22f28b0e3 Merge pull request #2764 from nbp/rr
libpfm & rr: Add packages.
2014-06-09 23:15:54 +02:00
Rob Vermaas
96d1ffd082 Update node packages. 2014-06-09 19:55:34 +02:00
Peter Simons
b84584f5dc haskell-download-curl: jailbreak to fix build with recent versions of tagsoup
(cherry picked from commit 7c06d93c0f)
2014-06-09 10:09:15 +02:00
William A. Kennington III
276a5e3b88 kernel: 3.14.5 -> 3.14.6 (close #2868)
(cherry picked from commit d91eacd720)
2014-06-08 09:12:40 +02:00
Peter Simons
c0867734e4 spamassassin: download from any Apache mirror
(cherry picked from commit 5303c9077653e2cf897a93283915adffcada02ac)
2014-06-06 14:08:59 +02:00
Eelco Dolstra
0a8c8839df Stick to libav 9
Libav is generally not great about backwards compatibility, so it
should never get major updates on the release branch.

http://hydra.nixos.org/build/11732064
2014-06-06 13:38:05 +02:00
Domen Kožar
136d6771b5 openssl: 1.0.1g -> 1.0.1h
CVE-2014-0224
CVE-2014-0221
CVE-2014-0195
CVE-2014-0198
CVE-2010-5298
CVE-2014-3470
2014-06-05 14:33:39 +02:00
Eelco Dolstra
56cfab3831 Make pseudo-filesystems show up as "tmpfs" etc. rather than "none" in df
(cherry picked from commit 4269582078265c87b146012e83bdf5bba466d997)
2014-06-05 13:15:40 +02:00
Eelco Dolstra
2d3a73ae5c Remove illegal meta.src attributes
(cherry picked from commit 1da6a7d4a9)
2014-06-05 13:15:40 +02:00
Shea Levy
93c0f4a5f1 Fix /run/keys permissions
(cherry picked from commit 57ed344917)
2014-06-05 13:15:40 +02:00
Austin Seipp
2e8ce570e7 kernel/grsec: updates; add mainline package for brave souls
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit b43421221f)

Conflicts:
	pkgs/top-level/all-packages.nix
2014-06-05 06:14:33 -05:00
Austin Seipp
06d781bea3 mariadb: 10.0.10 -> 10.0.11
Also, enable the TokuDB plugin, as it now builds (there were some bugs
in the non-GA release that prevented that).

Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 463ed1bb64)
2014-06-05 06:07:51 -05:00
Eelco Dolstra
0276eb144c linux: Update to 3.12.21
(cherry picked from commit 246edc3df2)
2014-06-05 06:07:42 -05:00
Vladimír Čunát
b3d9172470 libav: update 0.8.11 -> .12, 9.12 -> .13, introduce 10.1
(cherry picked from commit 77abe5e464)
2014-06-05 11:05:57 +02:00
William A. Kennington III
08b679e732 kernel: 3.14.4 -> 3.14.5 (close #2831)
(cherry picked from commit 3a0b265af9)
2014-06-05 10:46:06 +02:00
Domen Kožar
9fa93015c0 mailutils: disable tests 2014-06-04 16:19:09 +02:00
Domen Kožar
a088ed9fe5 python: 2.7.6 -> 2.7.7 2014-06-04 16:19:09 +02:00
Matej Cotman
cc492d6d0a pythonPackages.pyramid_tm: set doCheck to false
Signed-off-by: Domen Kožar <domen@dev.si>
2014-06-04 16:14:29 +02:00
Lennart Kats
d5e50145de Update Node.js to 0.10.28
(cherry picked from commit 3e3e9daafe)
2014-06-04 16:11:29 +02:00
Eelco Dolstra
802d2a8e54 qt-5: Don't build tests
Building the tests (which as far as I can tell we don't even run)
makes the build take > 19 GiB of disk space, which is a bit
excessive. Without the tests, it takes 2.6 GiB.

(cherry picked from commit 1cfea9bd1a)
2014-06-03 11:43:58 +02:00
Eelco Dolstra
b49d853a18 Manual: Note about using a local branch
(cherry picked from commit a8c9c11f9e)
2014-06-03 11:43:58 +02:00
Eelco Dolstra
94b3b435ca git: Update to 1.9.4
(cherry picked from commit 61befa0451)
2014-06-03 11:43:58 +02:00
Vladimír Čunát
45413771e8 gnutls: security + maintenance update for both branches
Fixes #2813 CVE-2014-3466. No API/ABI changes in the updates.

Tests start to fail for gnutls31, so they get disabled,
but the 3.1 branch is already unused on master.

(cherry picked from commit 191dbc234f)
2014-06-03 10:51:22 +02:00
Peter Simons
a4ac76b895 haskell-xmonad-contrib: update to version 0.11.3, fix CVE-2013-1436
The problem was for users of DynamicLog with status bars
like xmobar/dzen2, and allowed *websites* to inject commands into them.

(cherry picked from commit f9f19ee938)
2014-06-01 10:20:23 +02:00
Rob Vermaas
c029464778 Re-introduce (marked as obsolete) mkStrict function, to allow old nixops deployments to keep working.
(cherry picked from commit 90a7711e08)
2014-05-31 08:05:27 +02:00
Austin Seipp
80661f4dc2 Merge #2632: add biosdevname
(cherry picked from commit 832c1abc91)
2014-05-30 10:33:35 +02:00
Nicolas Pierron
67a5cd73a4 libpfm & rr: Add packages. 2014-05-26 14:35:10 -07:00
Luca Bruno
d8a6402373 Fix passing extra qemu opts when using boot loader
(cherry picked from commit b0234f216c)
2014-05-26 22:20:01 +02:00
宋文武
4e74129777 gst-plugins-base: update from 1.2.3 to 1.2.4 (in #2440)
(cherry picked from commit fead8862d6)
2014-05-26 19:34:20 +02:00
宋文武
798a989145 gst-plugins-bad: build with wildmidi and fluidsynth
remove timidity, the plugin does not build at all

(cherry picked from commit 388d32d966)
2014-05-26 19:34:20 +02:00
宋文武
3214a5f293 gstreamer: update from 1.2.3 to 1.2.4
(cherry picked from commit b57c9ed9d5)
2014-05-26 19:34:20 +02:00
宋文武
ba23a02094 gst-plugins-ugly: update from 1.2.3 to 1.2.4
(cherry picked from commit 69c4dae379)
2014-05-26 19:34:20 +02:00
宋文武
65f5c730df gst-plugins-good: update from 1.2.3 to 1.2.4
(cherry picked from commit cd5702da47)
2014-05-26 19:34:20 +02:00
宋文武
ca5061b125 gst-plugins-bad: update from 1.2.3 to 1.2.4
(cherry picked from commit 98dd37afad)
2014-05-26 19:34:20 +02:00
宋文武
a89bac9e4d gst-libav: update from 1.2.3 to 1.2.4
(cherry picked from commit 6324296900)
2014-05-26 19:34:19 +02:00
Linquize
979adb866c lvtk: Upgrade to 1.2.0 and switch to github tarball
(cherry picked from commit e6359b4048)
2014-05-26 16:56:01 +02:00
Charles Strahan
dc71acb8cd fix -G delimiter in call to useradd
Signed-off-by: Domen Kožar <domen@dev.si>
2014-05-26 09:27:35 +02:00
Bjørn Forsman
00312d90b9 nixos: add 'gvfs' when using GNOME3 desktop
One reason for adding this is to make Chromium able to open files it has
downloaded.

Currently this happens:
  /run/current-system/sw/bin/xdg-open: line 364: gnome-open: command not found

(And nothing happens in the GUI when clicking a downloaded file.)

Looking into xdg-open, one can see that it first tries to run gvfs-open
and then falls back to gnome-open. Adding 'gvfs' makes the first command
succeed.

(cherry picked from commit 15beb4054d)
2014-05-25 20:36:59 +02:00
Jaka Hudoklin
24edc80145 xca: fix package
For some reason library paths are not set at all for some libraries during
the build. Wrapper with LD_LIBRARY_PATH set for relevant libraries is currently
solution.

(cherry picked from commit 115b7313c5)
2014-05-25 14:35:01 +02:00
Bjørn Forsman
239043c826 munin: update 2.0.20 -> 2.0.21 (bug fix)
(cherry picked from commit 5e460b2dee)
2014-05-25 13:57:09 +02:00
Bjørn Forsman
e478101a9b srecord: update 1.62 -> 1.63
(cherry picked from commit e1d2e0d380)
2014-05-25 13:51:18 +02:00
Bjørn Forsman
8a29cd0b33 bcache-tools: update 1.0.5 -> 1.0.7
(cherry picked from commit ef66088ae1)
2014-05-25 13:18:39 +02:00
Cillian de Róiste
ea1952bff2 qtractor: update from 0.6.0 to 0.6.1
(cherry picked from commit b924959648)
2014-05-24 21:26:19 +02:00
Cillian de Róiste
01d67b7d59 ardour3: 3.5.357 -> 3.5.380 Critical bug fix release
(cherry picked from commit 94fd1a83bd)
2014-05-24 20:45:30 +02:00
Cillian de Róiste
d5a98173b4 synthv1: update from 0.4.1 to 0.4.2
(cherry picked from commit 056bd4fdba)
2014-05-24 20:45:15 +02:00
Cillian de Róiste
6045631acf samplv1: update from 0.4.1 to 0.4.2
(cherry picked from commit 2dc6eb3941)
2014-05-24 20:45:02 +02:00
Cillian de Róiste
9c4a974b5a drumkv1: update from 0.4.1 to 0.4.2
(cherry picked from commit 18df371fe3)
2014-05-24 20:44:54 +02:00
Vladimír Čunát
dfb9cc2d4c update lib/maintainers.nix from master 2014-05-24 13:46:07 +02:00
Charles Strahan
501c32aaf8 fix mkpasswd: use the git repository
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit e5eed8f664)
Note recently this was picked and reverted because of missing dependencies.
2014-05-24 13:42:18 +02:00
Vladimír Čunát
2937a30a32 mupdf: fix patch hash by fetchpatch
Thanks to @kirelagin for reporting on IRC.

(cherry picked from commit f77e2dcb38)
2014-05-24 13:42:18 +02:00
Vladimír Čunát
31f9fcf420 Merge #2630: add and use fetchpatch
fetchpatch is fetchurl that determinizes the patch.
Some parts of generated patches change from time to time, e.g. see #1983 and
http://comments.gmane.org/gmane.linux.distributions.nixos/12815
Using fetchpatch should prevent the hash from changing.

(cherry picked from commit 137eae0b55)

Conflicts (simple, patchutils version from master):
	pkgs/development/libraries/haskell/gitit/default.nix
	pkgs/tools/text/patchutils/default.nix
2014-05-24 13:42:18 +02:00
Vladimír Čunát
154e06c178 Add a utility function "fetchFromGitHub"
This is a small wrapper around fetchzip. It allows you to say:

  src = fetchFromGitHub {
    owner = "NixOS";
    repo = "nix";
    rev = "924e19341a5ee488634bc9ce1ea9758ac496afc3"; # or a tag
    sha256 = "1ld1jc26wy0smkg63chvdzsppfw6zy1ykf3mmc50hkx397wcbl09";
  };

Conflicts (simple):
    pkgs/tools/networking/dd-agent/default.nix

This is a squashed cherry jam:
    ebd8573046
    6aeb59bbe0
    ea36f3b868
2014-05-24 13:39:45 +02:00
Eelco Dolstra
39e7705f50 Add a function "fetchzip"
This function downloads and unpacks a file in one fixed-output
derivation. This is primarily useful for dynamically generated zip
files, such as GitHub's /archive URLs, where the unpacked content of
the zip file doesn't change, but the zip file itself may (e.g. due to
minor changes in the compression algorithm, or changes in timestamps).

Fetchzip is implemented by extending fetchurl with a "postFetch" hook
that is executed after the file has been downloaded. This hook can
thus perform arbitrary checks or transformations on the downloaded
file.

(cherry picked from commit c8df888858)

Conflicts (using fetchzip now):
	pkgs/tools/networking/dd-agent/default.nix
2014-05-24 13:11:02 +02:00
Peter Simons
dc1a196287 esniper: update to version 2.30.0
(cherry picked from commit 95aa6a9afa)
2014-05-23 21:57:07 +02:00
Eelco Dolstra
aa19ce936b Add type for fonts.fonts option
(cherry picked from commit 58226a7b06)
2014-05-23 10:56:54 +02:00
Eelco Dolstra
6fe0fead28 nvidia-x11: Update to 331.79
(cherry picked from commit 5ec3a63fcb)
2014-05-23 10:56:54 +02:00
Ricardo M. Correia
fecc667e90 flashplayer: Update from 11.2.202.356 -> 11.2.202.359 2014-05-22 20:16:36 +02:00
Ricardo M. Correia
e07b9938d0 chromium: Update stable channel from 34.0.1847.116 -> 35.0.1916.114 2014-05-22 20:13:50 +02:00
Eelco Dolstra
d98716ded4 copy-tarballs.pl: Create base-32 symlinks
(cherry picked from commit b6569c8497)
2014-05-22 12:15:17 +02:00
Eelco Dolstra
acae580f9a gimp: Fix download URL
(cherry picked from commit 1e6c82825a)
2014-05-22 12:15:16 +02:00
Eelco Dolstra
f5de056bc8 openssh: Fix broken URL
(cherry picked from commit 9b6eeecbde)
2014-05-22 12:15:16 +02:00
Domen Kožar
51d3efed02 python: 3.4.0 -> 3.4.1 2014-05-22 09:06:13 +02:00
Rob Vermaas
044a24e58b Better support for HVM instances. Now the NixOS images can
be used on HVM instances without needing nixops. Previously
the grub setup was incorrect, so a plain 'nixos-rebuild switch'
and a reboot would result in a broken system.

Also added growing of the partition of the root disk in the initrd,
so you can run resize2fs after initial boot, without needing an
extra reboot. This is useful especially for nixops'
deployment.ec2.ebsInitialRootDiskSize option.
2014-05-21 16:31:52 +02:00
Rob Vermaas
c9763e20e5 Use HVM instance for EBS creator, guarantees everything is created in the correct zone. 2014-05-21 13:40:19 +02:00
Rob Vermaas
35c76d9173 Add option ec2.hvm, to set some boot configuration specific for EC2 HVM instances. 2014-05-21 10:55:49 +02:00
Eelco Dolstra
97d9d26a7b Revert "fix mkpasswd: use the git repository"
This reverts commit ce13d17856 since it
breaks evaluation:

in job ‘nixpkgs’:
anonymous function at /nix/store/f73d4b03nsmccb1w5b1qfgc7dpvx35gw-git-export/pkgs/tools/security/mkpasswd/default.nix:1:1 called without required argument `fetchFromGitHub', at /nix/store/f73d4b03nsmccb1w5b1qfgc7dpvx35gw-git-export/lib/customisation.nix:58:12
2014-05-21 10:46:48 +02:00
Charles Strahan
ce13d17856 fix mkpasswd: use the git repository
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit e5eed8f664)
2014-05-20 23:07:55 -05:00
Eelco Dolstra
9819094b89 Update Ubuntu Packages.bz2 hashes
(cherry picked from commit 139608dd34)
2014-05-20 13:39:37 +02:00
Eelco Dolstra
3abf903a5a Fix udev rule required by gpm
Backport: 14.04
(cherry picked from commit 097f9c7e57)
2014-05-20 13:11:03 +02:00
Eelco Dolstra
82ab2f6363 switch-to-configuration: Don't restart instances of user@.service
Restarting user@ instances is bad because it causes all user services
(such as ssh-agent.service) to be restarted. Maybe one day we can have
switch-to-configuration restart user units in a fine-grained way, but
for now we should just ignore user systemd instances.

Backport: 14.04
(cherry picked from commit bddd10d75c)
2014-05-20 11:14:37 +02:00
Eelco Dolstra
58312cab7c firefox: Update to 29.0.1
(cherry picked from commit 8b89cba9c6)
2014-05-19 21:50:16 +02:00
Eelco Dolstra
c071a4573c nss: Update to 3.16.1
(cherry picked from commit ec332f520c)
2014-05-19 21:50:16 +02:00
Eelco Dolstra
14695233ea nspr: Update to 4.10.5
(cherry picked from commit 0a3a90ed01)
2014-05-19 21:50:16 +02:00
Eelco Dolstra
eb6309c87f linux: Update to 3.12.20
(cherry picked from commit 2ee6c0c63e)
2014-05-19 21:50:15 +02:00
Rob Vermaas
06d38cd60a Fix slim evaluation. 2014-05-19 13:58:43 +02:00
Michael Raskin
ef3c59c5ec On my system OpenGL with bumblebee seems to require libudev in LD_LIBRARY_PATH. Fix that, fix bumblebee module loading and make the socket group configurable
(cherry picked from commit eef9a8ac2a)
2014-05-19 12:57:29 +02:00
Austin Seipp
1d24df4063 btsync: fix my stupidity
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2014-05-18 16:34:07 -05:00
Luis G. Torres
4dc6e22c21 eigen: upgrading version to 3.2.1
(cherry picked from commit ad1ce14a68)
2014-05-18 15:41:52 -05:00
Austin Seipp
bfff5e4475 fmod: 4.44.33 -> 4.44.34
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit d08395713b)
2014-05-18 15:41:29 -05:00
Austin Seipp
0884ff51ea btsync: 1.3.93 -> 1.3.94
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 7fbe238a49)
2014-05-18 15:41:25 -05:00
Austin Seipp
6de37e68e0 lockdep: 3.14.2 -> 3.14.4
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 0781563b46)
2014-05-18 15:41:21 -05:00
Austin Seipp
b3747fc9d5 jhc: Fix license
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit c166bd3e07)
2014-05-18 15:41:12 -05:00
Austin Seipp
2e22c13a35 jhc: 0.8.0 -> 0.8.1
Also, bootstrap the compiler with GHC 7.6.3 instead of 6.12.3.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 1651871250)
2014-05-18 15:41:06 -05:00
Benno Fünfstück
c739957979 virtualbox: update 4.3.10 -> 4.3.12
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 8b6300822b)
2014-05-18 15:40:57 -05:00
Vladimír Čunát
054eae1cc3 berlios.de probably shut down, replace it
The shutdown was announced years ago, only now it stopped working.

(cherry picked from commit 8e9ead8656)
2014-05-18 15:40:34 -05:00
Austin Seipp
e06e9e1105 cryptol: add a convenient clang/lss wrapper
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit f1dc681538)
2014-05-18 15:39:40 -05:00
John Wiegley
c49f640ed8 Add -Wno-error=deprecated-declarations for nginx, required to build on Darwin
(cherry picked from commit 622aa834b7)
2014-05-18 15:39:24 -05:00
Austin Seipp
d50ce3a21f grsec: updates
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit cb894d4fc3)
2014-05-18 15:38:49 -05:00
Austin Seipp
1b4a5c52b0 linux-3.{4,10}: update
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 3efdeef6a3)
2014-05-18 15:38:40 -05:00
Austin Seipp
e774419033 apparmor: 2.8.2 -> 2.8.3
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit f7123982c2)
2014-05-18 15:38:32 -05:00
Rob Vermaas
ecdb0f7867 Fix dogstatsd, needs procps in path. 2014-05-18 13:00:33 +02:00
Vladimír Čunát
18602b0656 Revert "mupdf: fix patch hash by fetchpatch"
We don't have fetchpatch on release yet,
and it depends on fetchurl changes not there yet...
I'll leave the patch unfixed ATM,
as people on release mostly get binaries anyway.

This reverts commit f73e7d33c2.
2014-05-18 12:11:08 +02:00
Vladimír Čunát
f73e7d33c2 mupdf: fix patch hash by fetchpatch
Thanks to @kirelagin for reporting on IRC.

(cherry picked from commit f77e2dcb38)
2014-05-17 12:24:07 +02:00
Vladimír Čunát
dad7523db2 xorg.libXfont: security update, CVE-2014-{0209,0210,0211}
For details see http://lists.x.org/archives/xorg-announce/2014-May/002431.html

(cherry picked from commit 832c661822)
2014-05-17 07:23:33 +02:00
Jordan Patterson
fab8b036f3 rxvt-unicode: update to 9.20, fixing CVE-2014-3121 (close #2649)
(cherry picked from commit 4b668bb554)
2014-05-15 20:58:07 +02:00
Vladimír Čunát
5b26870e18 Merge pull request #2634 from doublec/tor
Update Tor to 0.2.4.21 and tor-browser to 3.6.1
(cherry picked from commit cc9b8a8b6f)

Fixes #2657.
2014-05-15 20:49:57 +02:00
Linquize
1e02e79a16 git: Update to 1.9.3
(cherry picked from commit 10fa1bcf66)
2014-05-15 16:15:34 +02:00
Eelco Dolstra
028d2479dd linux-3.12: Apply patch for CVE-2014-0196
(cherry picked from commit 3d1d9bb7dd)
2014-05-15 15:28:30 +02:00
Lengyel Balázs
1a5ce29795 Changed URL to upstream, as the old URL was dead
(cherry picked from commit 5f025b6505)
2014-05-15 13:22:44 +02:00
Bjørn Forsman
530ad13c26 python-usbtmc: new package
This Python package supports the USBTMC instrument control protocol for
controlling instruments over USB.

http://alexforencich.com/wiki/en/python-usbtmc/start
(cherry picked from commit 77000f7af0)
2014-05-14 21:57:59 +02:00
Bjørn Forsman
106ff6fb37 python-pyusb: new package
PyUSB is a Python module that wraps libusb 1.0. (It can wrap other USB
libraries too, but I've hardcoded it for libusb as it seems the most
appropriate.)

(cherry picked from commit bc847600a9)
2014-05-14 21:57:59 +02:00
Rob Vermaas
feab8c784d Revert "Set console=ttyS0 for Amazon EC2 instances, as suggested by Amazon."
This reverts commit 78916e0257.
2014-05-14 11:12:55 +02:00
Vladimír Čunát
4d36234940 mesa: bugfix update 10.0.4 -> .5
Master is using 10.1.* already.
2014-05-13 21:09:32 +02:00
Linquize
4e87d1b90e codeblocks: new package 13.12 (close #2533)
@vcunat: minor refactoring.

(cherry picked from commits 977248ba15
  and 93e65a4d53)
2014-05-13 21:01:48 +02:00
Eelco Dolstra
a58455c024 linux: Update to 3.12.19
Backport: 14.04
(cherry picked from commit abbf643ae2)
2014-05-13 21:00:08 +02:00
Vladimír Čunát
7c5691ba70 linux: minor updates, probably often fixing CVE-2014-0196
(cherry picked from commit 9c8ee7a7e5)
2014-05-13 20:59:31 +02:00
Luca Bruno
2c3184a0ce shadow: Fix lastlog and faillog to find logs in /var/log
Fixes #2575 and closes #2586.

(cherry picked from commit 9e7e3978f9)
2014-05-13 20:59:10 +02:00
Vladimír Čunát
6acb503cba pidgin-sipe: fix build by updating
Also add platforms (linux).

(cherry picked from commit 08834b061c)
2014-05-13 20:57:22 +02:00
Vladimír Čunát
243fe226f5 nixos-generate-config.pl: add new PCI IDs for broadcom_sta
The last ID wasn't in official README,
but it was reported by third3ye on IRC.

(cherry picked from commit 2aa3580a5e)
2014-05-13 20:56:57 +02:00
Vladimír Čunát
c23360496c pam: upstream patch to fix CVE-2014-2583
(cherry picked from commit 07aaea85d4)
2014-05-13 20:56:40 +02:00
Vladimír Čunát
77cf3a8a70 json-c: update to 0.12, fixing CVE-2013-{6370,6371}
(cherry picked from commit d96f262166)
2014-05-13 20:56:33 +02:00
Vladimír Čunát
4e61a2ae87 libmms: bugfix update, including CVE-2014-2892
(cherry picked from commit 6faa50e11d)
2014-05-13 20:56:26 +02:00
Vladimír Čunát
2fd0d5bffb rsync: fix CVE-2014-2855 by upstream patch
(cherry picked from commit 8c918bdc2c)
2014-05-13 20:56:17 +02:00
Vladimír Čunát
5aad39e6da curl: minor update 7.35.0 -> 7.36.0, including CVE fixes
(cherry picked from commit 062e2567c9)
2014-05-13 20:56:08 +02:00
Eelco Dolstra
2c8f6e0679 Add nifskope
(cherry picked from commit 535de5e45a)
2014-05-13 13:30:21 +02:00
Eelco Dolstra
b2d29943fa nixos-generator-config: Don't emit a double / in bind mounts
(cherry picked from commit 4b7c606589)
2014-05-13 13:29:42 +02:00
Eelco Dolstra
5c3f2c1087 nixos-generate-config: Don't include /var/setuid-wrappers
(cherry picked from commit dc78ae327c)
2014-05-13 13:29:27 +02:00
Eelco Dolstra
7fba471dc2 Don't enable the NVIDIA driver by default because it's unfree
(cherry picked from commit 1bd8ced9c0)
2014-05-13 13:29:17 +02:00
Eelco Dolstra
9d0d374bd8 nixos-container: Ensure umask 022
Fixes #2585.

(cherry picked from commit 253bbb8e2b)
2014-05-13 13:28:51 +02:00
aszlig
9baa033f8d chromium: Allow config.chromium for PPAPI plugins.
This should make it easier to enable proprietary pepper API plugins
though nixpkgs config, so it can be easily installed using something
like:

nix-env -i chromium-stable

With something like:

{ chromium.enablePepperFlash = true; }

In ~/.nixpkgs/config.nix to enable pepper API based Flash and to avoid
the browser wrapper from Firefox entirely.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit c833d7ce16)
2014-05-12 23:35:05 +02:00
Austin Seipp
8d6688d866 nixos: overhaul datadog module
This overhauls the Datadog module a bit to be much more useful. In
particular, it adds support for nginx and postgresql monitoring
integrations to dd-agent. These have to exist in separate files under
/etc/dd-agent, so the module just exposes then as separate options. In
the future, more integrations could be added this way.

In the process of doing this, I also had to rename the dd-agent user to
datadog. Note the UIDs did not change, so this is strictly backwards
compatible. The reason for this is to make it easier to create a
'datadog' postgres user with access to pg_stats, as 'dd-agent' typically
isn't a valid username. This allows the out of the box configurations to
be used.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 368a677c97)
2014-05-12 16:59:58 +02:00
Vladimir Kirillov
4497554833 sysdig: support builds without the kernel module, add pkgs.sysdig attr
(cherry picked from commit 96903d5e48)
2014-05-12 09:37:31 -04:00
Vladimir Kirillov
e77c1cf891 luajit: support Darwin builds
(cherry picked from commit e5f7e4ec3c)
2014-05-12 09:37:21 -04:00
Vladimir Kirillov
8d3f066bc4 sysdig: update to 0.1.82
(cherry picked from commit 96373a4041)
2014-05-12 09:37:12 -04:00
Rob Vermaas
78916e0257 Set console=ttyS0 for Amazon EC2 instances, as suggested by Amazon.
(cherry picked from commit 7d3dcd9a8c)
2014-05-12 12:29:49 +02:00
Bjørn Forsman
2c176a2a6e virt-manager: add missing gsettings schema
Without this it'll complain and abort when clicking "Take Screenshot" or
"Browse Local" when creating a new VM and looking for an CD-ROM image to boot
from:

GLib-GIO-ERROR **: Settings schema 'org.gtk.Settings.FileChooser' is not installed

(cherry picked from commit cb7c920e24)
2014-05-11 01:04:16 +02:00
Rickard Nilsson
888af166ca When auto-formatting ext devices, use the -F flag to make it work with unpartioned disks
(cherry picked from commit b87b6870f8)
2014-05-09 11:05:50 -04:00
Vladimir Kirillov
7bc02074b1 sysdig: update to 0.1.81
(cherry picked from commit bf9612e797)
2014-05-09 11:05:44 -04:00
Rob Vermaas
9bb943b14d Upgrade rtmpdump and get_iplayer
(cherry picked from commit a76350337894f7f8d8945da1f35341a6bc2fd81a)
2014-05-07 20:57:15 +02:00
Rob Vermaas
a5a5a87f2e USe maven.test.skip in stead of maven.test.skip.exec in mvn assembly, to prevent unnecessary compilation.
(cherry picked from commit 7cd55c7744)
2014-05-07 16:37:59 +02:00
Shea Levy
17d074d0b5 Add phpPackages.xdebug
Partial backport of 16e7ae3b10
2014-05-07 09:35:07 -04:00
Eelco Dolstra
53f82b134b libav: Disable tests
These appear to fail randomly sometimes:

http://hydra.nixos.org/build/10854615
(cherry picked from commit 255a6a9da8)
2014-05-07 14:03:55 +02:00
aszlig
62f157e5f4 vm/windows: Wait for migration to finish.
This ensures that the intermediate machine is shut down only after the
migration has finished writing the memory dump to disk, to ensure we
don't end up with empty state files depending on how fast the migration
finished before we actually shut down the VM.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit 97dc8a88e5)
2014-05-07 07:22:49 +02:00
aszlig
648edae309 vm/windows: Exit if VM has dropped out.
This ensures that the builder isn't waiting forever if the Windows VM
drops dead while we're waiting for the controller VM to signal that a
particular command has been executed on the Windows VM. It won't ever
happen in such cases so it doesn't make sense to wait for the timeout.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit bd78e674c5)
2014-05-07 07:22:49 +02:00
aszlig
82d96b5a18 Revert "vm/windows: Exit if VM has dropped out".
This reverts commit 457f2c2835.

Damn, this commit wasn't supposed to hit the stable branch yet, and I
accidentally pushed this because I was in the wrong working dir. It
doesn't break anything but fixes nothing, that's why I'm reverting until
the proper fix is ready and tested.

Sorry everyone for the noise X-/

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2014-05-07 03:55:49 +02:00
aszlig
457f2c2835 vm/windows: Exit if VM has dropped out.
This ensures that the builder isn't waiting forever if the Windows VM
drops dead while we're waiting for the controller VM to signal that a
particular command has been executed on the Windows VM. It won't ever
happen in such cases so it doesn't make sense to wait for the timeout.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2014-05-07 03:29:02 +02:00
Austin Seipp
314952cdc8 build-support/vm: add Ubuntu 14.04 Trusty Tahir
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 2be1b4c034)
2014-05-06 17:02:10 +02:00
Vladimir Kirillov
d719c77dd0 buildLocalCabal: allow cabalDrvArgs in buildLocalCabalWithArgs
allows to write neat expressions like (as we're still generating an
expression string):

```
{
  build = haskellPackages.buildLocalCabalWithArgs {
    inherit src name;
    cabalDrvArgs = {
      jailbreak = false;
      doCheck = false;
    };
  };
}
```

without resorting to weird kung-fu like darcs does:

```
darcs = haskellPackages.darcs.override {
  # A variant of the Darcs derivation that containts only the
  # executable and
  # thus has no dependencies on other Haskell packages.
  cabal = { mkDerivation = x: rec { final = haskellPackages.cabal.mkDerivation (self: (x final) // {
            isLibrary = false;
            configureFlags = "-f-library"; }); }.final;
          };
};
```

While here, move the `jailbreak = true;` as the default `cabalDrvArgs`
option.

(cherry picked from commit 7eff825487)
2014-05-06 09:28:54 -04:00
Rob Vermaas
3d992546f9 Force --no-same-owner for unpacking node sources.
(cherry picked from commit b116679b24)
2014-05-06 14:58:26 +02:00
Bjørn Forsman
03cc78bbde eclipse: add Eclipse IDE for C/C++ Developers 4.3.2
(cherry picked from commit d2587a014f)
2014-05-05 22:43:09 +02:00
aszlig
3a76854aad chromium/source: Propagate system attribute.
The system attribute was already there in the function head of the
shared update helper but it actually wasn't used and thus later the
import of <nixpkgs> was done using builtins.currentSystem instead of the
system attribute inherited from the source derivation.

Now we correctly propagate the attribute, so that even when running a
64bit kernel you can run a 32bit Chromium with binary plugins.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit 4f3085d5f8)
2014-05-05 20:47:43 +02:00
aszlig
00af817900 chromium: Link against pulse instead of dlopen().
This fixes the issue of Chromium not being able to load the pulseaudio
librarp

We could also propagate the build inputs, but it would end up being the
same as just directoly linking against the library.

Thanks to @aristidb for noticing this in #2421:

https://github.com/NixOS/nixpkgs/pull/2421#issuecomment-42113656

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit 17807c8b6c)
2014-05-05 20:47:43 +02:00
Eelco Dolstra
c3bc254628 Don't run hwclock if /dev/rtc doesn't exist
E.g. on EC2 instances.

Backport: 14.04
(cherry picked from commit 5bfe944907)
2014-05-05 16:52:12 +02:00
Eelco Dolstra
1f07b94d39 systemd-journal-flush: Require /var/log/journal rather than all filesystems
Backport: 14.04
(cherry picked from commit 24cbe874d6)
2014-05-05 16:52:12 +02:00
Eelco Dolstra
ccf34c6d99 Don't start getty@tty1 on headless machines (like EC2)
Backport: 14.04
(cherry picked from commit 4a08f37206)
2014-05-05 16:52:12 +02:00
Eelco Dolstra
9642d4158b sysinit.target: Don't depend on systemd-tmpfiles-setup.service
systemd-tmpfiles-setup.service pulls in local-fs.target, which
interferes with NixOps' send-keys feature (since sshd.service depends
indirectly on sysinit.target). Since in NixOS we don't use
systemd-tmpfiles for creating files (that's done by activation scripts
and preStart scripts), it's not a problem to start it a bit later.

Backport: 14.04
(cherry picked from commit 014fe1a3c3)
2014-05-05 16:52:12 +02:00
Eelco Dolstra
a8d06d2ea1 switch-to-configuration: Honour RefuseManualStop
This prevents spurious errors about systemd-tmpfiles-setup.service.

Backport: 14.04
(cherry picked from commit bac68f9747)
2014-05-05 16:52:12 +02:00
Rob Vermaas
eb22292305 Fix users.*.extraGroups for users.mutableUsers = true. 2014-05-05 15:34:50 +02:00
Vladimir Kirillov
ccd3b3397e buildLocalCabal: include cabalInstall to buildDepends to preserve developer experience
(cherry picked from commit 9aa231abfa)
2014-05-05 09:13:13 -04:00
Eelco Dolstra
41895eabb9 systemd: Look for fsck.* in the right place
Fixes #2464.

(cherry picked from commit cb45ecad34)
2014-05-05 14:01:50 +02:00
Bjørn Forsman
6db3164d1f qwt: add version 6.x (we already have 5.x)
'qgis', one of the few 'qwt' dependees in nixpkgs, fails to build with
qwt 6. So I'm not moving the default version away from 5.x. Also, not
changing the default allows easy/safe cherry-picking to the stable
branch.

(cherry picked from commit 70b39119c3)
2014-05-04 00:12:42 +02:00
Cillian de Róiste
5250ce3e89 aubio: update from 0.4.0 to 0.4.1
(cherry picked from commit f3e0a29338)
2014-05-03 17:13:45 +02:00
Cillian de Róiste
0a18a7b5b7 darktable: update from 1.4.1 to 1.4.2
(cherry picked from commit 849f6788ac)
2014-05-03 16:59:42 +02:00
Austin Seipp
430a2bf52f clang-analyzer: respect $NIX_CFLAGS_COMPILE
When using scan-build, you're often going to want to use it in the
context of a Nix expression with buildInputs, and the default wrapper
scripts will put things like include locations for those inputs
$NIX_CFLAGS_COMPILE. Thus, scan-build also needs to pass them to the
analyzer - while the link flags aren't relevant, the include flags are.

This is because the analyzer executable that gets run by scan-build is
*not* clang-wrapper, but the actual clang executable, so it doesn't
implicitly add such arguments. The build is two-stage - it runs the real
clang wrapper once, and then the analyzer once.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 59528d9f0e)
2014-05-03 09:56:48 -05:00
Austin Seipp
5de4e94028 btsync: Default to no login/password for the Web UI
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit b553d11616)
2014-05-03 09:56:27 -05:00
Benno Fünfstück
75441a5abb Fix whitespace
(cherry picked from commit 9d15c568d8)
2014-05-03 16:02:24 +02:00
Benno Fünfstück
33587cd7ba jdk7: update patchversion 51 -> 55.
(cherry picked from commit a2de61e2b6)
2014-05-03 16:02:24 +02:00
Domen Kožar
6a0c87ccfe s/config.allowUnfree = true/allowUnfree = true/ 2014-05-03 15:13:26 +02:00
taku0
2764a05d4e Update thunderbird-bin to version 24.5.0 2014-05-02 21:25:15 +02:00
Eelco Dolstra
02b056c5b1 debian: Update to 7.5
(cherry picked from commit 1ab9f0a1c1f66a6d92b1a244192bae96c7afc0f0)
2014-05-02 15:14:25 +02:00
Luca Bruno
e6f4bdb1bb Added gnome 3.10 to the release notes
(cherry picked from commit ea1a9445bb)
2014-05-02 15:14:25 +02:00
Austin Seipp
6f8ee84cc9 btsync: remove unneeded assertion
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 8946e91fad)
2014-05-01 17:02:13 -05:00
Domen Kožar
b89c5378d0 pypy: disable sqlite3 tests (failing due to sqlite bump) 2014-05-01 18:38:28 +02:00
Shea Levy
84308245e8 Fix description to match convention
(cherry picked from commit da4adc2a4f)
2014-05-01 11:46:52 -04:00
Shea Levy
c476f4a237 Add enum option type
(cherry picked from commit ab2cd34076)
2014-05-01 11:30:28 -04:00
Shea Levy
ccea12cba2 grub: Allow setting the boot root explicitly
If /boot is a btrfs subvolume, it will be on a different device than /
but not be at the root from grub's perspective. This should be fixed in
a nicer way by #2449, but that can't go into 14.04.

(cherry picked from commit e4630c1d41)
2014-05-01 10:58:03 -04:00
Emery Hemingway
4cbc48f236 qtbitcointrader: initial expression 2014-05-01 15:54:54 +02:00
Eelco Dolstra
21e8cfac80 Shorten the version string
As suggested by Bjørn Forsman, use the number of commits in the
release branch.
2014-05-01 15:27:30 +02:00
Eelco Dolstra
b8564f7bb0 Mark builds from git explicitly
(cherry picked from commit 0b091e1286)
2014-05-01 15:27:30 +02:00
Eelco Dolstra
ff8ce29764 release.nix: Drop officialRelease flag
(cherry picked from commit 3b616e378a)
2014-05-01 15:27:30 +02:00
Eelco Dolstra
0711574c29 postgresql: Update to latest versions
(cherry picked from commit a986bbf4ba)
2014-05-01 15:27:30 +02:00
Rob Vermaas
9d9c797d75 Add RHEL7 to vm functions.
(cherry picked from commit cecd000fdb0c37b38e8b9fdfaed9eddb33b813cf)
2014-05-01 15:14:03 +02:00
Peter Simons
fcdf7e80ab gtk-gnutella: mark as "broken"
The current version doesn't compile with the latest GCC any more.

(cherry picked from commit 3c08cdce48)
2014-05-01 11:51:45 +02:00
Eelco Dolstra
5ceef8d2b1 httpd: Update to 2.2.27
CVE-2013-6438, CVE-2014-0098

(cherry picked from commit 65a78e16f1)
2014-05-01 11:51:26 +02:00
Eelco Dolstra
3cc279966d php: Update to 5.4.27
CVE-2013-7345, CVE-2014-1943, CVE-2014-2270, CVE-2013-6712

(cherry picked from commit ba332accc2)
2014-05-01 11:51:26 +02:00
Eelco Dolstra
faf51667ea Fix meta.license attribute
(cherry picked from commit 6c69ad3a97)
2014-05-01 11:51:26 +02:00
Eelco Dolstra
6d27026353 Remove mysterious line
(cherry picked from commit 4de6357776)
2014-05-01 11:51:26 +02:00
Eelco Dolstra
54a7d1d23e Disable the rabbitmq test
It frequently gets stuck in an infinite loop, delaying releases for
many hours.

(cherry picked from commit c9ebb42573)
2014-04-30 23:26:11 +02:00
Eelco Dolstra
9f4d06adae Set release date
(cherry picked from commit 0ea20bef3c)
2014-04-30 23:26:07 +02:00
Eelco Dolstra
24214d8517 chatzilla: Update to 0.9.90.1
Also, make it work with recent Firefoxes.

(cherry picked from commit 8f5ebe495c)
2014-04-30 17:03:45 +02:00
Linquize
42b9f99db1 chatzilla: Use latest firefox's xulrunner
(cherry picked from commit 20c395d8aa)
2014-04-30 16:49:22 +02:00
Eelco Dolstra
42bf7ca3e1 Don't make the EFI tests release-critical
They're failing on i686: http://hydra.nixos.org/build/10712961

(cherry picked from commit a96f4920d5)
2014-04-30 16:49:08 +02:00
Eelco Dolstra
48f3bb944e Punctuation
(cherry picked from commit 1d8f7e63b0)
2014-04-30 16:45:08 +02:00
Eelco Dolstra
e3be224207 Handle Zabbix agent and server both being enabled
This gave an error about the zabbix user uid being defined multiple
times.

(cherry picked from commit 05decd49ff)
2014-04-30 16:45:05 +02:00
Eelco Dolstra
13ce9bc60f flashplayer: Update to 11.2.202.356
CVE-2014-0515

(cherry picked from commit 0ac20f0726)
2014-04-30 16:45:03 +02:00
Eelco Dolstra
568930ca3e Fix the simple installer test
http://hydra.nixos.org/build/10712818
(cherry picked from commit 27d47f3983)
2014-04-30 16:44:59 +02:00
Eelco Dolstra
ff2bd64a4c Installer test: Unmount filesystems after installation
Hopefully fixes failures like:

  http://hydra.nixos.org/build/10712833

This shouldn't be necessary, but it might be that the use of unionfs
is interfering with a clean shutdown.

(cherry picked from commit 437962ebb2)
2014-04-30 16:44:54 +02:00
Eelco Dolstra
f9cb9a67ab systemd: Require some more kernel features
(cherry picked from commit 728d3476ba)
2014-04-30 16:44:51 +02:00
Eelco Dolstra
7b1401ba29 gummiboot: Automatically disable GRUB
(cherry picked from commit 9bb209a3bd)
2014-04-30 16:44:47 +02:00
Eelco Dolstra
958fc5076f Merge the EFI test into tests/installer.nix
(cherry picked from commit e9be441b62)
2014-04-30 16:44:44 +02:00
Eelco Dolstra
9cafa3c615 nixos-generate-config: Use systemd-detect-virt instead of dmidecode
Dmidecode fails in our EFI test with the error "SMBIOS entry point
missing". But we don't need dmidecode because we have already have
systemd-detect-virt.

(cherry picked from commit 8c75ae3838)
2014-04-30 16:44:40 +02:00
Eelco Dolstra
a21155609e Remove obsolete zsh help text
(cherry picked from commit 956f464fff)
2014-04-30 16:44:37 +02:00
Eelco Dolstra
5a6090529f Installer test: Remove fileSystems argument
The config function unintentionally ignored its fileSystems
argument. However, things still worked thanks to the magic of
nixos-generate-config. Yay!

(cherry picked from commit 077ecf43e5)
2014-04-30 16:44:32 +02:00
Mihaly Barasz
4df0681dfe tzdata: use symlinks instead of hardlinks
Hard links are not handled by nar, so installing from binary cache
unnecessarily duplicates data. Also, it's more common to use symlinks for the
tzdata package in other distributions.

(cherry picked from commit 1f2228cdc1)
2014-04-30 16:43:58 +02:00
Eelco Dolstra
5619db6872 tzdata: Update to 2014b
(cherry picked from commit dc224baba1)
2014-04-30 16:43:58 +02:00
Mihaly Barasz
4829a4d14c tzdata: fix 'posix' symlink
(cherry picked from commit c2c90bf2bb)
2014-04-30 16:43:58 +02:00
Domen Kozar
65aed4c96f modernize nixos-generate-config
(cherry picked from commit 88a8ec37d3)
2014-04-30 10:25:17 -04:00
Shea Levy
b8d1205fdc Actually use services.mysql.port
Fixes #1315

(cherry picked from commit 26d03000c2)
2014-04-30 10:23:30 -04:00
Rob Vermaas
b20e64b32b Update nixops 1.1.1 to 1.2.
(cherry picked from commit fed7a43020)
2014-04-30 11:15:59 +02:00
Eelco Dolstra
387237fcb8 Remove the option ‘programs.bash.enable’
NixOS has a pervasive dependency on bash. For instance, the X11
session script sources /etc/profile to get a reasonable
environment. Thus we should not provide an option to disable bash.

Also, enabling zsh no longer sets ‘users.defaultUserShell’ to zsh, to
prevent a collision with bash's definition of the same
option. (Changing the default shell is also something that should be
left to the user.)

(cherry picked from commit 90dac235bb)
2014-04-30 08:45:40 +02:00
Eelco Dolstra
6bb78819c0 firefox: Update to 29.0
(cherry picked from commit 1235f693ee)
2014-04-30 08:45:40 +02:00
Austin Seipp
84ab83d261 nixpkgs: clang-analyzer 3.4
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 3c3256e4a8)
2014-04-29 19:37:07 -05:00
Austin Seipp
31bf76e3e2 cryptol: Replace URLs with something meaningful
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 52514efb16)
2014-04-29 17:54:53 -05:00
Austin Seipp
094fc34810 cryptol: add 1.8.x expression
This also includes support for the verification tools I'm using. Cryptol
2 is still the default obviously.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit d9d76f1a3a)
2014-04-29 17:51:46 -05:00
Austin Seipp
68744afca3 nixpkgs: cov-build 7.0.2
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 1d3b5874ad)
2014-04-29 16:01:40 -05:00
Jaka Hudoklin
066855bc88 nodejs: fix on i686-linux
Fixes this:

  creating  ./config.gypi
  creating  ./config.mk
  building
  make flags: SHELL=/nix/store/fp0nwhj932kscakw1gbnlmmk8pdfv9sq-bash-4.2-p45/bin/bash
  building out/Makefile
  /nix/store/vh2zy8l2797yl3mri35y8jnhc81w9hm1-python-2.7.6/bin/python tools/gyp_node.py -f make
  /bin/sh: which: command not found
  gyp: Call to '(echo | $(echo ${CXX_host:-$(which g++)}) -m32 -E - > /dev/null 2>&1) && echo "-m32" || true' returned exit status 0.
  make: *** [out/Makefile] Error 1

[Bjørn: add build error to commit message.]

(cherry picked from commit cbfbd01cd7)
2014-04-29 22:33:29 +02:00
Thomas Tuegel
ba3b38d73f qvim: add lua support
(cherry picked from commit 7896a84849)
2014-04-29 22:25:37 +02:00
Jaka Hudoklin
20f79ee906 rabbitmq_server: enable builds on darwin
(cherry picked from commit ca3c2b7b2a)
2014-04-29 22:09:50 +02:00
Jaka Hudoklin
d9e69e3136 erlang: enable and fix builds on darwin
(cherry picked from commit ab53d469f8)
2014-04-29 22:09:47 +02:00
Bjørn Forsman
a2ebf3a767 xfce: fix typo introduced in recent commit (s/gtk/gtk3/)
Fix typo introduced in commit 0b2dd3a12f
(Xfce: Don't depend on GTK+ 3 by default).

(cherry picked from commit b802924af1)
2014-04-29 19:16:01 +02:00
Austin Seipp
10ef32c08d spark: 0.9.0 -> 0.9.1
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit c8f82b4ee8)
2014-04-29 10:34:51 -05:00
Eelco Dolstra
86e1778409 Disable autofs module
It appears to be unmaintained and untested. Also, systemd provides
automount functionality so it's probably not needed anymore.

(cherry picked from commit bfc524664a)
2014-04-29 16:04:35 +02:00
Eelco Dolstra
f7cdc5d5fe Add a test for automounting
(cherry picked from commit 501d532188)
2014-04-29 16:04:32 +02:00
Eelco Dolstra
64fd7e5757 Xfce: Don't depend on GTK+ 3 by default
Given that Xfce is intended as a light-weight desktop environment,
pulling in two versions of GTK+ by default is not ideal.

(cherry picked from commit 0b2dd3a12f)
2014-04-29 16:04:27 +02:00
Eelco Dolstra
7392915ddc Move the NVIDIA support into its own module
Previously all card-specific stuff was scattered across xserver.nix
and opengl.nix, which is ugly. Now it can be kept together in a single
card-specific module. This required the addition of a few internal
options:

- services.xserver.drivers: A list of { name, driverName, modules,
  libPath } sets.

- hardware.opengl.package: The OpenGL implementation. Note that there
  can be only one OpenGL implementation at a time in a system
  configuration (i.e. no dynamic detection).

- hardware.opengl.package32: The 32-bit OpenGL implementation.

(cherry picked from commit 02cef04c81)
2014-04-29 16:04:23 +02:00
Eelco Dolstra
11c5154b47 Rename hardware.opengl.videoDrivers back to services.xserver.videoDrivers
Fixes #2379.
The new name was a misnomer because the values really are X11 video
drivers (e.g. ‘cirrus’ or ‘nvidia’), not OpenGL implementations. That
it's also used to set an OpenGL implementation for kmscon is just
confusing overloading.

(cherry picked from commit 3fe96bcca1)
2014-04-29 16:04:18 +02:00
Eelco Dolstra
ca0d0f83ca Obsolete fonts.extraFonts
You can now just set fonts.fonts, which will be merged with the
default value unless you use mkOverride.

(cherry picked from commit e6b5c0121f)
2014-04-29 16:04:14 +02:00
Eelco Dolstra
b72398906f Shut up warning about missing fonts.dtd
(cherry picked from commit 5ae8ed381c)
2014-04-29 16:04:10 +02:00
Eelco Dolstra
00c45fb8ba Remove redundant ~/.fonts element from the font search path
(cherry picked from commit d6c2dcd98c)
2014-04-29 16:04:05 +02:00
Kirill Elagin
a2d659a4e6 Let users install fonts to their HOME directory
(cherry picked from commit 8dc287b88c)
2014-04-29 16:04:01 +02:00
William A. Kennington III
fcc00bd0b5 nixos: Add support for changing supported systems
release.nix and release-combined.nix current hardcode the systems which
they are built for. This change introduces an argument to the
expressions called supportedSystems, which allows the builder to choose
which architectures he wants to build. By default, this uses the same
linux x86_64 and i686 architectures.

(cherry picked from commit 936481a12e)
2014-04-29 16:03:55 +02:00
Eelco Dolstra
3f4e115444 Fix some uid/gid attributes to match the actual user/group name
(cherry picked from commit a142d68b43)
2014-04-29 16:03:50 +02:00
Eelco Dolstra
ef4d792827 Allocate system uids/gids between 400 and 500
Previously it was between 100 and 500, but this can already collide
with the static uids/guid in misc/ids.nix.

(cherry picked from commit 0e23a175de)
2014-04-29 16:03:45 +02:00
Eelco Dolstra
6f5fff79a8 Bring back the isSystemUser option
(cherry picked from commit 05468f9b78)
2014-04-29 16:03:41 +02:00
Eelco Dolstra
795de7faf5 Remove use of obsolete flags
(cherry picked from commit 2dfbe55421)
2014-04-29 16:03:37 +02:00
Vladimír Čunát
a88b0e4bc2 qt48: bugfix update 4.8.5 -> .6
Some patches dropped, as they seemed included.

(cherry picked from commit 920a734a15)
2014-04-29 16:03:29 +02:00
Eelco Dolstra
718faf3116 Add some packages to the channel
(cherry picked from commit 2ca913c509)
2014-04-29 16:03:18 +02:00
Eelco Dolstra
26e8a18ce7 polkit: Remove unnecessary restart
There already is a restart trigger that takes care of this.

(cherry picked from commit 4353220202)
2014-04-29 16:03:10 +02:00
Eelco Dolstra
97cb3ea472 wpa_supplicant: Restart when wlan devices (dis)appear
(cherry picked from commit cbfba813fe)
2014-04-29 10:09:10 +02:00
Eelco Dolstra
48234a5f3d cpufreq: Don't fail if the CPU doesn't support frequency setting
(cherry picked from commit f5cd4eef11)
2014-04-29 10:09:10 +02:00
Eelco Dolstra
08efdc72e6 gpm: Depend on /dev/input/mice
(cherry picked from commit 685ca50650)
2014-04-29 10:09:10 +02:00
Austin Seipp
abd636291f nixos: refactor tarsnap module
The Tarsnap module is now far more flexible, allowing individual
archives with individual options to be specified at will, allowing
granular backup schedules, etc.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 9242ed1fe2)
2014-04-28 18:17:56 -05:00
Austin Seipp
5b3a2abaa0 lockdep: 3.14 -> 3.14.2
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 7faaa9e6da)
2014-04-28 18:17:52 -05:00
Austin Seipp
63c27b367a minecraft-server: 1.7.5 -> 1.7.9
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit ec13d61cbf)
2014-04-28 18:17:48 -05:00
Austin Seipp
27261cc765 fmod: 4.44.32 -> 4.44.33
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit fec91fd092)
2014-04-28 15:28:29 -05:00
Austin Seipp
02d920f3c4 nixpkgs: verifast 13.11.14
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit aaa0304a45)
2014-04-28 15:28:29 -05:00
Rob Vermaas
9131402036 Fix EC2 creation script for latest nixops
(cherry picked from commit 361eb3a5f5)
(cherry picked from commit de1c182b0a)
2014-04-28 15:51:39 +02:00
Eelco Dolstra
aec0d8b0f5 apr: Update to 1.5.1
(cherry picked from commit 17336efdd8)
2014-04-28 15:51:39 +02:00
Eelco Dolstra
e874b13935 qemu: Apply patch for CVE-2014-0150, CVE-2014-2894
(cherry picked from commit 39faed1f2f)
2014-04-28 15:51:38 +02:00
Eelco Dolstra
b030f2bd8f Set the channel for this release 2014-04-28 15:50:36 +02:00
Eelco Dolstra
e1f2ba1f54 Bump some mentions of 13.10 2014-04-28 12:37:19 +02:00
Eelco Dolstra
e59a864a18 Update release notes 2014-04-28 12:13:16 +02:00
Eelco Dolstra
44e3b9e808 polkit: Restart using systemctl
The use of pkill is now particularly bad due to containers (it might
kill processes in containers).
2014-04-28 12:13:16 +02:00
Simon Hengel
e237476d64 Update haskell-base-compat to version 0.5.0
Closes #2431

Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 62b883070b)
2014-04-28 04:58:42 -05:00
Simon Hengel
9dfbab0b52 Update haskell-http-kit to version 0.2.1
Closes #2430

Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 692fc6fdc1)
2014-04-28 04:58:38 -05:00
Eelco Dolstra
673b2d1650 switch-to-configuration: Use old systemctl to stop units
Otherwise, when switching from systemd 203 to 212, you get errors like:

  Failed to stop remote-fs.target: Bad message
  Failed to stop systemd-udevd-control.socket: Bad message
  ...

(cherry picked from commit 56b4b841ae)
2014-04-28 09:20:50 +02:00
Eelco Dolstra
1417d2226f switch-to-configuration: Use systemctl's --no-legend flag
(cherry picked from commit 37e6e08cde)
2014-04-28 09:20:50 +02:00
Eelco Dolstra
b725dc2ed9 Give the KDE test more memory
(cherry picked from commit 7ddcd7b6b6)
2014-04-28 09:20:50 +02:00
Eelco Dolstra
b09da697d3 Make some tests release-critical
(cherry picked from commit 537c034e8f)
2014-04-28 09:20:49 +02:00
Eelco Dolstra
85c8b16fd4 Fix ‘nixos-container run’
By default, socat only waits 0.5s for the remote side to finish after
getting EOF on the local side. So don't close the local side, instead
wait for socat to exit when the remote side finishes.

http://hydra.nixos.org/build/10663282
(cherry picked from commit fec3b75e4b)
2014-04-28 09:20:49 +02:00
Austin Seipp
7644e30eb2 nixpkgs: remove cb1cat
Brice Minaud reported a simple attack on the CBEAM Pi permutation
function, resulting in it being withdrawn from CAESAR. :(

Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 111e1536e5)
2014-04-27 13:52:51 -05:00
Austin Seipp
3c4ee44079 hol_light: fix script, upgrade to r189
This also tweaks the version number to just use the SVN revision (rather
than date), since it's unambiguous and increasing anyway.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 0f1f2115e9)
2014-04-27 13:32:02 -05:00
Bjørn Forsman
d9e02c1df3 psmisc: (from upstream) Typo in fuser makes -M on all the time
(cherry picked from commit 6859853045)
2014-04-27 20:20:17 +02:00
Austin Seipp
3bd9a1ae03 nixpkgs: yices 2.2.1
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit da0c8f33ef)
2014-04-27 13:06:44 -05:00
aszlig
7109965cd5 chromium: Fix desktop icon and duplicate entry.
This should fix the desktop icon location for both desktop entries (the
one from the Chromium derivation itself and the wrapper) and renames the
name of the file so that it gets overridden by the wrappers desktop item
so we don't end up having two of them.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit d8f8f31726)
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2014-04-27 18:53:36 +02:00
Austin Seipp
bea158d89c ats/ats2: clean-up, adopt, add Hydra packages
This also bumps ATS2 to version 0.0.7

Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit e590c0a867)
2014-04-27 11:26:40 -05:00
Austin Seipp
a0b81c40a2 kernel/grsecurity: stable/longterm/testing updates
kernels:

  - longterm: 3.4.87  -> 3.4.88
  - longterm: 3.10.37 -> 3.10.38
  - stable:   3.13.10 -> 3.13.11
  - stable:   3.14.1  -> 3.14.2

grsecurity:

  - test: 3.0-3.14.1-201404241722 -> 3.0-3.14.2-201404270907

NOTE: technically the 3.13 stable kernel is now EOL. However, it will
become the long-term grsecurity stable kernel, and will have ongoing
support from Canonical.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 92f7781f00)
2014-04-27 08:46:06 -05:00
Linquize
cc614c0d4c DisnixWebService: Fix broken build by exposing jdk as buildInputs
(cherry picked from commit 9cacabd5bb)
2014-04-27 06:01:33 -05:00
Domen Kožar
56285c17db pythonPackages.chameleon: 2.11 -> 2.15 2014-04-27 12:21:49 +02:00
Austin Seipp
a37635ee56 cryptol-mode: 0.1.0
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 9ef104cbad)
2014-04-26 12:51:35 -05:00
Domen Kožar
47def457a1 Make gnome3 test as release critical 2014-04-26 13:31:47 +02:00
Domen Kožar
6a9d230040 pythonPackages.pyramid: 1.4.5 -> 1.5 2014-04-26 12:15:32 +02:00
Austin Seipp
3073e062d6 btsync: 1.3.87 -> 1.3.93
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 4e15dbe34c)
2014-04-26 00:15:16 -05:00
宋文武
9a10937f32 love: update 0.9.0 -> 0.9.1
Changelog:
  https://www.love2d.org/wiki/0.9.1

(cherry picked from commit 0b99e20a3c)
2014-04-26 00:03:55 -05:00
Ricardo M. Correia
770cd1cd32 grsecurity: Update all patches
stable:  3.0-3.2.57-201404182109            -> 3.0-3.2.57-201404241714
test:    3.0-3.14.1-201404201132            -> 3.0-3.14.1-201404241722
vserver: 3.0-3.2.57-vs2.3.2.16-201404182110 -> 3.0-3.2.57-vs2.3.2.16-201404241715
(cherry picked from commit efae8ce543)
2014-04-25 14:25:57 -05:00
Austin Seipp
1062181037 nixpkgs: Add cryptol2 expression
This is just a convenient shorthand so people don't have to spell out
haskellPackages.cryptol

Note that the top-level expression is named 'cryptol2' but the package
isn't. That's because Cryptol is a library and other things could depend
on it (hence the vanilla name), but also the full name will be
disambiguated as 'haskell-cryptol-ghc7.6.3' anyway.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit e146a02d14)
2014-04-25 14:25:50 -05:00
Austin Seipp
5546e5b5a4 cryptol v2.0.0
This comes with several extra libraries, including GraphSCC, monadLib,
presburger, process and smtLib, all required as build dependencies. But
otherwise totally automated via cabal2nix.

Next up is CVC4 (a total pain in the ass to package) for proving/SAT
support.

I have another WIP branch for the unfree 1.x series which I may (or may
not) add later as it has external verification tech at the moment.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit 5401849e3a)
2014-04-25 14:25:30 -05:00
Austin Seipp
689d7e048d nixos: only enable spipe when user specifies
Signed-off-by: Austin Seipp <aseipp@pobox.com>
(cherry picked from commit b470c93c1e)
2014-04-25 14:25:23 -05:00
Eelco Dolstra
8851990313 debian: Update to 6.0.9
(cherry picked from commit 1bae93cb82)
2014-04-25 14:44:59 +02:00
Eelco Dolstra
dddbcae845 Urgh
Can't figure out why "hostname -s" keeps failing randomly :-(

http://hydra.nixos.org/build/10662142
(cherry picked from commit c52fb449f4)
2014-04-25 14:44:59 +02:00
Eelco Dolstra
1ddbdcdc2d cups: Add a listenAddresses option
(cherry picked from commit b8d59765e1)
2014-04-25 14:44:59 +02:00
Eelco Dolstra
c6d2739d4b Manual: Don't include the platform type of the host system
This causes unnecessary rebuilds of the manual.

http://hydra.nixos.org/build/10662170
(cherry picked from commit cd05320716)
2014-04-25 14:44:58 +02:00
Eelco Dolstra
8c65992314 Make nscd startup synchronous
Nscd forks into the background before it's ready to accept
connections. So explicitly wait until it's ready.

http://hydra.nixos.org/build/10661767
(cherry picked from commit 23297b0edd)
2014-04-25 14:44:58 +02:00
Eelco Dolstra
a58e004778 cups: Start after network.target
http://hydra.nixos.org/build/10661709
(cherry picked from commit d7a7f80aff)
2014-04-25 14:44:58 +02:00
Eelco Dolstra
109a2bee28 Remove outdated remark
(cherry picked from commit 2c70276d96)
2014-04-25 14:44:58 +02:00
Vladimír Čunát
4001f85b0c linux-3.12: bump .17 -> .18
(cherry picked from commit 116d52c6df)
2014-04-25 14:44:57 +02:00
Eelco Dolstra
c3917f4d84 Try again
(cherry picked from commit af817ae0d8)
2014-04-25 14:44:57 +02:00
Eelco Dolstra
feecc6067a Fix simpleTest function
(cherry picked from commit 019e9d8a3d)
2014-04-25 14:44:57 +02:00
Eelco Dolstra
0d5e3df9d9 Silence some Hydra evaluation warnings
(cherry picked from commit d304b277bd)
2014-04-25 14:44:37 +02:00
Shea Levy
ef618678b8 Add php 5.3 variant with fpm support
(cherry picked from commit e85b164df8)
2014-04-25 08:20:02 -04:00
aszlig
4a0c468043 python-django: Update to 1.4.11, 1.5.6 and 1.6.3.
This fixes CVE-2014-0472, details can be found at:

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-0472
https://www.djangoproject.com/weblog/2014/apr/21/security/

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2014-04-25 12:24:58 +02:00
Shea Levy
18d2284d15 sproxy: bump
(cherry picked from commit d4cb80eaf4)
2014-04-24 13:29:03 -04:00
Shea Levy
7e375e9aa2 Add haskell-http-kit
(cherry picked from commit c7f2d87a56)
2014-04-24 13:28:54 -04:00
Mathijs Kwik
efd39af1f4 neoload: upgrade to 4.1.4 and fix mem issues
(cherry picked from commit d2edc329e1)
2014-04-24 15:29:14 +02:00
Mathijs Kwik
4e15c2ecc0 node.js - use bundled v8 :14.04-bugfix:
node needs v8 3.14, which is no longer maintained.
They bundle an in-tree version which does receive backports.

(cherry picked from commit 925c75c68d)
2014-04-24 15:28:35 +02:00
robberer
14fd47651a kde: “kdnssd” package is now called “zeroconf-ioslave”
Close #2358.

(cherry picked from commit a2fad89723)
2014-04-24 15:28:20 +02:00
Eelco Dolstra
c46e466c40 Make the misc test a bit more robust
(cherry picked from commit 2b7e746c02)
2014-04-24 15:25:36 +02:00
Eelco Dolstra
f171ed481b dhcpcd: Fix segfaults
This fixes several problems in the dhcpcd service:

* A segfault during startup, due to a race with udev (dhcpcd would get
  an ADD event from udev, causing it to re-add an interface that it
  already had, leading to a segfault later on).

* A hang/segfault processing "dhcpcd rebind" (which NixOS calls after
  waking up from suspend).

Also, add "lo" to the list of ignored interfaces. It usually ignores
"lo", but apparently not when it gets an ADD event from udev.

(cherry picked from commit 2d8c0d24f2)
2014-04-24 15:25:36 +02:00
Eelco Dolstra
242eadeb48 Remove some dead code
(cherry picked from commit 25af3671f9)
2014-04-24 15:25:35 +02:00
Eelco Dolstra
9cdf29589c Don't create world-readable swapfiles
(cherry picked from commit d4986b5fd3)
2014-04-24 15:25:35 +02:00
Luca Bruno
46c3c741b0 accountsservice: fix creating data under /var/lib
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:58 +02:00
Luca Bruno
0cb2766511 gnome-documents: new package
Document manager application designed to work with GNOME 3

https://wiki.gnome.org/Apps/Documents
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:58 +02:00
Luca Bruno
827c9be4e3 gnome-online-miners: new package
A set of crawlers that go through your online content and index them locally in Tracker

https://wiki.gnome.org/Projects/GnomeOnlineMiners
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:58 +02:00
Luca Bruno
36d73c923c gfbgraph: new package
GLib/GObject wrapper for the Facebook Graph API

Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:58 +02:00
Luca Bruno
86a3024dc2 tracker: downgrade to 0.16
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:57 +02:00
Luca Bruno
14090a2fe3 glade: new package
User interface designer for GTK+ applications

https://wiki.gnome.org/Apps/Glade
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:57 +02:00
Luca Bruno
1c38eb71e6 gnome-music: new package
Music player and management application for the GNOME desktop environment

https://wiki.gnome.org/Apps/Music
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:56 +02:00
Luca Bruno
f1faa45bdb file-roller: delete hicolor icon cache
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:56 +02:00
Luca Bruno
b226e4af87 transmission-remote-gtk: delete hicolor icon cache
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:56 +02:00
Luca Bruno
372647f6ab totem: use grilo plugins
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:55 +02:00
Luca Bruno
18ced7db7b grilo-plugins: new package
A collection of plugins for the Grilo framework

https://wiki.gnome.org/action/show/Projects/Grilo
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:55 +02:00
Luca Bruno
7e5a05ce9b grilo: enable grl-net
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:54 +02:00
Luca Bruno
0c84492519 seahorse: new package
Application for managing encryption keys and passwords in the GnomeKeyring

https://wiki.gnome.org/Apps/Seahorse
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:54 +02:00
Luca Bruno
ae7ea8dc06 gnome3: prioritize nautilus when opening inode/directory
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:54 +02:00
Luca Bruno
5ca1f24a96 grilo: enable gobject introspection
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:53 +02:00
Luca Bruno
973f83d91a xdg-user-dirs: fix finding default directory names
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:53 +02:00
Luca Bruno
2f9b9de73c libmediaart: new library used by gnome-music
Library tasked with managing, extracting and handling media art caches

Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:53 +02:00
Luca Bruno
afbe2b6720 gnome3: moved gnome-desktop from desktop/ to core/
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:52 +02:00
Luca Bruno
85f8efc834 gnome3: moved gtksourceview from desktop/ to core/
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:52 +02:00
Luca Bruno
b845776a90 gnome3: moved file-roller from desktop/ to apps/
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:52 +02:00
Luca Bruno
7043225be2 gedit: new package
Official text editor of the GNOME desktop environment

https://wiki.gnome.org/Apps/Gedit
Signed-off-by: Domen Kožar <domen@dev.si>
2014-04-24 01:25:51 +02:00
Bjørn Forsman
e46e9fe4ac thrift: unbreak build
Add a tiny patch (already upstream) that fixes this build error:

  <flex>/lib/libfl.so: undefined reference to `yylex'

(cherry picked from commit 83d0fd3078)
2014-04-23 21:53:42 +02:00
Shea Levy
4dda8b76fe Add gcc-4.9.0
(cherry picked from commit a3b1f48c5d)
2014-04-23 10:47:53 -04:00
Lluís Batlle i Rossell
bc4361ee29 Making nvidia build with linux 3.14. Patch not needed anymore. 2014-04-23 16:04:02 +02:00
Eelco Dolstra
e001ac6a9e Fix meta.maintainer -> meta.maintainers
(cherry picked from commit dbd332d147)
2014-04-23 15:17:14 +02:00
9437 changed files with 142935 additions and 1100061 deletions

16
.gitignore vendored
View File

@@ -3,16 +3,8 @@
.*.swp
.*.swo
result
result-*
/doc/NEWS.html
/doc/NEWS.txt
/doc/manual.html
/doc/manual.pdf
doc/NEWS.html
doc/NEWS.txt
doc/manual.html
doc/manual.pdf
.version-suffix
.DS_Store
/pkgs/applications/kde-apps-*/tmp/
/pkgs/development/libraries/kde-frameworks-*/tmp/
/pkgs/development/libraries/qt-5/*/tmp/
/pkgs/desktops/plasma-*/tmp/

View File

@@ -1,6 +1,5 @@
language: python
python: "3.4"
sudo: required
before_install: ./maintainers/scripts/travis-nox-review-pr.sh nix
install: ./maintainers/scripts/travis-nox-review-pr.sh nox
script: ./maintainers/scripts/travis-nox-review-pr.sh build

View File

@@ -1 +1 @@
16.03
14.04

View File

@@ -1,12 +0,0 @@
# How to contribute
## Opening issues
* Make sure you have a [GitHub account](https://github.com/signup/free)
* [Submit an issue](https://github.com/NixOS/nixpkgs/issues) - assuming one does not already exist.
* Clearly describe the issue including steps to reproduce when it is a bug.
* Include information what version of nixpkgs and Nix are you using (nixos-version or git revision).
## Submitting changes
See the nixpkgs manual for details on how to [Submit changes to nixpkgs](http://hydra.nixos.org/job/nixpkgs/trunk/manual/latest/download-by-type/doc/manual#chap-submitting-changes).

View File

@@ -1,44 +1,10 @@
[<img src="http://nixos.org/logo/nixos-hires.png" width="500px" alt="logo" />](https://nixos.org/nixos)
[![Build Status](https://travis-ci.org/NixOS/nixpkgs.svg?branch=master)](https://travis-ci.org/NixOS/nixpkgs)
[![Issue Stats](http://www.issuestats.com/github/nixos/nixpkgs/badge/pr)](http://www.issuestats.com/github/nixos/nixpkgs)
[![Issue Stats](http://www.issuestats.com/github/nixos/nixpkgs/badge/issue)](http://www.issuestats.com/github/nixos/nixpkgs)
Nixpkgs is a collection of packages for the [Nix](https://nixos.org/nix/) package
manager. It is periodically built and tested by the [hydra](http://hydra.nixos.org/)
build daemon as so-called channels. To get channel information via git, add
[nixpkgs-channels](https://github.com/NixOS/nixpkgs-channels.git) as a remote:
```
% git remote add channels git://github.com/NixOS/nixpkgs-channels.git
```
For stability and maximum binary package support, it is recommended to maintain
custom changes on top of one of the channels, e.g. `nixos-15.09` for the latest
release and `nixos-unstable` for the latest successful build of master:
```
% git remote update channels
% git rebase channels/nixos-15.09
```
For pull-requests, please rebase onto nixpkgs `master`.
[NixOS](https://nixos.org/nixos/) linux distribution source code is located inside
`nixos/` folder.
* [NixOS installation instructions](https://nixos.org/nixos/manual/#ch-installation)
* [Documentation (Nix Expression Language chapter)](https://nixos.org/nix/manual/#ch-expression-language)
* [Manual (How to write packages for Nix)](https://nixos.org/nixpkgs/manual/)
* [Manual (NixOS)](https://nixos.org/nixos/manual/)
* [Continuous package builds for unstable/master](https://hydra.nixos.org/jobset/nixos/trunk-combined)
* [Continuous package builds for 14.12 release](https://hydra.nixos.org/jobset/nixos/release-14.12)
* [Continuous package builds for 15.09 release](https://hydra.nixos.org/jobset/nixos/release-15.09)
* [Tests for unstable/master](https://hydra.nixos.org/job/nixos/trunk-combined/tested#tabs-constituents)
* [Tests for 14.12 release](https://hydra.nixos.org/job/nixos/release-14.12/tested#tabs-constituents)
* [Tests for 15.09 release](https://hydra.nixos.org/job/nixos/release-15.09/tested#tabs-constituents)
Communication:
Nixpkgs is a collection of packages for [Nix](http://nixos.org/nix/) package
manager. Nixpkgs also includes [NixOS](http://nixos.org/nixos/) linux distribution source code.
* [NixOS installation instructions](http://nixos.org/nixos/manual/#installing-nixos)
* [Manual (How to write packages for Nix)](http://nixos.org/nixpkgs/manual/)
* [Manual (NixOS)](http://nixos.org/nixos/manual/)
* [Continuous build](http://hydra.nixos.org/jobset/nixos/trunk-combined)
* [Tests](http://hydra.nixos.org/job/nixos/trunk-combined/tested#tabs-constituents)
* [Mailing list](http://lists.science.uu.nl/mailman/listinfo/nix-dev)
* [IRC - #nixos on freenode.net](irc://irc.freenode.net/#nixos)

View File

@@ -1,8 +1,6 @@
let requiredVersion = "1.10"; in
if ! builtins ? nixVersion || builtins.compareVersions "1.6" builtins.nixVersion == 1 then
if ! builtins ? nixVersion || builtins.compareVersions requiredVersion builtins.nixVersion == 1 then
abort "This version of Nixpkgs requires Nix >= ${requiredVersion}, please upgrade! See https://nixos.org/wiki/How_to_update_when_Nix_is_too_old_to_evaluate_Nixpkgs"
abort "This version of Nixpkgs requires Nix >= 1.6, please upgrade!"
else

41
doc/Makefile Normal file
View File

@@ -0,0 +1,41 @@
# You may need to override this.
docbookxsl = $(HOME)/.nix-profile/xml/xsl/docbook
dblatex = dblatex
XMLLINT = xmllint --catalogs
XSLTPROC = xsltproc --catalogs \
--param section.autolabel 1 \
--param section.label.includes.component.label 1 \
--param html.stylesheet \'style.css\' \
--param xref.with.number.and.title 1 \
--param toc.section.depth 3 \
--param admon.style \'\' \
--param callout.graphics.extension \'.gif\'
NEWS_OPTS = \
--stringparam generate.toc "article nop" \
--stringparam section.autolabel.max.depth 0 \
--stringparam header.rule 0
all: NEWS.html NEWS.txt manual.html manual.pdf
NEWS.html: release-notes.xml
$(XSLTPROC) --nonet --xinclude --output $@ $(NEWS_OPTS) \
$(docbookxsl)/xhtml/docbook.xsl release-notes.xml
NEWS.txt: release-notes.xml
$(XSLTPROC) --nonet --xinclude quote-literals.xsl release-notes.xml | \
$(XSLTPROC) --nonet --output $@.tmp.html $(NEWS_OPTS) \
$(docbookxsl)/xhtml/docbook.xsl -
LANG=en_US w3m -dump $@.tmp.html > $@
rm $@.tmp.html
manual.html: *.xml
$(XSLTPROC) --nonet --xinclude --output manual.html \
$(docbookxsl)/xhtml/docbook.xsl manual.xml
manual.pdf: *.xml
$(dblatex) \
-P doc.collab.show=0 \
-P latex.output.revhistory=0 \
manual.xml

View File

@@ -5,7 +5,7 @@
<title>Coding conventions</title>
<section xml:id="sec-syntax"><title>Syntax</title>
<section><title>Syntax</title>
<itemizedlist>
@@ -169,8 +169,8 @@ stdenv.mkDerivation { ...
args: with args; <replaceable>...</replaceable>
</programlisting>
or
or
<programlisting>
{ stdenv, fetchurl, perl, ... }: <replaceable>...</replaceable>
</programlisting>
@@ -207,7 +207,7 @@ args.stdenv.mkDerivation (args // {
</section>
<section xml:id="sec-package-naming"><title>Package naming</title>
<section><title>Package naming</title>
<para>In Nixpkgs, there are generally three different names associated with a package:
@@ -256,12 +256,6 @@ bound to the variable name <varname>e2fsprogs</varname> in
a package named <literal>hello-svn</literal> by
<command>nix-env</command>.</para></listitem>
<listitem><para>If package is fetched from git's commit then
the version part of the name <emphasis>must</emphasis> be the date of that
(fetched) commit. The date must be in <literal>"YYYY-MM-DD"</literal> format.
Also add <literal>"git"</literal> to the name - e.g.,
<literal>"pkgname-git-2014-09-23"</literal>.</para></listitem>
<listitem><para>Dashes in the package name should be preserved
in new variable names, rather than converted to underscores
(which was convention up to around 2013 and most names
@@ -292,7 +286,7 @@ dashes between words — not in camel case. For instance, it should be
<filename>allPackages.nix</filename> or
<filename>AllPackages.nix</filename>.</para>
<section xml:id="sec-hierarchy"><title>Hierarchy</title>
<section><title>Hierarchy</title>
<para>Each package should be stored in its own directory somewhere in
the <filename>pkgs/</filename> tree, i.e. in
@@ -451,17 +445,12 @@ splitting up an existing category.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>If its a <emphasis>desktop environment</emphasis>:</term>
<term>If its a <emphasis>desktop environment</emphasis>
(including <emphasis>window managers</emphasis>):</term>
<listitem>
<para><filename>desktops</filename> (e.g. <filename>kde</filename>, <filename>gnome</filename>, <filename>enlightenment</filename>)</para>
</listitem>
</varlistentry>
<varlistentry>
<term>If its a <emphasis>window manager</emphasis>:</term>
<listitem>
<para><filename>applications/window-managers</filename> (e.g. <filename>awesome</filename>, <filename>compiz</filename>, <filename>stumpwm</filename>)</para>
</listitem>
</varlistentry>
<varlistentry>
<term>If its an <emphasis>application</emphasis>:</term>
<listitem>
@@ -609,57 +598,6 @@ evaluate correctly.</para>
</section>
</section>
<section xml:id="sec-sources"><title>Fetching Sources</title>
<para>There are multiple ways to fetch a package source in nixpkgs. The
general guidline is that you should package sources with a high degree of
availability. Right now there is only one fetcher which has mirroring
support and that is <literal>fetchurl</literal>. Note that you should also
prefer protocols which have a corresponding proxy environment variable.
</para>
<para>You can find many source fetch helpers in <literal>pkgs/build-support/fetch*</literal>.
</para>
<para>In the file <literal>pkgs/top-level/all-packages.nix</literal> you can
find fetch helpers, these have names on the form
<literal>fetchFrom*</literal>. The intention of these are to provide
snapshot fetches but using the same api as some of the version controlled
fetchers from <literal>pkgs/build-support/</literal>. As an example going
from bad to good:
<itemizedlist>
<listitem>
<para>Uses <literal>git://</literal> which won't be proxied.
<programlisting>
src = fetchgit {
url = "git://github.com/NixOS/nix.git";
rev = "1f795f9f44607cc5bec70d1300150bfefcef2aae";
sha256 = "1cw5fszffl5pkpa6s6wjnkiv6lm5k618s32sp60kvmvpy7a2v9kg";
}
</programlisting>
</para>
</listitem>
<listitem>
<para>This is ok, but an archive fetch will still be faster.
<programlisting>
src = fetchgit {
url = "https://github.com/NixOS/nix.git";
rev = "1f795f9f44607cc5bec70d1300150bfefcef2aae";
sha256 = "1cw5fszffl5pkpa6s6wjnkiv6lm5k618s32sp60kvmvpy7a2v9kg";
}
</programlisting>
</para>
</listitem>
<listitem>
<para>Fetches a snapshot archive and you get the rev you want.
<programlisting>
src = fetchFromGitHub {
owner = "NixOS";
repo = "nix";
rev = "1f795f9f44607cc5bec70d1300150bfefcef2aae";
sha256 = "04yri911rj9j19qqqn6m82266fl05pz98inasni0vxr1cf1gdgv9";
}
</programlisting>
</para>
</listitem>
</itemizedlist>
</para>
</section>
</chapter>

View File

@@ -2,19 +2,20 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="chap-contributing">
<title>Contributing to this documentation</title>
<title>Contributing</title>
<para>The DocBook sources of the Nixpkgs manual are in the <filename
xlink:href="https://github.com/NixOS/nixpkgs/tree/master/doc">doc</filename>
subdirectory of the Nixpkgs repository. If you make modifications to
the manual, it's important to build it before committing. You can do that as follows:
<para>If you make modifications to the manual, it's important to build the manual before contributing:</para>
<screen>
$ cd /path/to/nixpkgs
$ nix-build doc
</screen>
<orderedlist>
If the build succeeds, the manual will be in
<filename>./result/share/doc/nixpkgs/manual.html</filename>.</para>
<listitem><para><command>$ git clone git://github.com/NixOS/nixpkgs.git</command></para></listitem>
<listitem><para><command>$ cd nixpkgs/pkgs/top-level</command></para></listitem>
<listitem><para><command>$ nix-build -A tarball release.nix</command></para></listitem>
<listitem><para>Inside the built derivation you shall see <literal>manual/index.html</literal> file.</para></listitem>
</orderedlist>
</chapter>

View File

@@ -1,61 +0,0 @@
with import ./.. { };
with lib;
stdenv.mkDerivation {
name = "nixpkgs-manual";
sources = sourceFilesBySuffices ./. [".xml"];
buildInputs = [ pandoc libxml2 libxslt ];
xsltFlags = ''
--param section.autolabel 1
--param section.label.includes.component.label 1
--param html.stylesheet 'style.css'
--param xref.with.number.and.title 1
--param toc.section.depth 3
--param admon.style '''
--param callout.graphics.extension '.gif'
'';
buildCommand = ''
{
echo "<chapter xmlns=\"http://docbook.org/ns/docbook\""
echo " xmlns:xlink=\"http://www.w3.org/1999/xlink\""
echo " xml:id=\"users-guide-to-the-haskell-infrastructure\">"
echo ""
echo "<title>User's Guide to the Haskell Infrastructure</title>"
echo ""
pandoc ${./haskell-users-guide.md} -w docbook | \
sed -e 's|<ulink url=|<link xlink:href=|' \
-e 's|</ulink>|</link>|' \
-e 's|<sect. id=|<section xml:id=|' \
-e 's|</sect[0-9]>|</section>|'
echo ""
echo "</chapter>"
} >haskell-users-guide.xml
ln -s "$sources/"*.xml .
echo ${nixpkgsVersion} > .version
xmllint --noout --nonet --xinclude --noxincludenode \
--relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
manual.xml
dst=$out/share/doc/nixpkgs
mkdir -p $dst
xsltproc $xsltFlags --nonet --xinclude \
--output $dst/manual.html \
${docbook5_xsl}/xml/xsl/docbook/xhtml/docbook.xsl \
./manual.xml
cp ${./style.css} $dst/style.css
mkdir -p $dst/images/callouts
cp "${docbook5_xsl}/xml/xsl/docbook/images/callouts/"*.gif $dst/images/callouts/
mkdir -p $out/nix-support
echo "doc manual $dst manual.html" >> $out/nix-support/hydra-build-products
'';
}

View File

@@ -1,287 +0,0 @@
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="chap-functions">
<title>Functions reference</title>
<para>
The nixpkgs repository has several utility functions to manipulate Nix expressions.
</para>
<section xml:id="sec-pkgs-overridePackages">
<title>pkgs.overridePackages</title>
<para>
This function inside the nixpkgs expression (<varname>pkgs</varname>)
can be used to override the set of packages itself.
</para>
<para>
Warning: this function is expensive and must not be used from within
the nixpkgs repository.
</para>
<para>
Example usage:
<programlisting>let
pkgs = import &lt;nixpkgs&gt; {};
newpkgs = pkgs.overridePackages (self: super: {
foo = super.foo.override { ... };
};
in ...</programlisting>
</para>
<para>
The resulting <varname>newpkgs</varname> will have the new <varname>foo</varname>
expression, and all other expressions depending on <varname>foo</varname> will also
use the new <varname>foo</varname> expression.
</para>
<para>
The behavior of this function is similar to <link
linkend="sec-modify-via-packageOverrides">config.packageOverrides</link>.
</para>
<para>
The <varname>self</varname> parameter refers to the final package set with the
applied overrides. Using this parameter may lead to infinite recursion if not
used consciously.
</para>
<para>
The <varname>super</varname> parameter refers to the old package set.
It's equivalent to <varname>pkgs</varname> in the above example.
</para>
</section>
<section xml:id="sec-pkg-override">
<title>&lt;pkg&gt;.override</title>
<para>
The function <varname>override</varname> is usually available for all the
derivations in the nixpkgs expression (<varname>pkgs</varname>).
</para>
<para>
It is used to override the arguments passed to a function.
</para>
<para>
Example usages:
<programlisting>pkgs.foo.override { arg1 = val1; arg2 = val2; ... }</programlisting>
<programlisting>pkgs.overridePackages (self: super: {
foo = super.foo.override { barSupport = true ; };
})</programlisting>
<programlisting>mypkg = pkgs.callPackage ./mypkg.nix {
mydep = pkgs.mydep.override { ... };
})</programlisting>
</para>
<para>
In the first example, <varname>pkgs.foo</varname> is the result of a function call
with some default arguments, usually a derivation.
Using <varname>pkgs.foo.override</varname> will call the same function with
the given new arguments.
</para>
</section>
<section xml:id="sec-pkg-overrideDerivation">
<title>&lt;pkg&gt;.overrideDerivation</title>
<para>
The function <varname>overrideDerivation</varname> is usually available for all the
derivations in the nixpkgs expression (<varname>pkgs</varname>).
</para>
<para>
It is used to create a new derivation by overriding the attributes of
the original derivation according to the given function.
</para>
<para>
Example usage:
<programlisting>mySed = pkgs.gnused.overrideDerivation (oldAttrs: {
name = "sed-4.2.2-pre";
src = fetchurl {
url = ftp://alpha.gnu.org/gnu/sed/sed-4.2.2-pre.tar.bz2;
sha256 = "11nq06d131y4wmf3drm0yk502d2xc6n5qy82cg88rb9nqd2lj41k";
};
patches = [];
});</programlisting>
</para>
<para>
In the above example, the name, src and patches of the derivation
will be overridden, while all other attributes will be retained from the
original derivation.
</para>
<para>
The argument <varname>oldAttrs</varname> is used to refer to the attribute set of
the original derivation.
</para>
</section>
<section xml:id="sec-lib-makeOverridable">
<title>lib.makeOverridable</title>
<para>
The function <varname>lib.makeOverridable</varname> is used to make the result
of a function easily customizable. This utility only makes sense for functions
that accept an argument set and return an attribute set.
</para>
<para>
Example usage:
<programlisting>f = { a, b }: { result = a+b; }
c = lib.makeOverridable f { a = 1; b = 2; }</programlisting>
</para>
<para>
The variable <varname>c</varname> is the value of the <varname>f</varname> function
applied with some default arguments. Hence the value of <varname>c.result</varname>
is <literal>3</literal>, in this example.
</para>
<para>
The variable <varname>c</varname> however also has some additional functions, like
<link linkend="sec-pkg-override">c.override</link> which can be used to
override the default arguments. In this example the value of
<varname>(c.override { a = 4; }).result</varname> is 6.
</para>
</section>
<section xml:id="sec-fhs-environments">
<title>buildFHSChrootEnv/buildFHSUserEnv</title>
<para>
<function>buildFHSChrootEnv</function> and
<function>buildFHSUserEnv</function> provide a way to build and run
FHS-compatible lightweight sandboxes. They get their own isolated root with
binded <filename>/nix/store</filename>, so their footprint in terms of disk
space needed is quite small. This allows one to run software which is hard or
unfeasible to patch for NixOS -- 3rd-party source trees with FHS assumptions,
games distributed as tarballs, software with integrity checking and/or external
self-updated binaries.
</para>
<para>
<function>buildFHSChrootEnv</function> allows to create persistent
environments, which can be constructed, deconstructed and entered by
multiple users at once. A downside is that it requires
<literal>root</literal> access for both those who create and destroy and
those who enter it. It can be useful to create environments for daemons that
one can enter and observe.
</para>
<para>
<function>buildFHSUserEnv</function> uses Linux namespaces feature to create
temporary lightweight environments which are destroyed after all child
processes exit. It does not require root access, and can be useful to create
sandboxes and wrap applications.
</para>
<para>
Those functions both rely on <function>buildFHSEnv</function>, which creates
an actual directory structure given a list of necessary packages and extra
build commands.
<function>buildFHSChrootEnv</function> and <function>buildFHSUserEnv</function>
both accept those arguments which are passed to
<function>buildFHSEnv</function>:
</para>
<variablelist>
<varlistentry>
<term><literal>name</literal></term>
<listitem><para>Environment name.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>targetPkgs</literal></term>
<listitem><para>Packages to be installed for the main host's architecture
(i.e. x86_64 on x86_64 installations).</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>multiPkgs</literal></term>
<listitem><para>Packages to be installed for all architectures supported by
a host (i.e. i686 and x86_64 on x86_64 installations).</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>extraBuildCommands</literal></term>
<listitem><para>Additional commands to be executed for finalizing the
directory structure.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>extraBuildCommandsMulti</literal></term>
<listitem><para>Like <literal>extraBuildCommandsMulti</literal>, but
executed only on multilib architectures.</para></listitem>
</varlistentry>
</variablelist>
<para>
Additionally, <function>buildFHSUserEnv</function> accepts
<literal>runScript</literal> parameter, which is a command that would be
executed inside the sandbox and passed all the command line arguments. It
default to <literal>bash</literal>.
</para>
<para>
It also uses <literal>CHROOTENV_EXTRA_BINDS</literal> environment variable
for binding extra directories in the sandbox to outside places. The format of
the variable is <literal>/mnt=test-mnt:/data</literal>, where
<literal>/mnt</literal> would be mounted as <literal>/test-mnt</literal>
and <literal>/data</literal> would be mounted as <literal>/data</literal>.
<literal>extraBindMounts</literal> array argument to
<function>buildFHSUserEnv</function> function is prepended to this variable.
Latter entries take priority if defined several times -- i.e. in case of
<literal>/data=data1:/data=data2</literal> the actual bind path would be
<literal>/data2</literal>.
</para>
<para>
One can create a simple environment using a <literal>shell.nix</literal>
like that:
</para>
<programlisting><![CDATA[
{ pkgs ? import <nixpkgs> {} }:
(pkgs.buildFHSUserEnv {
name = "simple-x11-env";
targetPkgs = pkgs: (with pkgs;
[ udev
alsaLib
]) ++ (with pkgs.xorg;
[ libX11
libXcursor
libXrandr
]);
multiPkgs = pkgs: (with pkgs;
[ udev
alsaLib
]) ++ (with [];
runScript = "bash";
}).env
]]></programlisting>
<para>
Running <literal>nix-shell</literal> would then drop you into a shell with
these libraries and binaries available. You can use this to run
closed-source applications which expect FHS structure without hassles:
simply change <literal>runScript</literal> to the application path,
e.g. <filename>./bin/start.sh</filename> -- relative paths are supported.
</para>
</section>
</chapter>

View File

@@ -1,719 +0,0 @@
---
title: User's Guide for Haskell in Nixpkgs
author: Peter Simons
date: 2015-06-01
---
# How to install Haskell packages
Nixpkgs distributes build instructions for all Haskell packages registered on
[Hackage](http://hackage.haskell.org/), but strangely enough normal Nix package
lookups don't seem to discover any of them, except for the default version of ghc, cabal-install, and stack:
$ nix-env -i alex
error: selector alex matches no derivations
$ nix-env -qa ghc
ghc-7.10.2
The Haskell package set is not registered in the top-level namespace because it
is *huge*. If all Haskell packages were visible to these commands, then
name-based search/install operations would be much slower than they are now. We
avoided that by keeping all Haskell-related packages in a separate attribute
set called `haskellPackages`, which the following command will list:
$ nix-env -f "<nixpkgs>" -qaP -A haskellPackages
haskellPackages.a50 a50-0.5
haskellPackages.abacate haskell-abacate-0.0.0.0
haskellPackages.abcBridge haskell-abcBridge-0.12
haskellPackages.afv afv-0.1.1
haskellPackages.alex alex-3.1.4
haskellPackages.Allure Allure-0.4.101.1
haskellPackages.alms alms-0.6.7
[... some 8000 entries omitted ...]
To install any of those packages into your profile, refer to them by their
attribute path (first column):
$ nix-env -f "<nixpkgs>" -iA haskellPackages.Allure ...
The attribute path of any Haskell packages corresponds to the name of that
particular package on Hackage: the package `cabal-install` has the attribute
`haskellPackages.cabal-install`, and so on. (Actually, this convention causes
trouble with packages like `3dmodels` and `4Blocks`, because these names are
invalid identifiers in the Nix language. The issue of how to deal with these
rare corner cases is currently unresolved.)
Haskell packages who's Nix name (second column) begins with a `haskell-` prefix
are packages that provide a library whereas packages without that prefix
provide just executables. Libraries may provide executables too, though: the
package `haskell-pandoc`, for example, installs both a library and an
application. You can install and use Haskell executables just like any other
program in Nixpkgs, but using Haskell libraries for development is a bit
trickier and we'll address that subject in great detail in section [How to
create a development environment].
Attribute paths are deterministic inside of Nixpkgs, but the path necessary to
reach Nixpkgs varies from system to system. We dodged that problem by giving
`nix-env` an explicit `-f "<nixpkgs>"` parameter, but if you call `nix-env`
without that flag, then chances are the invocation fails:
$ nix-env -iA haskellPackages.cabal-install
error: attribute haskellPackages in selection path
haskellPackages.cabal-install not found
On NixOS, for example, Nixpkgs does *not* exist in the top-level namespace by
default. To figure out the proper attribute path, it's easiest to query for the
path of a well-known Nixpkgs package, i.e.:
$ nix-env -qaP coreutils
nixos.coreutils coreutils-8.23
If your system responds like that (most NixOS installations will), then the
attribute path to `haskellPackages` is `nixos.haskellPackages`. Thus, if you
want to use `nix-env` without giving an explicit `-f` flag, then that's the way
to do it:
$ nix-env -qaP -A nixos.haskellPackages
$ nix-env -iA nixos.haskellPackages.cabal-install
Our current default compiler is GHC 7.10.x and the `haskellPackages` set
contains packages built with that particular version. Nixpkgs contains the
latest major release of every GHC since 6.10.4, however, and there is a whole
family of package sets available that defines Hackage packages built with each
of those compilers, too:
$ nix-env -f "<nixpkgs>" -qaP -A haskell.packages.ghc6123
$ nix-env -f "<nixpkgs>" -qaP -A haskell.packages.ghc763
The name `haskellPackages` is really just a synonym for
`haskell.packages.ghc7102`, because we prefer that package set internally and
recommend it to our users as their default choice, but ultimately you are free
to compile your Haskell packages with any GHC version you please. The following
command displays the complete list of available compilers:
$ nix-env -f "<nixpkgs>" -qaP -A haskell.compiler
haskell.compiler.ghc6104 ghc-6.10.4
haskell.compiler.ghc6123 ghc-6.12.3
haskell.compiler.ghc704 ghc-7.0.4
haskell.compiler.ghc722 ghc-7.2.2
haskell.compiler.ghc742 ghc-7.4.2
haskell.compiler.ghc763 ghc-7.6.3
haskell.compiler.ghc784 ghc-7.8.4
haskell.compiler.ghc7102 ghc-7.10.2
haskell.compiler.ghcHEAD ghc-7.11.20150402
haskell.compiler.ghcNokinds ghc-nokinds-7.11.20150704
haskell.compiler.ghcjs ghcjs-0.1.0
haskell.compiler.jhc jhc-0.8.2
haskell.compiler.uhc uhc-1.1.9.0
We have no package sets for `jhc` or `uhc` yet, unfortunately, but for every
version of GHC listed above, there exists a package set based on that compiler.
Also, the attributes `haskell.compiler.ghcXYC` and
`haskell.packages.ghcXYC.ghc` are synonymous for the sake of convenience.
# How to create a development environment
## How to install a compiler
A simple development environment consists of a Haskell compiler and the tool
`cabal-install`, and we saw in section [How to install Haskell packages] how
you can install those programs into your user profile:
$ nix-env -f "<nixpkgs>" -iA haskellPackages.ghc haskellPackages.cabal-install
Instead of the default package set `haskellPackages`, you can also use the more
precise name `haskell.compiler.ghc7102`, which has the advantage that it refers
to the same GHC version regardless of what Nixpkgs considers "default" at any
given time.
Once you've made those tools available in `$PATH`, it's possible to build
Hackage packages the same way people without access to Nix do it all the time:
$ cabal get lens-4.11 && cd lens-4.11
$ cabal install -j --dependencies-only
$ cabal configure
$ cabal build
If you enjoy working with Cabal sandboxes, then that's entirely possible too:
just execute the command
$ cabal sandbox init
before installing the required dependencies.
The `nix-shell` utility makes it easy to switch to a different compiler
version; just enter the Nix shell environment with the command
$ nix-shell -p haskell.compiler.ghc784
to bring GHC 7.8.4 into `$PATH`. Re-running `cabal configure` switches your
build to use that compiler instead. If you're working on a project that doesn't
depend on any additional system libraries outside of GHC, then it's sufficient
even to run the `cabal configure` command inside of the shell:
$ nix-shell -p haskell.compiler.ghc784 --command "cabal configure"
Afterwards, all other commands like `cabal build` work just fine in any shell
environment, because the configure phase recorded the absolute paths to all
required tools like GHC in its build configuration inside of the `dist/`
directory. Please note, however, that `nix-collect-garbage` can break such an
environment because the Nix store paths created by `nix-shell` aren't "alive"
anymore once `nix-shell` has terminated. If you find that your Haskell builds
no longer work after garbage collection, then you'll have to re-run `cabal
configure` inside of a new `nix-shell` environment.
## How to install a compiler with libraries
GHC expects to find all installed libraries inside of its own `lib` directory.
This approach works fine on traditional Unix systems, but it doesn't work for
Nix, because GHC's store path is immutable once it's built. We cannot install
additional libraries into that location. As a consequence, our copies of GHC
don't know any packages except their own core libraries, like `base`,
`containers`, `Cabal`, etc.
We can register additional libraries to GHC, however, using a special build
function called `ghcWithPackages`. That function expects one argument: a
function that maps from an attribute set of Haskell packages to a list of
packages, which determines the libraries known to that particular version of
GHC. For example, the Nix expression `ghcWithPackages (pkgs: [pkgs.mtl])`
generates a copy of GHC that has the `mtl` library registered in addition to
its normal core packages:
$ nix-shell -p "haskellPackages.ghcWithPackages (pkgs: [pkgs.mtl])"
[nix-shell:~]$ ghc-pkg list mtl
/nix/store/zy79...-ghc-7.10.2/lib/ghc-7.10.2/package.conf.d:
mtl-2.2.1
This function allows users to define their own development environment by means
of an override. After adding the following snippet to `~/.nixpkgs/config.nix`,
{
packageOverrides = super: let self = super.pkgs; in
{
myHaskellEnv = self.haskell.packages.ghc7102.ghcWithPackages
(haskellPackages: with haskellPackages; [
# libraries
arrows async cgi criterion
# tools
cabal-install haskintex
]);
};
}
it's possible to install that compiler with `nix-env -f "<nixpkgs>" -iA
myHaskellEnv`. If you'd like to switch that development environment to a
different version of GHC, just replace the `ghc7102` bit in the previous
definition with the appropriate name. Of course, it's also possible to define
any number of these development environments! (You can't install two of them
into the same profile at the same time, though, because that would result in
file conflicts.)
The generated `ghc` program is a wrapper script that re-directs the real
GHC executable to use a new `lib` directory --- one that we specifically
constructed to contain all those packages the user requested:
$ cat $(type -p ghc)
#! /nix/store/xlxj...-bash-4.3-p33/bin/bash -e
export NIX_GHC=/nix/store/19sm...-ghc-7.10.2/bin/ghc
export NIX_GHCPKG=/nix/store/19sm...-ghc-7.10.2/bin/ghc-pkg
export NIX_GHC_DOCDIR=/nix/store/19sm...-ghc-7.10.2/share/doc/ghc/html
export NIX_GHC_LIBDIR=/nix/store/19sm...-ghc-7.10.2/lib/ghc-7.10.2
exec /nix/store/j50p...-ghc-7.10.2/bin/ghc "-B$NIX_GHC_LIBDIR" "$@"
The variables `$NIX_GHC`, `$NIX_GHCPKG`, etc. point to the *new* store path
`ghcWithPackages` constructed specifically for this environment. The last line
of the wrapper script then executes the real `ghc`, but passes the path to the
new `lib` directory using GHC's `-B` flag.
The purpose of those environment variables is to work around an impurity in the
popular [ghc-paths](http://hackage.haskell.org/package/ghc-paths) library. That
library promises to give its users access to GHC's installation paths. Only,
the library can't possible know that path when it's compiled, because the path
GHC considers its own is determined only much later, when the user configures
it through `ghcWithPackages`. So we [patched
ghc-paths](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/ghc-paths-nix.patch)
to return the paths found in those environment variables at run-time rather
than trying to guess them at compile-time.
To make sure that mechanism works properly all the time, we recommend that you
set those variables to meaningful values in your shell environment, too, i.e.
by adding the following code to your `~/.bashrc`:
if type >/dev/null 2>&1 -p ghc; then
eval "$(egrep ^export "$(type -p ghc)")"
fi
If you are certain that you'll use only one GHC environment which is located in
your user profile, then you can use the following code, too, which has the
advantage that it doesn't contain any paths from the Nix store, i.e. those
settings always remain valid even if a `nix-env -u` operation updates the GHC
environment in your profile:
if [ -e ~/.nix-profile/bin/ghc ]; then
export NIX_GHC="$HOME/.nix-profile/bin/ghc"
export NIX_GHCPKG="$HOME/.nix-profile/bin/ghc-pkg"
export NIX_GHC_DOCDIR="$HOME/.nix-profile/share/doc/ghc/html"
export NIX_GHC_LIBDIR="$HOME/.nix-profile/lib/ghc-$($NIX_GHC --numeric-version)"
fi
## How to install a compiler with libraries, hoogle and documentation indexes
If you plan to use your environment for interactive programming, not just
compiling random Haskell code, you might want to replace `ghcWithPackages` in
all the listings above with `ghcWithHoogle`.
This environment generator not only produces an environment with GHC and all
the specified libraries, but also generates a `hoogle` and `haddock` indexes
for all the packages, and provides a wrapper script around `hoogle` binary that
uses all those things. A precise name for this thing would be
"`ghcWithPackagesAndHoogleAndDocumentationIndexes`", which is, regrettably, too
long and scary.
For example, installing the following environment
{
packageOverrides = super: let self = super.pkgs; in
{
myHaskellEnv = self.haskellPackages.ghcWithHoogle
(haskellPackages: with haskellPackages; [
# libraries
arrows async cgi criterion
# tools
cabal-install haskintex
]);
};
}
allows one to browse module documentation index [not too dissimilar to
this](https://downloads.haskell.org/~ghc/latest/docs/html/libraries/index.html)
for all the specified packages and their dependencies by directing a browser of
choice to `~/.nix-profiles/share/doc/hoogle/index.html` (or
`/run/current-system/sw/share/doc/hoogle/index.html` in case you put it in
`environment.systemPackages` in NixOS).
After you've marveled enough at that try adding the following to your
`~/.ghc/ghci.conf`
:def hoogle \s -> return $ ":! hoogle search -cl --count=15 \"" ++ s ++ "\""
:def doc \s -> return $ ":! hoogle search -cl --info \"" ++ s ++ "\""
and test it by typing into `ghci`:
:hoogle a -> a
:doc a -> a
Be sure to note the links to `haddock` files in the output. With any modern and
properly configured terminal emulator you can just click those links to
navigate there.
Finally, you can run
hoogle server -p 8080
and navigate to http://localhost:8080/ for your own local
[Hoogle](https://www.haskell.org/hoogle/). Note, however, that Firefox and
possibly other browsers disallow navigation from `http:` to `file:` URIs for
security reasons, which might be quite an inconvenience. See [this
page](http://kb.mozillazine.org/Links_to_local_pages_do_not_work) for
workarounds.
## How to create ad hoc environments for `nix-shell`
The easiest way to create an ad hoc development environment is to run
`nix-shell` with the appropriate GHC environment given on the command-line:
nix-shell -p "haskellPackages.ghcWithPackages (pkgs: with pkgs; [mtl pandoc])"
For more sophisticated use-cases, however, it's more convenient to save the
desired configuration in a file called `shell.nix` that looks like this:
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7102" }:
let
inherit (nixpkgs) pkgs;
ghc = pkgs.haskell.packages.${compiler}.ghcWithPackages (ps: with ps; [
monad-par mtl
]);
in
pkgs.stdenv.mkDerivation {
name = "my-haskell-env-0";
buildInputs = [ ghc ];
shellHook = "eval $(egrep ^export ${ghc}/bin/ghc)";
}
Now run `nix-shell` --- or even `nix-shell --pure` --- to enter a shell
environment that has the appropriate compiler in `$PATH`. If you use `--pure`,
then add all other packages that your development environment needs into the
`buildInputs` attribute. If you'd like to switch to a different compiler
version, then pass an appropriate `compiler` argument to the expression, i.e.
`nix-shell --argstr compiler ghc784`.
If you need such an environment because you'd like to compile a Hackage package
outside of Nix --- i.e. because you're hacking on the latest version from Git
---, then the package set provides suitable nix-shell environments for you
already! Every Haskell package has an `env` attribute that provides a shell
environment suitable for compiling that particular package. If you'd like to
hack the `lens` library, for example, then you just have to check out the
source code and enter the appropriate environment:
$ cabal get lens-4.11 && cd lens-4.11
Downloading lens-4.11...
Unpacking to lens-4.11/
$ nix-shell "<nixpkgs>" -A haskellPackages.lens.env
[nix-shell:/tmp/lens-4.11]$
At point, you can run `cabal configure`, `cabal build`, and all the other
development commands. Note that you need `cabal-install` installed in your
`$PATH` already to use it here --- the `nix-shell` environment does not provide
it.
# How to create Nix builds for your own private Haskell packages
If your own Haskell packages have build instructions for Cabal, then you can
convert those automatically into build instructions for Nix using the
`cabal2nix` utility, which you can install into your profile by running
`nix-env -i cabal2nix`.
## How to build a stand-alone project
For example, let's assume that you're working on a private project called
`foo`. To generate a Nix build expression for it, change into the project's
top-level directory and run the command:
$ cabal2nix . >foo.nix
Then write the following snippet into a file called `default.nix`:
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7102" }:
nixpkgs.pkgs.haskell.packages.${compiler}.callPackage ./foo.nix { }
Finally, store the following code in a file called `shell.nix`:
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7102" }:
(import ./default.nix { inherit nixpkgs compiler; }).env
At this point, you can run `nix-build` to have Nix compile your project and
install it into a Nix store path. The local directory will contain a symlink
called `result` after `nix-build` returns that points into that location. Of
course, passing the flag `--argstr compiler ghc763` allows switching the build
to any version of GHC currently supported.
Furthermore, you can call `nix-shell` to enter an interactive development
environment in which you can use `cabal configure` and `cabal build` to develop
your code. That environment will automatically contain a proper GHC derivation
with all the required libraries registered as well as all the system-level
libraries your package might need.
If your package does not depend on any system-level libraries, then it's
sufficient to run
$ nix-shell --command "cabal configure"
once to set up your build. `cabal-install` determines the absolute paths to all
resources required for the build and writes them into a config file in the
`dist/` directory. Once that's done, you can run `cabal build` and any other
command for that project even outside of the `nix-shell` environment. This
feature is particularly nice for those of us who like to edit their code with
an IDE, like Emacs' `haskell-mode`, because it's not necessary to start Emacs
inside of nix-shell just to make it find out the necessary settings for
building the project; `cabal-install` has already done that for us.
If you want to do some quick-and-dirty hacking and don't want to bother setting
up a `default.nix` and `shell.nix` file manually, then you can use the
`--shell` flag offered by `cabal2nix` to have it generate a stand-alone
`nix-shell` environment for you. With that feature, running
$ cabal2nix --shell . >shell.nix
$ nix-shell --command "cabal configure"
is usually enough to set up a build environment for any given Haskell package.
You can even use that generated file to run `nix-build`, too:
$ nix-build shell.nix
## How to build projects that depend on each other
If you have multiple private Haskell packages that depend on each other, then
you'll have to register those packages in the Nixpkgs set to make them visible
for the dependency resolution performed by `callPackage`. First of all, change
into each of your projects top-level directories and generate a `default.nix`
file with `cabal2nix`:
$ cd ~/src/foo && cabal2nix . >default.nix
$ cd ~/src/bar && cabal2nix . >default.nix
Then edit your `~/.nixpkgs/config.nix` file to register those builds in the
default Haskell package set:
{
packageOverrides = super: let self = super.pkgs; in
{
haskellPackages = super.haskellPackages.override {
overrides = self: super: {
foo = self.callPackage ../src/foo {};
bar = self.callPackage ../src/bar {};
};
};
};
}
Once that's accomplished, `nix-env -f "<nixpkgs>" -qA haskellPackages` will
show your packages like any other package from Hackage, and you can build them
$ nix-build "<nixpkgs>" -A haskellPackages.foo
or enter an interactive shell environment suitable for building them:
$ nix-shell "<nixpkgs>" -A haskellPackages.bar.env
# Miscellaneous Topics
## How to build with profiling enabled
Every Haskell package set takes a function called `overrides` that you can use
to manipulate the package as much as you please. One useful application of this
feature is to replace the default `mkDerivation` function with one that enables
library profiling for all packages. To accomplish that, add configure the
following snippet in your `~/.nixpkgs/config.nix` file:
{
packageOverrides = super: let self = super.pkgs; in
{
profiledHaskellPackages = self.haskellPackages.override {
overrides = self: super: {
mkDerivation = args: super.mkDerivation (args // {
enableLibraryProfiling = true;
});
};
};
};
}
Then, replace instances of `haskellPackages` in the `cabal2nix`-generated
`default.nix` or `shell.nix` files with `profiledHaskellPackages`.
## How to override package versions in a compiler-specific package set
Nixpkgs provides the latest version of
[`ghc-events`](http://hackage.haskell.org/package/ghc-events), which is 0.4.4.0
at the time of this writing. This is fine for users of GHC 7.10.x, but GHC
7.8.4 cannot compile that binary. Now, one way to solve that problem is to
register an older version of `ghc-events` in the 7.8.x-specific package set.
The first step is to generate Nix build instructions with `cabal2nix`:
$ cabal2nix cabal://ghc-events-0.4.3.0 >~/.nixpkgs/ghc-events-0.4.3.0.nix
Then add the override in `~/.nixpkgs/config.nix`:
{
packageOverrides = super: let self = super.pkgs; in
{
haskell = super.haskell // {
packages = super.haskell.packages // {
ghc784 = super.haskell.packages.ghc784.override {
overrides = self: super: {
ghc-events = self.callPackage ./ghc-events-0.4.3.0.nix {};
};
};
};
};
};
}
This code is a little crazy, no doubt, but it's necessary because the intuitive
version
haskell.packages.ghc784 = super.haskell.packages.ghc784.override {
overrides = self: super: {
ghc-events = self.callPackage ./ghc-events-0.4.3.0.nix {};
};
};
doesn't do what we want it to: that code replaces the `haskell` package set in
Nixpkgs with one that contains only one entry,`packages`, which contains only
one entry `ghc784`. This override loses the `haskell.compiler` set, and it
loses the `haskell.packages.ghcXYZ` sets for all compilers but GHC 7.8.4. To
avoid that problem, we have to perform the convoluted little dance from above,
iterating over each step in hierarchy.
Once it's accomplished, however, we can install a variant of `ghc-events`
that's compiled with GHC 7.8.4:
nix-env -f "<nixpkgs>" -iA haskell.packages.ghc784.ghc-events
Unfortunately, it turns out that this build fails again while executing the
test suite! Apparently, the release archive on Hackage is missing some data
files that the test suite requires, so we cannot run it. We accomplish that by
re-generating the Nix expression with the `--no-check` flag:
$ cabal2nix --no-check cabal://ghc-events-0.4.3.0 >~/.nixpkgs/ghc-events-0.4.3.0.nix
Now the builds succeeds.
Of course, in the concrete example of `ghc-events` this whole exercise is not
an ideal solution, because `ghc-events` can analyze the output emitted by any
version of GHC later than 6.12 regardless of the compiler version that was used
to build the `ghc-events' executable, so strictly speaking there's no reason to
prefer one built with GHC 7.8.x in the first place. However, for users who
cannot use GHC 7.10.x at all for some reason, the approach of downgrading to an
older version might be useful.
## How to recover from GHC's infamous non-deterministic library ID bug
GHC and distributed build farms don't get along well:
https://ghc.haskell.org/trac/ghc/ticket/4012
When you see an error like this one
package foo-0.7.1.0 is broken due to missing package
text-1.2.0.4-98506efb1b9ada233bb5c2b2db516d91
then you have to download and re-install `foo` and all its dependents from
scratch:
# nix-store -q --referrers /nix/store/*-haskell-text-1.2.0.4 \
| xargs -L 1 nix-store --repair-path --option binary-caches http://hydra.nixos.org
If you're using additional Hydra servers other than `hydra.nixos.org`, then it
might be necessary to purge the local caches that store data from those
machines to disable these binary channels for the duration of the previous
command, i.e. by running:
rm /nix/var/nix/binary-cache-v3.sqlite
rm /nix/var/nix/manifests/*
rm /nix/var/nix/channel-cache/*
## Builds on Darwin fail with `math.h` not found
Users of GHC on Darwin have occasionally reported that builds fail, because the
compiler complains about a missing include file:
fatal error: 'math.h' file not found
The issue has been discussed at length in [ticket
6390](https://github.com/NixOS/nixpkgs/issues/6390), and so far no good
solution has been proposed. As a work-around, users who run into this problem
can configure the environment variables
export NIX_CFLAGS_COMPILE="-idirafter /usr/include"
export NIX_CFLAGS_LINK="-L/usr/lib"
in their `~/.bashrc` file to avoid the compiler error.
## Using Stack together with Nix
-- While building package zlib-0.5.4.2 using:
runhaskell -package=Cabal-1.22.4.0 -clear-package-db [... lots of flags ...]
Process exited with code: ExitFailure 1
Logs have been written to: /home/foo/src/stack-ide/.stack-work/logs/zlib-0.5.4.2.log
Configuring zlib-0.5.4.2...
Setup.hs: Missing dependency on a foreign library:
* Missing (or bad) header file: zlib.h
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
When you run the build inside of the nix-shell environment, the system
is configured to find libz.so without any special flags -- the compiler
and linker "just know" how to find it. Consequently, Cabal won't record
any search paths for libz.so in the package description, which means
that the package works fine inside of nix-shell, but once you leave the
shell the shared object can no longer be found. That issue is by no
means specific to Stack: you'll have that problem with any other
Haskell package that's built inside of nix-shell but run outside of that
environment.
I suppose we could try to remedy the issue by wrapping `stack` or
`cabal` with a script that tries to find those kind of implicit search
paths and makes them explicit on the "cabal configure" command line. I
don't think anyone is working on that subject yet, though, because the
problem doesn't seem so bad in practice.
You can remedy that issue in several ways. First of all, run
$ nix-build --no-out-link "<nixpkgs>" -A zlib
/nix/store/alsvwzkiw4b7ip38l4nlfjijdvg3fvzn-zlib-1.2.8
to find out the store path of the system's zlib library. Now, you can
1) add that path (plus a "/lib" suffix) to your $LD_LIBRARY_PATH
environment variable to make sure your system linker finds libz.so
automatically. It's no pretty solution, but it will work.
2) As a variant of (1), you can also install any number of system
libraries into your user's profile (or some other profile) and point
$LD_LIBRARY_PATH to that profile instead, so that you don't have to
list dozens of those store paths all over the place.
3) The solution I prefer is to call stack with an appropriate
--extra-lib-dirs flag like so:
$ stack --extra-lib-dirs=/nix/store/alsvwzkiw4b7ip38l4nlfjijdvg3fvzn-zlib-1.2.8/lib build
Typically, you'll need --extra-include-dirs as well. It's possible
to add those flag to the project's "stack.yaml" or your user's
global "~/.stack/global/stack.yaml" file so that you don't have to
specify them manually every time.
The same thing applies to `cabal configure`, of course, if you're
building with `cabal-install` instead of Stack.
## Creating statically linked binaries
There are two levels of static linking. The first option is to configure the
build with the Cabal flag `--disable-executable-dynamic`. In Nix expressions,
this can be achieved by setting the attribute:
enableSharedExecutables = false;
That gives you a binary with statically linked Haskell libraries and
dynamically linked system libraries.
To link both Haskell libraries and system libraries statically, the additional
flags `--ghc-option=-optl=-static --ghc-option=-optl=-pthread` need to be used.
In Nix, this is accomplished with:
configureFlags = [ "--ghc-option=-optl=-static" "--ghc-option=-optl=-pthread" ];
It's important to realize, however, that most system libraries in Nix are built
as shared libraries only, i.e. there is just no static library available that
Cabal could link!
# Other resources
- The Youtube video [Nix Loves Haskell](https://www.youtube.com/watch?v=BsBhi_r-OeE)
provides an introduction into Haskell NG aimed at beginners. The slides are
available at http://cryp.to/nixos-meetup-3-slides.pdf and also -- in a form
ready for cut & paste -- at
https://github.com/NixOS/cabal2nix/blob/master/doc/nixos-meetup-3-slides.md.
- Another Youtube video is [Escaping Cabal Hell with Nix](https://www.youtube.com/watch?v=mQd3s57n_2Y),
which discusses the subject of Haskell development with Nix but also provides
a basic introduction to Nix as well, i.e. it's suitable for viewers with
almost no prior Nix experience.
- Oliver Charles wrote a very nice [Tutorial how to develop Haskell packages with Nix](http://wiki.ocharles.org.uk/Nix).
- The *Journey into the Haskell NG infrastructure* series of postings
describe the new Haskell infrastructure in great detail:
- [Part 1](http://lists.science.uu.nl/pipermail/nix-dev/2015-January/015591.html)
explains the differences between the old and the new code and gives
instructions how to migrate to the new setup.
- [Part 2](http://lists.science.uu.nl/pipermail/nix-dev/2015-January/015608.html)
looks in-depth at how to tweak and configure your setup by means of
overrides.
- [Part 3](http://lists.science.uu.nl/pipermail/nix-dev/2015-April/016912.html)
describes the infrastructure that keeps the Haskell package set in Nixpkgs
up-to-date.

View File

@@ -1,4 +1,3 @@
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="chap-language-support">
@@ -14,7 +13,7 @@ in Nixpkgs to easily build packages for other programming languages,
such as Perl or Haskell. These are described in this chapter.</para>
<section xml:id="sec-language-perl"><title>Perl</title>
<section xml:id="ssec-language-perl"><title>Perl</title>
<para>Nixpkgs provides a function <varname>buildPerlPackage</varname>,
a generic package builder function for any Perl package that has a
@@ -109,7 +108,7 @@ a <varname>preConfigure</varname> hook to generate a configuration
file used by <filename>Makefile.PL</filename>:
<programlisting>
{ buildPerlPackage, fetchurl, db }:
{buildPerlPackage, fetchurl, db}:
buildPerlPackage rec {
name = "BerkeleyDB-0.36";
@@ -152,7 +151,7 @@ ClassC3Componentised = buildPerlPackage rec {
</para>
<section xml:id="ssec-generation-from-CPAN"><title>Generation from CPAN</title>
<section><title>Generation from CPAN</title>
<para>Nix expressions for Perl packages can be generated (almost)
automatically from CPAN. This is done by the program
@@ -192,631 +191,49 @@ you need it.</para>
</section>
<section xml:id="sec-python"><title>Python</title>
<para>
Currently supported interpreters are <varname>python26</varname>, <varname>python27</varname>,
<varname>python32</varname>, <varname>python33</varname>, <varname>python34</varname>
and <varname>pypy</varname>.
</para>
<para>
<varname>python</varname> is an alias of <varname>python27</varname> and <varname>python3</varname> is an alias of <varname>python34</varname>.
</para>
<para>
<varname>python26</varname> and <varname>python27</varname> do not include modules that require
external dependencies (to reduce dependency bloat). Following modules need to be added as
<varname>buildInput</varname> explicitly:
</para>
<itemizedlist>
<listitem><para><varname>python.modules.bsddb</varname></para></listitem>
<listitem><para><varname>python.modules.curses</varname></para></listitem>
<listitem><para><varname>python.modules.curses_panel</varname></para></listitem>
<listitem><para><varname>python.modules.crypt</varname></para></listitem>
<listitem><para><varname>python.modules.gdbm</varname></para></listitem>
<listitem><para><varname>python.modules.sqlite3</varname></para></listitem>
<listitem><para><varname>python.modules.tkinter</varname></para></listitem>
<listitem><para><varname>python.modules.readline</varname></para></listitem>
</itemizedlist>
<para>For convenience <varname>python27Full</varname> and <varname>python26Full</varname>
are provided with all modules included.</para>
<section><title>Python</title>
<para>
Python packages that
use <link xlink:href="http://pypi.python.org/pypi/setuptools/"><literal>setuptools</literal></link> or <literal>distutils</literal>,
can be built using the <varname>buildPythonPackage</varname> function as documented below.
use <link xlink:href="http://pypi.python.org/pypi/setuptools/"><literal>setuptools</literal></link>,
which many Python packages do nowadays, can be built very simply using
the <varname>buildPythonPackage</varname> function. This function is
implemented
in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/python-modules/generic/default.nix"><filename>pkgs/development/python-modules/generic/default.nix</filename></link>
and works similarly to <varname>buildPerlPackage</varname>. (See
<xref linkend="ssec-language-perl"/> for details.)
</para>
<para>
All packages depending on any Python interpreter get appended <varname>$out/${python.libPrefix}/site-packages</varname>
to <literal>$PYTHONPATH</literal> if such directory exists.
</para>
Python packages that use <varname>buildPythonPackage</varname> are
defined
in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/python-packages.nix"><filename>pkgs/top-level/python-packages.nix</filename></link>.
Most of them are simple. For example:
<variablelist>
<title>
Useful attributes on interpreters packages:
</title>
<varlistentry>
<term><varname>libPrefix</varname></term>
<listitem><para>
Name of the folder in <literal>${python}/lib/</literal> for corresponding interpreter.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>interpreter</varname></term>
<listitem><para>
Alias for <literal>${python}/bin/${executable}.</literal>
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>buildEnv</varname></term>
<listitem><para>
Function to build python interpreter environments with extra packages bundled together.
See <xref linkend="ssec-python-build-env" /> for usage and documentation.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>sitePackages</varname></term>
<listitem><para>
Alias for <literal>lib/${libPrefix}/site-packages</literal>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>executable</varname></term>
<listitem><para>
Name of the interpreter executable, ie <literal>python3.4</literal>.
</para></listitem>
</varlistentry>
</variablelist>
<section xml:id="ssec-build-python-package"><title><varname>buildPythonPackage</varname> function</title>
<para>
The function is implemented in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/python-modules/generic/default.nix">
<filename>pkgs/development/python-modules/generic/default.nix</filename></link>.
Example usage:
<programlisting language="nix">
<programlisting>
twisted = buildPythonPackage {
name = "twisted-8.1.0";
src = pkgs.fetchurl {
src = fetchurl {
url = http://tmrc.mit.edu/mirror/twisted/Twisted/8.1/Twisted-8.1.0.tar.bz2;
sha256 = "0q25zbr4xzknaghha72mq57kh53qw1bf8csgp63pm9sfi72qhirl";
};
propagatedBuildInputs = [ self.ZopeInterface ];
propagatedBuildInputs = [ pkgs.ZopeInterface ];
meta = {
homepage = http://twistedmatrix.com/;
description = "Twisted, an event-driven networking engine written in Python";
license = stdenv.lib.licenses.mit;
license = "MIT";
};
};
</programlisting>
Most of Python packages that use <varname>buildPythonPackage</varname> are defined
in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/python-packages.nix"><filename>pkgs/top-level/python-packages.nix</filename></link>
and generated for each python interpreter separately into attribute sets <varname>python26Packages</varname>,
<varname>python27Packages</varname>, <varname>python32Packages</varname>, <varname>python33Packages</varname>,
<varname>python34Packages</varname> and <varname>pypyPackages</varname>.
</para>
<para>
<function>buildPythonPackage</function> mainly does four things:
<orderedlist>
<listitem><para>
In the <varname>configurePhase</varname>, it patches
<literal>setup.py</literal> to always include setuptools before
distutils for monkeypatching machinery to take place.
</para></listitem>
<listitem><para>
In the <varname>buildPhase</varname>, it calls
<literal>${python.interpreter} setup.py build ...</literal>
</para></listitem>
<listitem><para>
In the <varname>installPhase</varname>, it calls
<literal>${python.interpreter} setup.py install ...</literal>
</para></listitem>
<listitem><para>
In the <varname>postFixup</varname> phase, <literal>wrapPythonPrograms</literal>
bash function is called to wrap all programs in <filename>$out/bin/*</filename>
directory to include <literal>$PYTHONPATH</literal> and <literal>$PATH</literal>
environment variables.
</para></listitem>
</orderedlist>
</para>
<para>By default <varname>doCheck = true</varname> is set and tests are run with
<literal>${python.interpreter} setup.py test</literal> command in <varname>checkPhase</varname>.</para>
<para>
As in Perl, dependencies on other Python packages can be specified in the
<varname>buildInputs</varname> and
<varname>propagatedBuildInputs</varname> attributes. If something is
exclusively a build-time dependency, use
<varname>buildInputs</varname>; if its (also) a runtime dependency,
use <varname>propagatedBuildInputs</varname>.
</para>
<para>
By default <varname>meta.platforms</varname> is set to the same value
as the interpreter unless overriden otherwise.
</para>
<variablelist>
<title>
<varname>buildPythonPackage</varname> parameters
(all parameters from <varname>mkDerivation</varname> function are still supported)
</title>
<varlistentry>
<term><varname>namePrefix</varname></term>
<listitem><para>
Prepended text to <varname>${name}</varname> parameter.
Defaults to <literal>"python3.3-"</literal> for Python 3.3, etc. Set it to
<literal>""</literal>
if you're packaging an application or a command line tool.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>disabled</varname></term>
<listitem><para>
If <varname>true</varname>, package is not build for
particular python interpreter version. Grep around
<filename>pkgs/top-level/python-packages.nix</filename>
for examples.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>setupPyInstallFlags</varname></term>
<listitem><para>
List of flags passed to <command>setup.py install</command> command.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>setupPyBuildFlags</varname></term>
<listitem><para>
List of flags passed to <command>setup.py build</command> command.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>pythonPath</varname></term>
<listitem><para>
List of packages to be added into <literal>$PYTHONPATH</literal>.
Packages in <varname>pythonPath</varname> are not propagated into user environment
(contrary to <varname>propagatedBuildInputs</varname>).
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>preShellHook</varname></term>
<listitem><para>
Hook to execute commands before <varname>shellHook</varname>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>postShellHook</varname></term>
<listitem><para>
Hook to execute commands after <varname>shellHook</varname>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>distutilsExtraCfg</varname></term>
<listitem><para>
Extra lines passed to <varname>[easy_install]</varname> section of
<filename>distutils.cfg</filename> (acts as global setup.cfg
configuration).
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>makeWrapperArgs</varname></term>
<listitem><para>
A list of strings. Arguments to be passed to
<varname>makeWrapper</varname>, which wraps generated binaries. By
default, the arguments to <varname>makeWrapper</varname> set
<varname>PATH</varname> and <varname>PYTHONPATH</varname> environment
variables before calling the binary. Additional arguments here can
allow a developer to set environment variables which will be
available when the binary is run. For example,
<varname>makeWrapperArgs = ["--set FOO BAR" "--set BAZ QUX"]</varname>.
</para></listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="ssec-python-build-env"><title><function>python.buildEnv</function> function</title>
<para>
Create Python environments using low-level <function>pkgs.buildEnv</function> function. Example <filename>default.nix</filename>:
<programlisting language="nix">
<![CDATA[with import <nixpkgs> {};
python.buildEnv.override {
extraLibs = [ pkgs.pythonPackages.pyramid ];
ignoreCollisions = true;
}]]>
</programlisting>
Running <command>nix-build</command> will create
<filename>/nix/store/cf1xhjwzmdki7fasgr4kz6di72ykicl5-python-2.7.8-env</filename>
with wrapped binaries in <filename>bin/</filename>.
</para>
<para>
You can also use <varname>env</varname> attribute to create local
environments with needed packages installed (somewhat comparable to
<literal>virtualenv</literal>). For example, with the following
<filename>shell.nix</filename>:
<programlisting language="nix">
<![CDATA[with import <nixpkgs> {};
(python3.buildEnv.override {
extraLibs = with python3Packages;
[ numpy
requests
];
}).env]]>
</programlisting>
Running <command>nix-shell</command> will drop you into a shell where
<command>python</command> will have specified packages in its path.
</para>
<variablelist>
<title>
<function>python.buildEnv</function> arguments
</title>
<varlistentry>
<term><varname>extraLibs</varname></term>
<listitem><para>
List of packages installed inside the environment.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>postBuild</varname></term>
<listitem><para>
Shell command executed after the build of environment.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ignoreCollisions</varname></term>
<listitem><para>
Ignore file collisions inside the environment (default is <varname>false</varname>).
</para></listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="ssec-python-tools"><title>Tools</title>
<para>Packages inside nixpkgs are written by hand. However many tools
exist in community to help save time. No tool is preferred at the moment.
</para>
<itemizedlist>
<listitem><para>
<link xlink:href="https://github.com/proger/python2nix">python2nix</link>
by Vladimir Kirillov
</para></listitem>
<listitem><para>
<link xlink:href="https://github.com/garbas/pypi2nix">pypi2nix</link>
by Rok Garbas
</para></listitem>
<listitem><para>
<link xlink:href="https://github.com/offlinehacker/pypi2nix">pypi2nix</link>
by Jaka Hudoklin
</para></listitem>
</itemizedlist>
</section>
<section xml:id="ssec-python-development"><title>Development</title>
<para>
To develop Python packages <function>buildPythonPackage</function> has
additional logic inside <varname>shellPhase</varname> to run
<command>${python.interpreter} setup.py develop</command> for the package.
</para>
<warning><para><varname>shellPhase</varname> is executed only if <filename>setup.py</filename>
exists.</para></warning>
<para>
Given a <filename>default.nix</filename>:
<programlisting language="nix">
<![CDATA[with import <nixpkgs> {};
buildPythonPackage {
name = "myproject";
buildInputs = with pkgs.pythonPackages; [ pyramid ];
src = ./.;
}]]>
</programlisting>
Running <command>nix-shell</command> with no arguments should give you
the environment in which the package would be build with
<command>nix-build</command>.
</para>
<para>
Shortcut to setup environments with C headers/libraries and python packages:
<programlisting language="bash">$ nix-shell -p pythonPackages.pyramid zlib libjpeg git</programlisting>
</para>
<note><para>
There is a boolean value <varname>lib.inNixShell</varname> set to
<varname>true</varname> if nix-shell is invoked.
</para></note>
</section>
<section xml:id="ssec-python-faq"><title>FAQ</title>
<variablelist>
<varlistentry>
<term>How to solve circular dependencies?</term>
<listitem><para>
If you have packages <varname>A</varname> and <varname>B</varname> that
depend on each other, when packaging <varname>B</varname> override package
<varname>A</varname> not to depend on <varname>B</varname> as input
(and also the other way around).
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>install_data / data_files</varname> problems resulting into <literal>error: could not create '/nix/store/6l1bvljpy8gazlsw2aw9skwwp4pmvyxw-python-2.7.8/etc': Permission denied</literal></term>
<listitem><para>
<link xlink:href="https://bitbucket.org/pypa/setuptools/issue/130/install_data-doesnt-respect-prefix">
Known bug in setuptools <varname>install_data</varname> does not respect --prefix</link>. Example of
such package using the feature is <filename>pkgs/tools/X11/xpra/default.nix</filename>. As workaround
install it as an extra <varname>preInstall</varname> step:
<programlisting>${python.interpreter} setup.py install_data --install-dir=$out --root=$out
sed -i '/ = data_files/d' setup.py</programlisting>
</para></listitem>
</varlistentry>
<varlistentry>
<term>Rationale of non-existent global site-packages</term>
<listitem><para>
There is no need to have global site-packages in Nix. Each package has isolated
dependency tree and installing any python package will only populate <varname>$PATH</varname>
inside user environment. See <xref linkend="ssec-python-build-env" /> to create self-contained
interpreter with a set of packages.
</para></listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="ssec-python-contrib"><title>Contributing guidelines</title>
<para>
Following rules are desired to be respected:
</para>
<itemizedlist>
<listitem><para>
Make sure package builds for all python interpreters. Use <varname>disabled</varname> argument to
<function>buildPythonPackage</function> to set unsupported interpreters.
</para></listitem>
<listitem><para>
If tests need to be disabled for a package, make sure you leave a comment about reasoning.
</para></listitem>
<listitem><para>
Packages in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/python-packages.nix"><filename>pkgs/top-level/python-packages.nix</filename></link>
are sorted quasi-alphabetically to avoid merge conflicts.
</para></listitem>
</itemizedlist>
</section>
</section>
<section xml:id="sec-language-ruby"><title>Ruby</title>
<para>There currently is support to bundle applications that are packaged as Ruby gems. The utility "bundix" allows you to write a <filename>Gemfile</filename>, let bundler create a <filename>Gemfile.lock</filename>, and then convert
this into a nix expression that contains all Gem dependencies automatically.</para>
<para>For example, to package sensu, we did:</para>
<screen>
<![CDATA[$ cd pkgs/servers/monitoring
$ mkdir sensu
$ cat > Gemfile
source 'https://rubygems.org'
gem 'sensu'
$ bundler package --path /tmp/vendor/bundle
$ $(nix-build '<nixpkgs>' -A bundix)/bin/bundix
$ cat > default.nix
{ lib, bundlerEnv, ruby }:
bundlerEnv {
name = "sensu-0.17.1";
inherit ruby;
gemfile = ./Gemfile;
lockfile = ./Gemfile.lock;
gemset = ./gemset.nix;
meta = with lib; {
description = "A monitoring framework that aims to be simple, malleable,
and scalable.";
homepage = http://sensuapp.org/;
license = with licenses; mit;
maintainers = with maintainers; [ theuni ];
platforms = platforms.unix;
};
}]]>
</screen>
<para>Please check in the <filename>Gemfile</filename>, <filename>Gemfile.lock</filename> and the <filename>gemset.nix</filename> so future updates can be run easily.
</programlisting>
</para>
</section>
<section xml:id="sec-language-go"><title>Go</title>
<para>The function <varname>buildGoPackage</varname> builds
standard Go packages.
</para>
<example xml:id='ex-buildGoPackage'><title>buildGoPackage</title>
<programlisting>
net = buildGoPackage rec {
name = "go.net-${rev}";
goPackagePath = "golang.org/x/net"; <co xml:id='ex-buildGoPackage-1' />
subPackages = [ "ipv4" "ipv6" ]; <co xml:id='ex-buildGoPackage-2' />
rev = "e0403b4e005";
src = fetchFromGitHub {
inherit rev;
owner = "golang";
repo = "net";
sha256 = "1g7cjzw4g4301a3yqpbk8n1d4s97sfby2aysl275x04g0zh8jxqp";
};
goPackageAliases = [ "code.google.com/p/go.net" ]; <co xml:id='ex-buildGoPackage-3' />
propagatedBuildInputs = [ goPackages.text ]; <co xml:id='ex-buildGoPackage-4' />
buildFlags = "--tags release"; <co xml:id='ex-buildGoPackage-5' />
disabled = isGo13;<co xml:id='ex-buildGoPackage-6' />
};
</programlisting>
</example>
<para><xref linkend='ex-buildGoPackage'/> is an example expression using buildGoPackage,
the following arguments are of special significance to the function:
<calloutlist>
<callout arearefs='ex-buildGoPackage-1'>
<para>
<varname>goPackagePath</varname> specifies the package's canonical Go import path.
</para>
</callout>
<callout arearefs='ex-buildGoPackage-2'>
<para>
<varname>subPackages</varname> limits the builder from building child packages that
have not been listed. If <varname>subPackages</varname> is not specified, all child
packages will be built.
</para>
<para>
In this example only <literal>code.google.com/p/go.net/ipv4</literal> and
<literal>code.google.com/p/go.net/ipv4</literal> will be built.
</para>
</callout>
<callout arearefs='ex-buildGoPackage-3'>
<para>
<varname>goPackageAliases</varname> is a list of alternative import paths
that are valid for this library.
Packages that depend on this library will automatically rename
import paths that match any of the aliases to <literal>goPackagePath</literal>.
</para>
<para>
In this example imports will be renamed from
<literal>code.google.com/p/go.net</literal> to
<literal>golang.org/x/net</literal> in every package that depend on the
<literal>go.net</literal> library.
</para>
</callout>
<callout arearefs='ex-buildGoPackage-4'>
<para>
<varname>propagatedBuildInputs</varname> is where the dependencies of a Go library are
listed. Only libraries should list <varname>propagatedBuildInputs</varname>. If a standalone
program is being build instead, use <varname>buildInputs</varname>. If a library's tests require
additional dependencies that are not propagated, they should be listed in <varname>buildInputs</varname>.
</para>
</callout>
<callout arearefs='ex-buildGoPackage-5'>
<para>
<varname>buildFlags</varname> is a list of flags passed to the go build command.
</para>
</callout>
<callout arearefs='ex-buildGoPackage-6'>
<para>
If <varname>disabled</varname> is <literal>true</literal>,
nix will refuse to build this package.
</para>
<para>
In this example the package will not be built for go 1.3. The <literal>isGo13</literal>
is an utility function that returns <literal>true</literal> if go used to build the
package has version 1.3.x.
</para>
</callout>
</calloutlist>
</para>
<para>
Reusable Go libraries may be found in the <varname>goPackages</varname> set. You can test
build a Go package as follows:
<screen>
$ nix-build -A goPackages.net
</screen>
</para>
<para>
You may use Go packages installed into the active Nix profiles by adding
the following to your ~/.bashrc:
<screen>
for p in $NIX_PROFILES; do
GOPATH="$p/share/go:$GOPATH"
done
</screen>
</para>
<para>To extract dependency information from a Go package in automated way use <link xlink:href="https://github.com/cstrahan/go2nix">go2nix</link>.</para>
</section>
<section xml:id="sec-language-java"><title>Java</title>
<section xml:id="ssec-language-java"><title>Java</title>
<para>Ant-based Java packages are typically built from source as follows:
@@ -897,156 +314,6 @@ Runtime) instead of the OpenJRE.</para>
</section>
<section xml:id="sec-language-lua"><title>Lua</title>
<para>
Lua packages are built by the <varname>buildLuaPackage</varname> function. This function is
implemented
in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/lua-modules/generic/default.nix">
<filename>pkgs/development/lua-modules/generic/default.nix</filename></link>
and works similarly to <varname>buildPerlPackage</varname>. (See
<xref linkend="sec-language-perl"/> for details.)
</para>
<para>
Lua packages are defined
in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/lua-packages.nix"><filename>pkgs/top-level/lua-packages.nix</filename></link>.
Most of them are simple. For example:
<programlisting>
fileSystem = buildLuaPackage {
name = "filesystem-1.6.2";
src = fetchurl {
url = "https://github.com/keplerproject/luafilesystem/archive/v1_6_2.tar.gz";
sha256 = "1n8qdwa20ypbrny99vhkmx8q04zd2jjycdb5196xdhgvqzk10abz";
};
meta = {
homepage = "https://github.com/keplerproject/luafilesystem";
hydraPlatforms = stdenv.lib.platforms.linux;
maintainers = with maintainers; [ flosse ];
};
};
</programlisting>
</para>
<para>
Though, more complicated package should be placed in a seperate file in
<link
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/lua-modules"><filename>pkgs/development/lua-modules</filename></link>.
</para>
<para>
Lua packages accept additional parameter <varname>disabled</varname>, which defines
the condition of disabling package from luaPackages. For example, if package has
<varname>disabled</varname> assigned to <literal>lua.luaversion != "5.1"</literal>,
it will not be included in any luaPackages except lua51Packages, making it
only be built for lua 5.1.
</para>
</section>
<section xml:id="sec-language-coq"><title>Coq</title>
<para>
Coq libraries should be installed in
<literal>$(out)/lib/coq/${coq.coq-version}/user-contrib/</literal>.
Such directories are automatically added to the
<literal>$COQPATH</literal> environment variable by the hook defined
in the Coq derivation.
</para>
<para>
Some libraries require OCaml and sometimes also Camlp5. The exact
versions that were used to build Coq are saved in the
<literal>coq.ocaml</literal> and <literal>coq.camlp5</literal>
attributes.
</para>
<para>
Here is a simple package example. It is a pure Coq library, thus it
only depends on Coq. Its <literal>makefile</literal> has been
generated using <literal>coq_makefile</literal> so we only have to
set the <literal>$COQLIB</literal> variable at install time.
</para>
<programlisting>
{stdenv, fetchurl, coq}:
stdenv.mkDerivation {
src = fetchurl {
url = http://coq.inria.fr/pylons/contribs/files/Karatsuba/v8.4/Karatsuba.tar.gz;
sha256 = "0ymfpv4v49k4fm63nq6gcl1hbnnxrvjjp7yzc4973n49b853c5b1";
};
name = "coq-karatsuba";
buildInputs = [ coq ];
installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/";
}
</programlisting>
</section>
<section xml:id="sec-language-qt"><title>Qt</title>
<para>The information in this section applies to Qt 5.5 and later.</para>
<para>Qt is an application development toolkit for C++. Although it is
not a distinct programming language, there are special considerations
for packaging Qt-based programs and libraries. A small set of tools
and conventions has grown out of these considerations.</para>
<section xml:id="ssec-qt-libraries"><title>Libraries</title>
<para>Packages that provide libraries should be listed in
<varname>qt5LibsFun</varname> so that the library is built with each
Qt version. A set of packages is provided for each version of Qt; for
example, <varname>qt5Libs</varname> always provides libraries built
with the latest version, <varname>qt55Libs</varname> provides
libraries built with Qt 5.5, and so on. To avoid version conflicts, no
top-level attributes are created for these packages.</para>
</section>
<section xml:id="ssec-qt-programs"><title>Programs</title>
<para>Application packages do not need to be built with every Qt
version. To ensure consistency between the package's dependencies,
call the package with <literal>qt5Libs.callPackage</literal> instead
of the usual <literal>callPackage</literal>. An older version may be
selected in case of incompatibility. For example, to build with Qt
5.5, call the package with
<literal>qt55Libs.callPackage</literal>.</para>
<para>Several environment variables must be set at runtime for Qt
applications to function correctly, including:</para>
<itemizedlist>
<listitem><para><envar>QT_PLUGIN_PATH</envar></para></listitem>
<listitem><para><envar>QML_IMPORT_PATH</envar></para></listitem>
<listitem><para><envar>QML2_IMPORT_PATH</envar></para></listitem>
<listitem><para><envar>XDG_DATA_DIRS</envar></para></listitem>
</itemizedlist>
<para>To ensure that these are set correctly, the program must be wrapped by
invoking <literal>wrapQtProgram <replaceable>program</replaceable></literal>
during installation (for example, during
<literal>fixupPhase</literal>). <literal>wrapQtProgram</literal>
accepts the same options as <literal>makeWrapper</literal>.
</para>
</section>
<section xml:id="ssec-qt-kde"><title>KDE</title>
<para>Many of the considerations above also apply to KDE packages,
especially the need to set the correct environment variables at
runtime. To ensure that this is done, invoke <literal>wrapKDEProgram
<replaceable>program</replaceable></literal> during
installation. <literal>wrapKDEProgram</literal> also generates a
<literal>ksycoca</literal> database so that required data and services
can be found. Like its Qt counterpart,
<literal>wrapKDEProgram</literal> accepts the same options as
<literal>makeWrapper</literal>.</para>
</section>
</section>
<!--
<section><title>Haskell</title>

View File

@@ -3,23 +3,36 @@
<info>
<title>Nixpkgs Contributors Guide</title>
<title>Nixpkgs Manual</title>
<subtitle>Version <xi:include href=".version" parse="text" /></subtitle>
<subtitle>Draft (Version <xi:include href="../.version"
parse="text" />)</subtitle>
<author>
<personname>
<firstname>Eelco</firstname>
<surname>Dolstra</surname>
</personname>
<affiliation>
<orgname>LogicBlox</orgname>
</affiliation>
</author>
<copyright>
<year>2008-2012</year>
<holder>Eelco Dolstra</holder>
</copyright>
</info>
<xi:include href="introduction.xml" />
<xi:include href="quick-start.xml" />
<xi:include href="stdenv.xml" />
<xi:include href="packageconfig.xml" />
<xi:include href="functions.xml" />
<xi:include href="meta.xml" />
<xi:include href="language-support.xml" />
<xi:include href="package-notes.xml" />
<xi:include href="coding-conventions.xml" />
<xi:include href="submitting-changes.xml" />
<xi:include href="haskell-users-guide.xml" />
<xi:include href="contributing.xml" />
</book>

View File

@@ -27,7 +27,7 @@ meta = {
<para>Meta-attributes are not passed to the builder of the package.
Thus, a change to a meta-attribute doesnt trigger a recompilation of
the package. The value of a meta-attribute must be a string.</para>
the package. The value of a meta-attribute must a string.</para>
<para>The meta-attributes of a package can be queried from the
command-line using <command>nix-env</command>:
@@ -61,7 +61,7 @@ $ nix-env -qa hello --meta --json
"i686-openbsd",
"x86_64-openbsd"
],
"position": "/home/user/dev/nixpkgs/pkgs/applications/misc/hello/default.nix:14"
"position": "/home/user/dev/nixpkgs/pkgs/applications/misc/hello/ex-2/default.nix:14"
},
"name": "hello-2.9",
"system": "x86_64-linux"
@@ -82,10 +82,10 @@ hello-2.3 A program that produces a familiar, friendly greeting
</para>
<section xml:id="sec-standard-meta-attributes"><title>Standard
meta-attributes</title>
<section><title>Standard meta-attributes</title>
<para>It is expected that each meta-attribute is one of the following:</para>
<para>The following meta-attributes have a standard
interpretation:</para>
<variablelist>
@@ -112,65 +112,20 @@ meta-attributes</title>
package.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>version</varname></term>
<listitem><para>Package version.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>branch</varname></term>
<listitem><para>Release branch. Used to specify that a package is not
going to receive updates that are not in this branch; for example, Linux
kernel 3.0 is supposed to be updated to 3.0.X, not 3.1.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>homepage</varname></term>
<listitem><para>The packages homepage. Example:
<literal>http://www.gnu.org/software/hello/manual/</literal></para></listitem>
</varlistentry>
<varlistentry>
<term><varname>downloadPage</varname></term>
<listitem><para>The page where a link to the current version can be found. Example:
<literal>http://ftp.gnu.org/gnu/hello/</literal></para></listitem>
</varlistentry>
<varlistentry>
<term><varname>license</varname></term>
<listitem>
<para>
The license, or licenses, for the package. One from the attribute set
defined in <link
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix">
<filename>nixpkgs/lib/licenses.nix</filename></link>. At this moment
using both a list of licenses and a single license is valid. If the
license field is in the form of a list representation, then it means
that parts of the package are licensed differently. Each license
should preferably be referenced by their attribute. The non-list
attribute value can also be a space delimited string representation of
the contained attribute shortNames or spdxIds. The following are all valid
examples:
<itemizedlist>
<listitem><para>Single license referenced by attribute (preferred)
<literal>stdenv.lib.licenses.gpl3</literal>.
</para></listitem>
<listitem><para>Single license referenced by its attribute shortName (frowned upon)
<literal>"gpl3"</literal>.
</para></listitem>
<listitem><para>Single license referenced by its attribute spdxId (frowned upon)
<literal>"GPL-3.0"</literal>.
</para></listitem>
<listitem><para>Multiple licenses referenced by attribute (preferred)
<literal>with stdenv.lib.licenses; [ asl20 free ofl ]</literal>.
</para></listitem>
<listitem><para>Multiple licenses referenced as a space delimited string of attribute shortNames (frowned upon)
<literal>"asl20 free ofl"</literal>.
</para></listitem>
</itemizedlist>
For details, see <xref linkend='sec-meta-license'/>.
</para>
</listitem>
<listitem><para>The license for the package. One from attribute set defined in
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix">
<filename>nixpkgs/lib/licenses.nix</filename></link>.
Example:
<literal>stdenv.lib.licenses.gpl3</literal>.</para></listitem>
See details in <xref linkend='sec-meta-license'/>,
</varlistentry>
<varlistentry>
@@ -240,16 +195,6 @@ meta.hydraPlatforms = [];
they are fixed.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>updateWalker</varname></term>
<listitem><para>If set to <literal>true</literal>, the package is
tested to be updated correctly by the <literal>update-walker.sh</literal>
script without additional settings. Such packages have
<varname>meta.version</varname> set and their homepage (or
the page specified by <varname>meta.downloadPage</varname>) contains
a direct link to the package tarball.</para></listitem>
</varlistentry>
</variablelist>
@@ -311,9 +256,9 @@ to indicate the specific license:
</variablelist>
</para>
</section>
</chapter>

View File

@@ -184,10 +184,10 @@ if test "$noSysDirs" = "1"; then
if test "$noSysDirs" = "1"; then
# Figure out what extra flags to pass to the gcc compilers
# being generated to make sure that they use our glibc.
if test -e $NIX_CC/nix-support/orig-glibc; then
glibc=$(cat $NIX_CC/nix-support/orig-glibc)
if test -e $NIX_GCC/nix-support/orig-glibc; then
glibc=$(cat $NIX_GCC/nix-support/orig-glibc)
# Ugh. Copied from gcc-wrapper/builder.sh. We can't just
# source in $NIX_CC/nix-support/add-flags, since that
# source in $NIX_GCC/nix-support/add-flags, since that
# would cause *this* GCC to be linked against the
# *previous* GCC. Need some more modularity there.
extraCFlags="-B$glibc/lib -isystem $glibc/include"

View File

@@ -141,7 +141,7 @@ $ make menuconfig ARCH=<replaceable>arch</replaceable></screen>
<!--============================================================-->
<section xml:id="sec-xorg">
<section>
<title>X.org</title>
@@ -219,151 +219,5 @@ you should modify
</section>
-->
<!--============================================================-->
<section xml:id="sec-eclipse">
<title>Eclipse</title>
<para>
The Nix expressions related to the Eclipse platform and IDE are in
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/eclipse"><filename>pkgs/applications/editors/eclipse</filename></link>.
</para>
<para>
Nixpkgs provides a number of packages that will install Eclipse in
its various forms, these range from the bare-bones Eclipse
Platform to the more fully featured Eclipse SDK or Scala-IDE
packages and multiple version are often available. It is possible
to list available Eclipse packages by issuing the command:
<screen>
$ nix-env -f '&lt;nixpkgs&gt;' -qaP -A eclipses --description
</screen>
Once an Eclipse variant is installed it can be run using the
<command>eclipse</command> command, as expected. From within
Eclipse it is then possible to install plugins in the usual manner
by either manually specifying an Eclipse update site or by
installing the Marketplace Client plugin and using it to discover
and install other plugins. This installation method provides an
Eclipse installation that closely resemble a manually installed
Eclipse.
</para>
<para>
If you prefer to install plugins in a more declarative manner then
Nixpkgs also offer a number of Eclipse plugins that can be
installed in an <emphasis>Eclipse environment</emphasis>. This
type of environment is created using the function
<varname>eclipseWithPlugins</varname> found inside the
<varname>nixpkgs.eclipses</varname> attribute set. This function
takes as argument <literal>{ eclipse, plugins ? [], jvmArgs ? []
}</literal> where <varname>eclipse</varname> is a one of the
Eclipse packages described above, <varname>plugins</varname> is a
list of plugin derivations, and <varname>jvmArgs</varname> is a
list of arguments given to the JVM running the Eclipse. For
example, say you wish to install the latest Eclipse Platform with
the popular Eclipse Color Theme plugin and also allow Eclipse to
use more RAM. You could then add
<screen>
packageOverrides = pkgs: {
myEclipse = with pkgs.eclipses; eclipseWithPlugins {
eclipse = eclipse-platform;
jvmArgs = [ "-Xmx2048m" ];
plugins = [ plugins.color-theme ];
};
}
</screen>
to your Nixpkgs configuration
(<filename>~/.nixpkgs/config.nix</filename>) and install it by
running <command>nix-env -f '&lt;nixpkgs&gt;' -iA
myEclipse</command> and afterward run Eclipse as usual. It is
possible to find out which plugins are available for installation
using <varname>eclipseWithPlugins</varname> by running
<screen>
$ nix-env -f '&lt;nixpkgs&gt;' -qaP -A eclipses.plugins --description
</screen>
</para>
<para>
If there is a need to install plugins that are not available in
Nixpkgs then it may be possible to define these plugins outside
Nixpkgs using the <varname>buildEclipseUpdateSite</varname> and
<varname>buildEclipsePlugin</varname> functions found in the
<varname>nixpkgs.eclipses.plugins</varname> attribute set. Use the
<varname>buildEclipseUpdateSite</varname> function to install a
plugin distributed as an Eclipse update site. This function takes
<literal>{ name, src }</literal> as argument where
<literal>src</literal> indicates the Eclipse update site archive.
All Eclipse features and plugins within the downloaded update site
will be installed. When an update site archive is not available
then the <varname>buildEclipsePlugin</varname> function can be
used to install a plugin that consists of a pair of feature and
plugin JARs. This function takes an argument <literal>{ name,
srcFeature, srcPlugin }</literal> where
<literal>srcFeature</literal> and <literal>srcPlugin</literal> are
the feature and plugin JARs, respectively.
</para>
<para>
Expanding the previous example with two plugins using the above
functions we have
<screen>
packageOverrides = pkgs: {
myEclipse = with pkgs.eclipses; eclipseWithPlugins {
eclipse = eclipse-platform;
jvmArgs = [ "-Xmx2048m" ];
plugins = [
plugins.color-theme
(plugins.buildEclipsePlugin {
name = "myplugin1-1.0";
srcFeature = fetchurl {
url = "http://…/features/myplugin1.jar";
sha256 = "123…";
};
srcPlugin = fetchurl {
url = "http://…/plugins/myplugin1.jar";
sha256 = "123…";
};
});
(plugins.buildEclipseUpdateSite {
name = "myplugin2-1.0";
src = fetchurl {
stripRoot = false;
url = "http://…/myplugin2.zip";
sha256 = "123…";
};
});
];
};
}
</screen>
</para>
</section>
<section xml:id="sec-elm">
<title>Elm</title>
<para>
The Nix expressions for Elm reside in
<filename>pkgs/development/compilers/elm</filename>. They are generated
automatically by <command>update-elm.rb</command> script. One should
specify versions of Elm packages inside the script, clear the
<filename>packages</filename> directory and run the script from inside it.
<literal>elm-reactor</literal> is special because it also has Elm package
dependencies. The process is not automated very much for now -- you should
get the <literal>elm-reactor</literal> source tree (e.g. with
<command>nix-shell</command>) and run <command>elm2nix.rb</command> inside
it. Place the resulting <filename>package.nix</filename> file into
<filename>packages/elm-reactor-elm.nix</filename>.
</para>
</section>
</chapter>

View File

@@ -1,88 +0,0 @@
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="chap-packageconfig">
<title><filename>~/.nixpkgs/config.nix</filename>: global configuration</title>
<para>
Nix packages can be configured to allow or deny certain options.
</para>
<para>
To apply the configuration edit <filename>~/.nixpkgs/config.nix</filename>
and set it like
<programlisting>{
allowUnfree = true;
}</programlisting>
and will allow the Nix package manager to install unfree licensed packages.
The configuration as listed also applies to NixOS under <option>nixpkgs.config</option> set.
</para>
<itemizedlist>
<listitem>
<para>
Allow installing of packages that are distributed under unfree license by setting
<programlisting>allowUnfree = true;</programlisting>
or deny them by setting it to <literal>false</literal>.
</para>
<para>
Same can be achieved by setting the environment variable:
<programlisting>$ export NIXPKGS_ALLOW_UNFREE=1</programlisting>
</para>
</listitem>
<listitem>
<para>
Whenever unfree packages are not allowed, single packages can
still be allowed by a predicate function that accepts package
as an argument and should return a boolean:
<programlisting>allowUnfreePredicate = (pkg: ...);</programlisting>
Example to allow flash player only:
<programlisting>allowUnfreePredicate = (pkg: pkgs.lib.hasPrefix "flashplayer-" pkg.name);</programlisting>
</para>
</listitem>
<listitem>
<para>
Whenever unfree packages are not allowed, packages can still be
whitelisted by their license:
<programlisting>whitelistedLicenses = with stdenv.lib.licenses; [ amd wtfpl ];</programlisting>
</para>
</listitem>
<listitem>
<para>
In addition to whitelisting licenses which are denied by the
<literal>allowUnfree</literal> setting, you can also explicitely
deny installation of packages which have a certain license:
<programlisting>blacklistedLicenses = with stdenv.lib.licenses; [ agpl3 gpl3 ];</programlisting>
</para>
</listitem>
</itemizedlist>
<para>
A complete list of licenses can be found in the file
<filename>lib/licenses.nix</filename> of the nix package tree.
</para>
<section xml:id="sec-modify-via-packageOverrides"><title>Modify
packages via <literal>packageOverrides</literal></title>
<para>
You can define a function called <varname>packageOverrides</varname>
in your local <filename>~/.nixpkgs/config</filename> to overide nix
packages. It must be a function that takes pkgs as an argument and
return modified set of packages.
<programlisting>{
packageOverrides = pkgs: rec {
foo = pkgs.foo.override { ... };
};
}</programlisting>
</para>
</section>
</chapter>

View File

@@ -55,18 +55,18 @@ $ git add pkgs/development/libraries/libfoo/default.nix</screen>
<itemizedlist>
<listitem>
<para>GNU Hello: <link
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/hello/default.nix"><filename>pkgs/applications/misc/hello/default.nix</filename></link>.
Trivial package, which specifies some <varname>meta</varname>
attributes which is good practice.</para>
<para>GNU cpio: <link
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/archivers/cpio/default.nix"><filename>pkgs/tools/archivers/cpio/default.nix</filename></link>.
The simplest possible package. The generic builder in
<varname>stdenv</varname> does everything for you. It has
no dependencies beyond <varname>stdenv</varname>.</para>
</listitem>
<listitem>
<para>GNU cpio: <link
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/archivers/cpio/default.nix"><filename>pkgs/tools/archivers/cpio/default.nix</filename></link>.
Also a simple package. The generic builder in
<varname>stdenv</varname> does everything for you. It has
no dependencies beyond <varname>stdenv</varname>.</para>
<para>GNU Hello: <link
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/hello/ex-2/default.nix"><filename>pkgs/applications/misc/hello/ex-2/default.nix</filename></link>.
Also trivial, but it specifies some <varname>meta</varname>
attributes which is good practice.</para>
</listitem>
<listitem>
@@ -92,6 +92,17 @@ $ git add pkgs/development/libraries/libfoo/default.nix</screen>
hackery.</para>
</listitem>
<listitem>
<para>BitTorrent (wxPython-based): <link
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/networking/p2p/bittorrent/default.nix"><filename>pkgs/tools/networking/p2p/bittorrent/default.nix</filename></link>.
Uses an external <link
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/networking/p2p/bittorrent/builder.sh">build
script</link>, which can be useful if you have lots of code
that you dont want cluttering up the Nix expression. But
external builders are mostly obsolete.
</para>
</listitem>
<listitem>
<para>Thunderbird: <link
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/mailreaders/thunderbird/default.nix"><filename>pkgs/applications/networking/mailreaders/thunderbird/default.nix</filename></link>.

44
doc/quote-literals.xsl Normal file
View File

@@ -0,0 +1,44 @@
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings"
extension-element-prefixes="str">
<xsl:output method="xml"/>
<xsl:template match="function|command|literal|varname|filename|option|quote">`<xsl:apply-templates/>'</xsl:template>
<xsl:template match="token"><xsl:text> </xsl:text><xsl:apply-templates /><xsl:text>
</xsl:text></xsl:template>
<xsl:template match="screen|programlisting">
<screen><xsl:apply-templates select="str:split(., '&#xA;')" /></screen>
</xsl:template>
<xsl:template match="section[following::section]">
<section>
<xsl:apply-templates />
<screen><xsl:text>
</xsl:text></screen>
</section>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{name(.)}" namespace="{namespace-uri(.)}">
<xsl:copy-of select="namespace::*" />
<xsl:for-each select="@*">
<xsl:attribute name="{name(.)}" namespace="{namespace-uri(.)}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:for-each>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="translate(., '‘’“”—', concat(&quot;`'&quot;, '&quot;&quot;-'))" />
</xsl:template>
</xsl:stylesheet>

View File

@@ -15,8 +15,7 @@ environment does everything automatically. If
can easily customise or override the various build phases.</para>
<section xml:id="sec-using-stdenv"><title>Using
<literal>stdenv</literal></title>
<section><title>Using <literal>stdenv</literal></title>
<para>To build a package with the standard environment, you use the
function <varname>stdenv.mkDerivation</varname>, instead of the
@@ -59,7 +58,7 @@ build. To make this easier, the standard environment breaks the
package build into a number of <emphasis>phases</emphasis>, all of
which can be overridden or modified individually: unpacking the
sources, applying patches, configuring, building, and installing.
(There are some others; see <xref linkend="sec-stdenv-phases"/>.)
(There are some others; see <xref linkend="ssec-stdenv-phases"/>.)
For instance, a package that doesnt supply a makefile but instead has
to be compiled “manually” could be handled like this:
@@ -125,8 +124,7 @@ genericBuild
</section>
<section xml:id="sec-tools-of-stdenv"><title>Tools provided by
<literal>stdenv</literal></title>
<section><title>Tools provided by <literal>stdenv</literal></title>
<para>The standard environment provides the following packages:
@@ -152,8 +150,8 @@ genericBuild
<listitem><para>GNU <command>tar</command>.</para></listitem>
<listitem><para><command>gzip</command>, <command>bzip2</command>
and <command>xz</command>.</para></listitem>
<listitem><para><command>gzip</command> and
<command>bzip2</command>.</para></listitem>
<listitem><para>GNU Make. It has been patched to provide
<quote>nested</quote> output that can be fed into the
@@ -227,7 +225,7 @@ genericBuild
</section>
<section xml:id="sec-stdenv-phases"><title>Phases</title>
<section xml:id="ssec-stdenv-phases"><title>Phases</title>
<para>The generic builder has a number of <emphasis>phases</emphasis>.
Package builds are split into phases to make it easier to override
@@ -245,8 +243,7 @@ is convenient to override a phase from the derivation, while the
latter is convenient from a build script.</para>
<section xml:id="ssec-controlling-phases"><title>Controlling
phases</title>
<section><title>Controlling phases</title>
<para>There are a number of variables that control what phases are
executed and in what order:
@@ -330,7 +327,7 @@ executed and in what order:
</section>
<section xml:id="ssec-unpack-phase"><title>The unpack phase</title>
<section><title>The unpack phase</title>
<para>The unpack phase is responsible for unpacking the source code of
the package. The default implementation of
@@ -344,11 +341,9 @@ It supports the following files by default:
<term>Tar files</term>
<listitem><para>These can optionally be compressed using
<command>gzip</command> (<filename>.tar.gz</filename>,
<filename>.tgz</filename> or <filename>.tar.Z</filename>),
<filename>.tgz</filename> or <filename>.tar.Z</filename>) or
<command>bzip2</command> (<filename>.tar.bz2</filename> or
<filename>.tbz2</filename>) or <command>xz</command>
(<filename>.tar.xz</filename> or
<filename>.tar.lzma</filename>).</para></listitem>
<filename>.tbz2</filename>).</para></listitem>
</varlistentry>
<varlistentry>
@@ -437,7 +432,7 @@ Additional file types can be supported by setting the
</section>
<section xml:id="ssec-patch-phase"><title>The patch phase</title>
<section><title>The patch phase</title>
<para>The patch phase applies the list of patches defined in the
<varname>patches</varname> variable.</para>
@@ -450,10 +445,9 @@ Additional file types can be supported by setting the
<listitem><para>The list of patches. They must be in the format
accepted by the <command>patch</command> command, and may
optionally be compressed using <command>gzip</command>
(<filename>.gz</filename>), <command>bzip2</command>
(<filename>.bz2</filename>) or <command>xz</command>
(<filename>.xz</filename>).</para></listitem>
</varlistentry>
(<filename>.gz</filename>) or <command>bzip2</command>
(<filename>.bz2</filename>).</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>patchFlags</varname></term>
@@ -480,7 +474,7 @@ Additional file types can be supported by setting the
</section>
<section xml:id="ssec-configure-phase"><title>The configure phase</title>
<section><title>The configure phase</title>
<para>The configure phase prepares the source tree for building. The
default <function>configurePhase</function> runs
@@ -516,8 +510,8 @@ script) if it exists.</para>
<term><varname>dontAddPrefix</varname></term>
<listitem><para>By default, the flag
<literal>--prefix=$prefix</literal> is added to the configure
flags. If this is undesirable, set this variable to
true.</para></listitem>
flags. If this is undesirable, set this variable to a non-empty
value.</para></listitem>
</varlistentry>
<varlistentry>
@@ -533,7 +527,8 @@ script) if it exists.</para>
<listitem><para>By default, the flag
<literal>--disable-dependency-tracking</literal> is added to the
configure flags to speed up Automake-based builds. If this is
undesirable, set this variable to true.</para></listitem>
undesirable, set this variable to a non-empty
value.</para></listitem>
</varlistentry>
<varlistentry>
@@ -546,16 +541,7 @@ script) if it exists.</para>
variables in the Libtool script to prevent Libtool from using
libraries in <filename>/usr/lib</filename> and
such.</para></footnote>. If this is undesirable, set this
variable to true.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>dontDisableStatic</varname></term>
<listitem><para>By default, when the configure script has
<option>--enable-static</option>, the option
<option>--disable-static</option> is added to the configure flags.</para>
<para>If this is undesirable, set this variable to
true.</para></listitem>
variable to a non-empty value.</para></listitem>
</varlistentry>
<varlistentry>
@@ -576,7 +562,7 @@ script) if it exists.</para>
</section>
<section xml:id="build-phase"><title>The build phase</title>
<section><title>The build phase</title>
<para>The build phase is responsible for actually building the package
(e.g. compiling it). The default <function>buildPhase</function>
@@ -660,7 +646,7 @@ called, respectively.</para>
</section>
<section xml:id="ssec-check-phase"><title>The check phase</title>
<section><title>The check phase</title>
<para>The check phase checks whether the package was built correctly
by running its test suite. The default
@@ -720,7 +706,7 @@ doCheck = true;</programlisting>
</section>
<section xml:id="ssec-install-phase"><title>The install phase</title>
<section><title>The install phase</title>
<para>The install phase is responsible for installing the package in
the Nix store under <envar>out</envar>. The default
@@ -729,7 +715,7 @@ the Nix store under <envar>out</envar>. The default
install</command>.</para>
<variablelist>
<title>Variables controlling the install phase</title>
<title>Variables controlling the check phase</title>
<varlistentry>
<term><varname>makeFlags</varname> /
@@ -775,7 +761,7 @@ installTargets = "install-bin install-doc";</programlisting>
</section>
<section xml:id="ssec-fixup-phase"><title>The fixup phase</title>
<section><title>The fixup phase</title>
<para>The fixup phase performs some (Nix-specific) post-processing
actions on the files installed under <filename>$out</filename> by the
@@ -808,7 +794,7 @@ following:
</para>
<variablelist>
<title>Variables controlling the fixup phase</title>
<title>Variables controlling the check phase</title>
<varlistentry>
<term><varname>dontStrip</varname></term>
@@ -816,12 +802,6 @@ following:
stripped. By default, they are.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>dontMoveSbin</varname></term>
<listitem><para>If set, files in <filename>$out/sbin</filename> are not moved
to <filename>$out/bin</filename>. By default, they are.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>stripAllList</varname></term>
<listitem><para>List of directories to search for libraries and
@@ -899,41 +879,12 @@ following:
phase.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>separateDebugInfo</varname></term>
<listitem><para>If set to <literal>true</literal>, the standard
environment will enable debug information in C/C++ builds. After
installation, the debug information will be separated from the
executables and stored in the output named
<literal>debug</literal>. (This output is enabled automatically;
you dont need to set the <varname>outputs</varname> attribute
explicitly.) To be precise, the debug information is stored in
<filename><replaceable>debug</replaceable>/lib/debug/.build-id/<replaceable>XX</replaceable>/<replaceable>YYYY…</replaceable></filename>,
where <replaceable>XXYYYY…</replaceable> is the <replaceable>build
ID</replaceable> of the binary — a SHA-1 hash of the contents of
the binary. Debuggers like GDB use the build ID to look up the
separated debug information.</para>
<para>For example, with GDB, you can add
<programlisting>
set debug-file-directory ~/.nix-profile/lib/debug
</programlisting>
to <filename>~/.gdbinit</filename>. GDB will then be able to find
debug information installed via <literal>nix-env
-i</literal>.</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="ssec-distribution-phase"><title>The distribution
phase</title>
<section><title>The distribution phase</title>
<para>The distribution phase is intended to produce a source
distribution of the package. The default
@@ -1166,9 +1117,12 @@ echo @foo@
<varlistentry>
<term>Python</term>
<listitem><para>Adds the
<filename>lib/${python.libPrefix}/site-packages</filename> subdirectory of
<filename>lib/python2.5/site-packages</filename> subdirectory of
each build input to the <envar>PYTHONPATH</envar> environment
variable.</para></listitem>
variable.</para>
<note><para>This should be generalised: the Python version
shouldnt be hard-coded.</para></note></listitem>
</varlistentry>
<varlistentry>
@@ -1204,7 +1158,7 @@ echo @foo@
</varlistentry>
<varlistentry>
<term>Qt 4</term>
<term>Qt</term>
<listitem><para>Sets the <envar>QTDIR</envar> environment variable
to Qts path.</para></listitem>
</varlistentry>
@@ -1237,7 +1191,7 @@ echo @foo@
</section>
<section xml:id="sec-purity-in-nixpkgs"><title>Purity in Nixpkgs</title>
<section><title>Purity in Nixpkgs</title>
<para>[measures taken to prevent dependencies on packages outside the
store, and what you can do to prevent them]</para>

View File

@@ -1,283 +0,0 @@
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="chap-submitting-changes">
<title>Submitting changes</title>
<section>
<title>Making patches</title>
<itemizedlist>
<listitem>
<para>Read <link xlink:href="https://nixos.org/nixpkgs/manual/">Manual (How to write packages for Nix)</link>.</para>
</listitem>
<listitem>
<para>Fork the repository on GitHub.</para>
</listitem>
<listitem>
<para>Create a branch for your future fix.
<itemizedlist>
<listitem>
<para>You can make branch from a commit of your local <command>nixos-version</command>. That will help you to avoid additional local compilations. Because you will receive packages from binary cache.
<itemizedlist>
<listitem>
<para>For example: <command>nixos-version</command> returns <command>15.05.git.0998212 (Dingo)</command>. So you can do:</para>
</listitem>
</itemizedlist>
<screen>
$ git checkout 0998212
$ git checkout -b 'fix/pkg-name-update'
</screen>
</para>
</listitem>
<listitem>
<para>Please avoid working directly on the <command>master</command> branch.</para>
</listitem>
</itemizedlist>
</para>
</listitem>
<listitem>
<para>Make commits of logical units.
<itemizedlist>
<listitem>
<para>If you removed pkgs, made some major NixOS changes etc., write about them in <command>nixos/doc/manual/release-notes/rl-unstable.xml</command>.</para>
</listitem>
</itemizedlist>
</para>
</listitem>
<listitem>
<para>Check for unnecessary whitespace with <command>git diff --check</command> before committing.</para>
</listitem>
<listitem>
<para>Format the commit in a following way:</para>
<programlisting>
(pkg-name | service-name): (from -> to | init at version | refactor | etc)
Additional information.
</programlisting>
<itemizedlist>
<listitem>
<para>Examples:
<itemizedlist>
<listitem>
<para>
<command>nginx: init at 2.0.1</command>
</para>
</listitem>
<listitem>
<para>
<command>firefox: 3.0 -> 3.1.1</command>
</para>
</listitem>
<listitem>
<para>
<command>hydra service: add bazBaz option</command>
</para>
</listitem>
<listitem>
<para>
<command>nginx service: refactor config generation</command>
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>Test your changes. If you work with
<itemizedlist>
<listitem>
<para>nixpkgs:
<itemizedlist>
<listitem>
<para>update pkg ->
<itemizedlist>
<listitem>
<para>
<command>nix-env -i pkg-name -f &lt;path to your local nixpkgs folder&gt;</command>
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
<listitem>
<para>add pkg ->
<itemizedlist>
<listitem>
<para>Make sure it's in <command>pkgs/top-level/all-packages.nix</command>
</para>
</listitem>
<listitem>
<para>
<command>nix-env -i pkg-name -f &lt;path to your local nixpkgs folder&gt;</command>
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
<listitem>
<para>
<emphasis>If you don't want to install pkg in you profile</emphasis>.
<itemizedlist>
<listitem>
<para>
<command>nix-build -A pkg-attribute-name &lt;path to your local nixpkgs folder&gt;/default.nix</command> and check results in the folder <command>result</command>. It will appear in the same directory where you did <command>nix-build</command>.</para>
</listitem>
</itemizedlist>
</para>
</listitem>
<listitem>
<para>If you did <command>nix-env -i pkg-name</command> you can do <command>nix-env -e pkg-name</command> to uninstall it from your system.</para>
</listitem>
</itemizedlist>
</para>
</listitem>
<listitem>
<para>NixOS and its modules:
<itemizedlist>
<listitem>
<para>You can add new module to your NixOS configuration file (usually it's <command>/etc/nixos/configuration.nix</command>).
And do <command>sudo nixos-rebuild test -I nixpkgs=&lt;path to your local nixpkgs folder&gt; --fast</command>.</para>
</listitem>
</itemizedlist>
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
<listitem>
<para>If you have commits <command>pkg-name: oh, forgot to insert whitespace</command>: squash commits in this case. Use <command>git rebase -i</command>.</para>
</listitem>
<listitem>
<para>Rebase you branch against current <command>master</command>.</para>
</listitem>
</itemizedlist>
</section>
<section>
<title>Submitting changes</title>
<itemizedlist>
<listitem>
<para>Push your changes to your fork of nixpkgs.</para>
</listitem>
<listitem>
<para>Create pull request:
<itemizedlist>
<listitem>
<para>Write the title in format <command>(pkg-name | service): improvement</command>.
<itemizedlist>
<listitem>
<para>If you update the pkg, write versions <command>from -> to</command>.</para>
</listitem>
</itemizedlist>
</para>
</listitem>
<listitem>
<para>Write in comment if you have tested your patch. Do not rely much on <command>TravisCI</command>.</para>
</listitem>
<listitem>
<para>If you make an improvement, write about your motivation.</para>
</listitem>
<listitem>
<para>Notify maintainers of the package. For example add to the message: <command>cc @jagajaga @domenkozar</command>.</para>
</listitem>
</itemizedlist>
</para>
</listitem>
</itemizedlist>
</section>
<section>
<title>Hotfixing pull requests</title>
<itemizedlist>
<listitem>
<para>Make the appropriate changes in you branch.</para>
</listitem>
<listitem>
<para>Don't create additional commits, do
<itemizedlist>
<listitem>
<para><command>git rebase -i</command></para>
</listitem>
<listitem>
<para>
<command>git push --force</command> to your branch.</para>
</listitem>
</itemizedlist>
</para>
</listitem>
</itemizedlist>
</section>
<section>
<title>Commit policy</title>
<itemizedlist>
<listitem>
<para>Commits must be sufficiently tested before being merged, both for the master and staging branches.</para>
</listitem>
<listitem>
<para>Hydra builds for master and staging should not be used as testing platform, it's a build farm for changes that have been already tested.</para>
</listitem>
<listitem>
<para>Master should only see non-breaking commits that do not cause mass rebuilds.</para>
</listitem>
<listitem>
<para>Staging should only see non-breaking mass-rebuild commits. That means it's not to be used for testing, and changes must have been well tested already. <link xlink:href="http://comments.gmane.org/gmane.linux.distributions.nixos/13447">Read policy here</link>.</para>
</listitem>
<listitem>
<para>If staging is already in a broken state, please refrain from adding extra new breakages. Stabilize it for a few days, merge into master, then resume development on staging. <link xlink:href="http://hydra.nixos.org/jobset/nixpkgs/staging#tabs-evaluations">Keep an eye on the staging evaluations here</link>.</para>
</listitem>
<listitem>
<para>When changing the bootloader installation process, extra care must be taken. Grub installations cannot be rolled back, hence changes may break people's installations forever. For any non-trivial change to the bootloader please file a PR asking for review, especially from @edolstra.</para>
</listitem>
</itemizedlist>
</section>
</chapter>

View File

@@ -1,11 +1,12 @@
# Operations on attribute sets.
with {
inherit (builtins) head tail length;
inherit (builtins) head tail;
inherit (import ./trivial.nix) or;
inherit (import ./default.nix) fold;
inherit (import ./strings.nix) concatStringsSep;
inherit (import ./lists.nix) concatMap concatLists all deepSeqList;
inherit (import ./misc.nix) maybeAttr;
};
rec {
@@ -19,8 +20,8 @@ rec {
let attr = head attrPath;
in
if attrPath == [] then e
else if e ? ${attr}
then attrByPath (tail attrPath) default e.${attr}
else if hasAttr attr e
then attrByPath (tail attrPath) default (getAttr attr e)
else default;
@@ -43,7 +44,8 @@ rec {
attrVals ["a" "b" "c"] as
=> [as.a as.b as.c]
*/
attrVals = nameList: set: map (x: set.${x}) nameList;
attrVals = nameList: set:
map (x: getAttr x set) nameList;
/* Return the values of all attributes in the given set, sorted by
@@ -53,7 +55,7 @@ rec {
attrValues {c = 3; a = 1; b = 2;}
=> [1 2 3]
*/
attrValues = builtins.attrValues or (attrs: attrVals (attrNames attrs) attrs);
attrValues = attrs: attrVals (attrNames attrs) attrs;
/* Collect each attribute named `attr' from a list of attribute
@@ -63,8 +65,7 @@ rec {
catAttrs "a" [{a = 1;} {b = 0;} {a = 2;}]
=> [1 2]
*/
catAttrs = builtins.catAttrs or
(attr: l: concatLists (map (s: if s ? ${attr} then [s.${attr}] else []) l));
catAttrs = attr: l: concatLists (map (s: if hasAttr attr s then [(getAttr attr s)] else []) l);
/* Filter an attribute set by removing all attributes for which the
@@ -75,29 +76,9 @@ rec {
=> { foo = 1; }
*/
filterAttrs = pred: set:
listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
listToAttrs (fold (n: ys: let v = getAttr n set; in if pred n v then [(nameValuePair n v)] ++ ys else ys) [] (attrNames set));
/* Filter an attribute set recursivelly by removing all attributes for
which the given predicate return false.
Example:
filterAttrsRecursive (n: v: v != null) { foo = { bar = null; }; }
=> { foo = {}; }
*/
filterAttrsRecursive = pred: set:
listToAttrs (
concatMap (name:
let v = set.${name}; in
if pred name v then [
(nameValuePair name (
if isAttrs v then filterAttrsRecursive pred v
else v
))
] else []
) (attrNames set)
);
/* foldAttrs: apply fold functions to values grouped by key. Eg accumulate values as list:
foldAttrs (n: a: [n] ++ a) [] [{ a = 2; } { a = 3; }]
=> { a = [ 2 3 ]; }
@@ -105,7 +86,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 // (listToAttrs [{inherit name; value = op (getAttr name n) (maybeAttr name nul a); }])
) a (attrNames n)
) {} list_of_attrs;
@@ -151,7 +132,7 @@ rec {
=> { x = "x-foo"; y = "y-bar"; }
*/
mapAttrs = f: set:
listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set));
listToAttrs (map (attr: { name = attr; value = f attr (getAttr attr set); }) (attrNames set));
/* Like `mapAttrs', but allows the name of each attribute to be
@@ -164,7 +145,7 @@ rec {
=> { foo_x = "bar-a"; foo_y = "bar-b"; }
*/
mapAttrs' = f: set:
listToAttrs (map (attr: f attr set.${attr}) (attrNames set));
listToAttrs (map (attr: f attr (getAttr attr set)) (attrNames set));
/* Call a function for each attribute in the given set and return
@@ -176,7 +157,7 @@ rec {
=> [ "xa" "yb" ]
*/
mapAttrsToList = f: attrs:
map (name: f name attrs.${name}) (attrNames attrs);
map (name: f name (getAttr name attrs)) (attrNames attrs);
/* Like `mapAttrs', except that it recursively applies itself to
@@ -241,16 +222,6 @@ rec {
isDerivation = x: isAttrs x && x ? type && x.type == "derivation";
/* Convert a store path to a fake derivation. */
toDerivation = path:
let path' = builtins.storePath path; in
{ type = "derivation";
name = builtins.unsafeDiscardStringContext (builtins.substring 33 (-1) (baseNameOf path'));
outPath = path';
outputs = [ "out" ];
};
/* If the Boolean `cond' is true, return the attribute set `as',
otherwise an empty attribute set. */
optionalAttrs = cond: as: if cond then as else {};
@@ -351,7 +322,7 @@ rec {
# override only the attributes that are already present in the old set
# useful for deep-overriding
overrideExisting = old: new:
old // listToAttrs (map (attr: nameValuePair attr (attrByPath [attr] old.${attr} new)) (attrNames old));
old // listToAttrs (map (attr: nameValuePair attr (attrByPath [attr] (getAttr attr old) new)) (attrNames old));
deepSeqAttrs = x: y: deepSeqList (attrValues x) y;
}

View File

@@ -1,74 +1,15 @@
{lib, pkgs} :
let inherit (lib) nv nvs; in
{
# composableDerivation basically mixes these features:
# - fix function
# - mergeAttrBy
# - provides shortcuts for "options" such as "--enable-foo" and adding
# buildInputs, see php example
# see for example:
# - development/interpreters/php_configurable/default.nix
# - .. search composableDerivation in all-packages.nix ..
#
# It predates styles which are common today, such as
# * the config attr
# * mkDerivation.override feature
# * overrideDerivation (lib/customization.nix)
#
# Some of the most more important usage examples (which could be rewritten if it was important):
# * php
# * postgis
# * vim_configurable
#
# A minimal example illustrating most features would look like this:
# let base = composableDerivation { (fixed : let inherit (fixed.fixed) name in {
# src = fetchurl {
# }
# buildInputs = [A];
# preConfigre = "echo ${name}";
# # attention, "name" attr is missing, thus you cannot instantiate "base".
# }
# in {
# # These all add name attribute, thus you can instantiate those:
# v1 = base.merge ({ name = "foo-add-B"; buildInputs = [B]; }); // B gets merged into buildInputs
# v2 = base.merge ({ name = "mix-in-pre-configure-lines" preConfigre = ""; });
# v3 = base.replace ({ name = "foo-no-A-only-B;" buildInputs = [B]; });
# }
#
# So yes, you can think about it being something like nixos modules, and
# you'd be merging "features" in one at a time using .merge or .replace
# Thanks Shea for telling me that I rethink the documentation ..
#
# issues:
# * its complicated to understand
# * some "features" such as exact merge behaviour are burried in mergeAttrBy
# and defaultOverridableDelayableArgs assuming the default behaviour does
# the right thing in the common case
# * Eelco once said using such fix style functions are slow to evaluate
# * Too quick & dirty. Hard to understand for others. The benefit was that
# you were able to create a kernel builder like base derivation and replace
# / add patches the way you want without having to declare function arguments
#
# nice features:
# declaring "optional featuers" is modular. For instance:
# flags.curl = {
# configureFlags = ["--with-curl=${curl}" "--with-curlwrappers"];
# buildInputs = [curl openssl];
# };
# flags.other = { .. }
# (Example taken from PHP)
#
# alternative styles / related features:
# * Eg see function supporting building the kernel
# * versionedDerivation (discussion about this is still going on - or ended)
# * composedArgsAndFun
# * mkDerivation.override
# * overrideDerivation
# * using { .., *Support ? false }: like configurable options.
# To find those examples use grep
#
# To sum up: It exists for historical reasons - and for most commonly used
# tasks the alternatives should be used
#
# If you have questions about this code ping Marc Weber.
# You should be able to override anything you like easily
# grep the mailinglist by title "python proposal" (dec 08)
# -> http://mail.cs.uu.nl/pipermail/nix-dev/2008-December/001571.html
# to see why this got complicated when using all its features
# TODO add newer example using new syntax (kernel derivation proposal -> mailinglist)
composableDerivation = {
mkDerivation ? pkgs.stdenv.mkDerivation,

View File

@@ -1,7 +1,5 @@
let
lib = import ./default.nix;
inherit (builtins) attrNames isFunction;
let lib = import ./default.nix;
inherit (builtins) getAttr attrNames isFunction;
in
@@ -31,8 +29,8 @@ rec {
For another application, see build-support/vm, where this
function is used to build arbitrary derivations inside a QEMU
virtual machine.
*/
virtual machine. */
overrideDerivation = drv: f:
let
newDrv = derivation (drv.drvAttrs // (f drv));
@@ -51,23 +49,27 @@ rec {
else { }));
# usage: (you can use override multiple times)
# let d = makeOverridable stdenv.mkDerivation { name = ..; buildInputs; }
# noBuildInputs = d.override { buildInputs = []; }
# additionalBuildInputs = d.override ( args : args // { buildInputs = args.buildInputs ++ [ additional ]; } )
makeOverridable = f: origArgs:
let
ff = f origArgs;
overrideWith = newArgs: origArgs // (if builtins.isFunction newArgs then newArgs origArgs else newArgs);
in
if builtins.isAttrs ff then (ff //
{ override = newArgs: makeOverridable f (overrideWith newArgs);
overrideDerivation = fdrv:
makeOverridable (args: overrideDerivation (f args) fdrv) origArgs;
{ override = newArgs:
makeOverridable f (origArgs // (if builtins.isFunction newArgs then newArgs origArgs else newArgs));
deepOverride = newArgs:
makeOverridable f (lib.overrideExisting (lib.mapAttrs (deepOverrider newArgs) origArgs) newArgs);
})
else if builtins.isFunction ff then
{ override = newArgs: makeOverridable f (overrideWith newArgs);
__functor = self: ff;
overrideDerivation = throw "overrideDerivation not yet supported for functors";
}
else ff;
deepOverrider = newArgs: name: x: if builtins.isAttrs x then (
if x ? deepOverride then (x.deepOverride newArgs) else
if x ? override then (x.override newArgs) else
x) else x;
/* Call the package function in the file `fn' with the required
arguments automatically. The function is called with the
@@ -91,29 +93,10 @@ rec {
};
*/
callPackageWith = autoArgs: fn: args:
let
f = if builtins.isFunction fn then fn else import fn;
auto = builtins.intersectAttrs (builtins.functionArgs f) autoArgs;
in makeOverridable f (auto // args);
let f = if builtins.isFunction fn then fn else import fn; in
makeOverridable f ((builtins.intersectAttrs (builtins.functionArgs f) autoArgs) // args);
/* Like callPackage, but for a function that returns an attribute
set of derivations. The override function is added to the
individual attributes. */
callPackagesWith = autoArgs: fn: args:
let
f = if builtins.isFunction fn then fn else import fn;
auto = builtins.intersectAttrs (builtins.functionArgs f) autoArgs;
finalArgs = auto // args;
pkgs = f finalArgs;
mkAttrOverridable = name: pkg: pkg // {
override = newArgs: mkAttrOverridable name (f (finalArgs // newArgs)).${name};
};
in lib.mapAttrs mkAttrOverridable pkgs;
/* Add attributes to each output of a derivation without changing
the derivation itself. */
/* Add attributes to each output of a derivation without changing the derivation itself */
addPassthru = drv: passthru:
let
outputs = drv.outputs or [ "out" ];
@@ -124,63 +107,10 @@ rec {
outputToAttrListElement = outputName:
{ name = outputName;
value = commonAttrs // {
inherit (drv.${outputName}) outPath drvPath type outputName;
inherit (builtins.getAttr outputName drv) outPath drvPath type outputName;
};
};
outputsList = map outputToAttrListElement outputs;
in commonAttrs.${drv.outputName};
/* Strip a derivation of all non-essential attributes, returning
only those needed by hydra-eval-jobs. Also strictly evaluate the
result to ensure that there are no thunks kept alive to prevent
garbage collection. */
hydraJob = drv:
let
outputs = drv.outputs or ["out"];
commonAttrs =
{ inherit (drv) name system meta; inherit outputs; }
// lib.optionalAttrs (drv._hydraAggregate or false) {
_hydraAggregate = true;
constituents = map hydraJob (lib.flatten drv.constituents);
}
// (lib.listToAttrs outputsList);
makeOutput = outputName:
let output = drv.${outputName}; in
{ name = outputName;
value = commonAttrs // {
outPath = output.outPath;
drvPath = output.drvPath;
type = "derivation";
inherit outputName;
};
};
outputsList = map makeOutput outputs;
drv' = (lib.head outputsList).value;
in lib.deepSeq drv' drv';
/* 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
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
provided by `newScope' and the set provides a `newScope' attribute
which can form the parent scope for later package sets. */
makeScope = newScope: f:
let self = f self // {
newScope = scope: newScope (self // scope);
callPackage = self.newScope {};
override = g: makeScope newScope (self_:
let super = f self_;
in super // g super self_);
};
in self;
in builtins.getAttr drv.outputName commonAttrs;
}

View File

@@ -9,16 +9,23 @@ in
rec {
inherit (builtins) addErrorContext;
addErrorContextToAttrs = lib.mapAttrs (a: v: lib.addErrorContext "while evaluating ${a}" v);
# Wrapper aroung the primop `addErrorContext', which shouldn't used
# directly. It evaluates and returns `val', but if an evaluation
# error occurs, the text in `msg' is added to the error context
# (stack trace) printed by Nix.
addErrorContext =
if builtins ? addErrorContext
then builtins.addErrorContext
else msg: val: val;
traceIf = p: msg: x: if p then trace msg x else x;
traceVal = x: trace x x;
traceXMLVal = x: trace (builtins.toXML x) x;
traceXMLValMarked = str: x: trace (str + builtins.toXML x) x;
addErrorContextToAttrs = lib.mapAttrs (a : v : lib.addErrorContext "while evaluating ${a}" v);
traceVal = if builtins ? trace then x: (builtins.trace x x) else x: x;
traceXMLVal = if builtins ? trace then x: (builtins.trace (builtins.toXML x) x) else x: x;
traceXMLValMarked = str: if builtins ? trace then x: (builtins.trace ( str + builtins.toXML x) x) else x: x;
# this can help debug your code as well - designed to not produce thousands of lines
traceShowVal = x : trace (showVal x) x;
traceShowValMarked = str: x: trace (str + showVal x) x;
@@ -37,13 +44,12 @@ rec {
else if isString x then "x is a string `${substring 0 50 x}...'"
else "x is probably a path `${substring 0 50 (toString x)}...'";
# trace the arguments passed to function and its result
# trace the arguments passed to function and its result
# maybe rewrite these functions in a traceCallXml like style. Then one function is enough
traceCall = n : f : a : let t = n2 : x : traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a));
traceCall2 = n : f : a : b : let t = n2 : x : traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b));
traceCall3 = n : f : a : b : c : let t = n2 : x : traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b) (t "arg 3" c));
# FIXME: rename this?
traceValIfNot = c: x:
if c x then true else trace (showVal x) false;
@@ -64,7 +70,7 @@ rec {
then [ { inherit name; expected = test.expected; result = test.expr; } ]
else [] ) tests));
# create a test assuming that list elements are true
# usage: { testX = allTrue [ true ]; }
testAllTrue = expr : { inherit expr; expected = map (x: true) expr; };
@@ -103,11 +109,11 @@ rec {
let nr = a;
in (str: expr:
if isFunction expr then
(arg:
(arg:
traceCallXml (builtins.add 1 nr) "${str}\n arg ${builtins.toString nr} is \n ${builtins.toXML (strict arg)}" (expr arg)
)
else
else
let r = strict expr;
in trace "${str}\n result:\n${builtins.toXML r}" r
in builtins.trace "${str}\n result:\n${builtins.toXML r}" r
);
}

View File

@@ -11,7 +11,7 @@ let
types = import ./types.nix;
meta = import ./meta.nix;
debug = import ./debug.nix;
misc = import ./deprecated.nix;
misc = import ./misc.nix;
maintainers = import ./maintainers.nix;
platforms = import ./platforms.nix;
systems = import ./systems.nix;

View File

@@ -1,423 +0,0 @@
let lib = import ./default.nix;
inherit (builtins) isFunction head tail isList isAttrs isInt attrNames;
in
with import ./lists.nix;
with import ./attrsets.nix;
with import ./strings.nix;
rec {
# returns default if env var is not set
maybeEnv = name: default:
let value = builtins.getEnv name; in
if value == "" then default else value;
defaultMergeArg = x : y: if builtins.isAttrs y then
y
else
(y x);
defaultMerge = x: y: x // (defaultMergeArg x y);
foldArgs = merger: f: init: x:
let arg=(merger init (defaultMergeArg init x));
# now add the function with composed args already applied to the final attrs
base = (setAttrMerge "passthru" {} (f arg)
( z : z // rec {
function = foldArgs merger f arg;
args = (lib.attrByPath ["passthru" "args"] {} z) // x;
} ));
withStdOverrides = base // {
override = base.passthru.function;
} ;
in
withStdOverrides;
# predecessors: proposed replacement for applyAndFun (which has a bug cause it merges twice)
# the naming "overridableDelayableArgs" tries to express that you can
# - override attr values which have been supplied earlier
# - use attr values before they have been supplied by accessing the fix point
# name "fixed"
# f: the (delayed overridden) arguments are applied to this
#
# initial: initial attrs arguments and settings. see defaultOverridableDelayableArgs
#
# returns: f applied to the arguments // special attributes attrs
# a) merge: merge applied args with new args. Wether an argument is overridden depends on the merge settings
# b) replace: this let's you replace and remove names no matter which merge function has been set
#
# examples: see test cases "res" below;
overridableDelayableArgs =
f : # the function applied to the arguments
initial : # you pass attrs, the functions below are passing a function taking the fix argument
let
takeFixed = if isFunction initial then initial else (fixed : initial); # transform initial to an expression always taking the fixed argument
tidy = args :
let # apply all functions given in "applyPreTidy" in sequence
applyPreTidyFun = fold ( n : a : x : n ( a x ) ) lib.id (maybeAttr "applyPreTidy" [] args);
in removeAttrs (applyPreTidyFun args) ( ["applyPreTidy"] ++ (maybeAttr "removeAttrs" [] args) ); # tidy up args before applying them
fun = n : x :
let newArgs = fixed :
let args = takeFixed fixed;
mergeFun = args.${n};
in if isAttrs x then (mergeFun args x)
else assert isFunction x;
mergeFun args (x ( args // { inherit fixed; }));
in overridableDelayableArgs f newArgs;
in
(f (tidy (lib.fix takeFixed))) // {
merge = fun "mergeFun";
replace = fun "keepFun";
};
defaultOverridableDelayableArgs = f :
let defaults = {
mergeFun = mergeAttrByFunc; # default merge function. merge strategie (concatenate lists, strings) is given by mergeAttrBy
keepFun = a : b : { inherit (a) removeAttrs mergeFun keepFun mergeAttrBy; } // b; # even when using replace preserve these values
applyPreTidy = []; # list of functions applied to args before args are tidied up (usage case : prepareDerivationArgs)
mergeAttrBy = mergeAttrBy // {
applyPreTidy = a : b : a ++ b;
removeAttrs = a : b: a ++ b;
};
removeAttrs = ["mergeFun" "keepFun" "mergeAttrBy" "removeAttrs" "fixed" ]; # before applying the arguments to the function make sure these names are gone
};
in (overridableDelayableArgs f defaults).merge;
# rec { # an example of how composedArgsAndFun can be used
# a = composedArgsAndFun (x : x) { a = ["2"]; meta = { d = "bar";}; };
# # meta.d will be lost ! It's your task to preserve it (eg using a merge function)
# b = a.passthru.function { a = [ "3" ]; meta = { d2 = "bar2";}; };
# # instead of passing/ overriding values you can use a merge function:
# c = b.passthru.function ( x: { a = x.a ++ ["4"]; }); # consider using (maybeAttr "a" [] x)
# }
# result:
# {
# a = { a = ["2"]; meta = { d = "bar"; }; passthru = { function = .. }; };
# b = { a = ["3"]; meta = { d2 = "bar2"; }; passthru = { function = .. }; };
# c = { a = ["3" "4"]; meta = { d2 = "bar2"; }; passthru = { function = .. }; };
# # c2 is equal to c
# }
composedArgsAndFun = f: foldArgs defaultMerge f {};
# shortcut for attrByPath ["name"] default attrs
maybeAttrNullable = maybeAttr;
# shortcut for attrByPath ["name"] default attrs
maybeAttr = name: default: attrs: attrs.${name} or default;
# Return the second argument if the first one is true or the empty version
# of the second argument.
ifEnable = cond: val:
if cond then val
else if builtins.isList val then []
else if builtins.isAttrs val then {}
# else if builtins.isString val then ""
else if val == true || val == false then false
else null;
# Return true only if there is an attribute and it is true.
checkFlag = attrSet: name:
if name == "true" then true else
if name == "false" then false else
if (elem name (attrByPath ["flags"] [] attrSet)) then true else
attrByPath [name] false attrSet ;
# Input : attrSet, [ [name default] ... ], name
# Output : its value or default.
getValue = attrSet: argList: name:
( attrByPath [name] (if checkFlag attrSet name then true else
if argList == [] then null else
let x = builtins.head argList; in
if (head x) == name then
(head (tail x))
else (getValue attrSet
(tail argList) name)) attrSet );
# Input : attrSet, [[name default] ...], [ [flagname reqs..] ... ]
# Output : are reqs satisfied? It's asserted.
checkReqs = attrSet : argList : condList :
(
fold lib.and true
(map (x: let name = (head x) ; in
((checkFlag attrSet name) ->
(fold lib.and true
(map (y: let val=(getValue attrSet argList y); in
(val!=null) && (val!=false))
(tail x))))) condList)) ;
# This function has O(n^2) performance.
uniqList = {inputList, acc ? []} :
let go = xs : acc :
if xs == []
then []
else let x = head xs;
y = if elem x acc then [] else [x];
in y ++ go (tail xs) (y ++ acc);
in go inputList acc;
uniqListExt = {inputList, outputList ? [],
getter ? (x : x), compare ? (x: y: x==y)}:
if inputList == [] then outputList else
let x=head inputList;
isX = y: (compare (getter y) (getter x));
newOutputList = outputList ++
(if any isX outputList then [] else [x]);
in uniqListExt {outputList=newOutputList;
inputList = (tail inputList);
inherit getter compare;
};
condConcat = name: list: checker:
if list == [] then name else
if checker (head list) then
condConcat
(name + (head (tail list)))
(tail (tail list))
checker
else condConcat
name (tail (tail list)) checker;
lazyGenericClosure = {startSet, operator}:
let
work = list: doneKeys: result:
if list == [] then
result
else
let x = head list; key = x.key; in
if elem key doneKeys then
work (tail list) doneKeys result
else
work (tail list ++ operator x) ([key] ++ doneKeys) ([x] ++ result);
in
work startSet [] [];
innerModifySumArgs = f: x: a: b: if b == null then (f a b) // x else
innerModifySumArgs f x (a // b);
modifySumArgs = f: x: innerModifySumArgs f x {};
innerClosePropagation = acc : xs :
if xs == []
then acc
else let y = head xs;
ys = tail xs;
in if ! isAttrs y
then innerClosePropagation acc ys
else let acc' = [y] ++ acc;
in innerClosePropagation
acc'
(uniqList { inputList = (maybeAttrNullable "propagatedBuildInputs" [] y)
++ (maybeAttrNullable "propagatedNativeBuildInputs" [] y)
++ ys;
acc = acc';
}
);
closePropagation = list: (uniqList {inputList = (innerClosePropagation [] list);});
# calls a function (f attr value ) for each record item. returns a list
mapAttrsFlatten = f : r : map (attr: f attr r.${attr}) (attrNames r);
# attribute set containing one attribute
nvs = name : value : listToAttrs [ (nameValuePair name value) ];
# adds / replaces an attribute of an attribute set
setAttr = set : name : v : set // (nvs name v);
# setAttrMerge (similar to mergeAttrsWithFunc but only merges the values of a particular name)
# setAttrMerge "a" [] { a = [2];} (x : x ++ [3]) -> { a = [2 3]; }
# setAttrMerge "a" [] { } (x : x ++ [3]) -> { a = [ 3]; }
setAttrMerge = name : default : attrs : f :
setAttr attrs name (f (maybeAttr name default attrs));
# Using f = a : b = b the result is similar to //
# merge attributes with custom function handling the case that the attribute
# exists in both sets
mergeAttrsWithFunc = f : set1 : set2 :
fold (n: set : if set ? ${n}
then setAttr set n (f set.${n} set2.${n})
else set )
(set2 // set1) (attrNames set2);
# merging two attribute set concatenating the values of same attribute names
# eg { a = 7; } { a = [ 2 3 ]; } becomes { a = [ 7 2 3 ]; }
mergeAttrsConcatenateValues = mergeAttrsWithFunc ( a : b : (toList a) ++ (toList b) );
# merges attributes using //, if a name exisits in both attributes
# an error will be triggered unless its listed in mergeLists
# so you can mergeAttrsNoOverride { buildInputs = [a]; } { buildInputs = [a]; } {} to get
# { buildInputs = [a b]; }
# merging buildPhase does'nt really make sense. The cases will be rare where appending /prefixing will fit your needs?
# in these cases the first buildPhase will override the second one
# ! deprecated, use mergeAttrByFunc instead
mergeAttrsNoOverride = { mergeLists ? ["buildInputs" "propagatedBuildInputs"],
overrideSnd ? [ "buildPhase" ]
} : attrs1 : attrs2 :
fold (n: set :
setAttr set n ( if set ? ${n}
then # merge
if elem n mergeLists # attribute contains list, merge them by concatenating
then attrs2.${n} ++ attrs1.${n}
else if elem n overrideSnd
then attrs1.${n}
else throw "error mergeAttrsNoOverride, attribute ${n} given in both attributes - no merge func defined"
else attrs2.${n} # add attribute not existing in attr1
)) attrs1 (attrNames attrs2);
# example usage:
# mergeAttrByFunc {
# inherit mergeAttrBy; # defined below
# buildInputs = [ a b ];
# } {
# buildInputs = [ c d ];
# };
# will result in
# { mergeAttrsBy = [...]; buildInputs = [ a b c d ]; }
# is used by prepareDerivationArgs, defaultOverridableDelayableArgs and can be used when composing using
# foldArgs, composedArgsAndFun or applyAndFun. Example: composableDerivation in all-packages.nix
mergeAttrByFunc = x : y :
let
mergeAttrBy2 = { mergeAttrBy=lib.mergeAttrs; }
// (maybeAttr "mergeAttrBy" {} x)
// (maybeAttr "mergeAttrBy" {} y); in
fold lib.mergeAttrs {} [
x y
(mapAttrs ( a : v : # merge special names using given functions
if x ? ${a}
then if y ? ${a}
then v x.${a} y.${a} # both have attr, use merge func
else x.${a} # only x has attr
else y.${a} # only y has attr)
) (removeAttrs mergeAttrBy2
# don't merge attrs which are neither in x nor y
(filter (a: ! x ? ${a} && ! y ? ${a})
(attrNames mergeAttrBy2))
)
)
];
mergeAttrsByFuncDefaults = foldl mergeAttrByFunc { inherit mergeAttrBy; };
mergeAttrsByFuncDefaultsClean = list: removeAttrs (mergeAttrsByFuncDefaults list) ["mergeAttrBy"];
# merge attrs based on version key into mkDerivation args, see mergeAttrBy to learn about smart merge defaults
#
# This function is best explained by an example:
#
# {version ? "2.x"} :
#
# mkDerivation (mergeAttrsByVersion "package-name" version
# { # version specific settings
# "git" = { src = ..; preConfigre = "autogen.sh"; buildInputs = [automake autoconf libtool]; };
# "2.x" = { src = ..; };
# }
# { // shared settings
# buildInputs = [ common build inputs ];
# meta = { .. }
# }
# )
#
# Please note that e.g. Eelco Dolstra usually prefers having one file for
# each version. On the other hand there are valuable additional design goals
# - readability
# - do it once only
# - try to avoid duplication
#
# Marc Weber and Michael Raskin sometimes prefer keeping older
# versions around for testing and regression tests - as long as its cheap to
# do so.
#
# Very often it just happens that the "shared" code is the bigger part.
# Then using this function might be appropriate.
#
# Be aware that its easy to cause recompilations in all versions when using
# this function - also if derivations get too complex splitting into multiple
# files is the way to go.
#
# See misc.nix -> versionedDerivation
# discussion: nixpkgs: pull/310
mergeAttrsByVersion = name: version: attrsByVersion: base:
mergeAttrsByFuncDefaultsClean [ { name = "${name}-${version}"; } base (maybeAttr version (throw "bad version ${version} for ${name}") attrsByVersion)];
# sane defaults (same name as attr name so that inherit can be used)
mergeAttrBy = # { buildInputs = concatList; [...]; passthru = mergeAttr; [..]; }
listToAttrs (map (n : nameValuePair n lib.concat)
[ "nativeBuildInputs" "buildInputs" "propagatedBuildInputs" "configureFlags" "prePhases" "postAll" "patches" ])
// listToAttrs (map (n : nameValuePair n lib.mergeAttrs) [ "passthru" "meta" "cfg" "flags" ])
// listToAttrs (map (n : nameValuePair n (a: b: "${a}\n${b}") ) [ "preConfigure" "postInstall" ])
;
# prepareDerivationArgs tries to make writing configurable derivations easier
# example:
# prepareDerivationArgs {
# mergeAttrBy = {
# myScript = x : y : x ++ "\n" ++ y;
# };
# cfg = {
# readlineSupport = true;
# };
# flags = {
# readline = {
# set = {
# configureFlags = [ "--with-compiler=${compiler}" ];
# buildInputs = [ compiler ];
# pass = { inherit compiler; READLINE=1; };
# assertion = compiler.dllSupport;
# myScript = "foo";
# };
# unset = { configureFlags = ["--without-compiler"]; };
# };
# };
# src = ...
# buildPhase = '' ... '';
# name = ...
# myScript = "bar";
# };
# if you don't have need for unset you can omit the surrounding set = { .. } attr
# all attrs except flags cfg and mergeAttrBy will be merged with the
# additional data from flags depending on config settings
# It's used in composableDerivation in all-packages.nix. It's also used
# heavily in the new python and libs implementation
#
# should we check for misspelled cfg options?
# TODO use args.mergeFun here as well?
prepareDerivationArgs = args:
let args2 = { cfg = {}; flags = {}; } // args;
flagName = name : "${name}Support";
cfgWithDefaults = (listToAttrs (map (n : nameValuePair (flagName n) false) (attrNames args2.flags)))
// args2.cfg;
opts = attrValues (mapAttrs (a : v :
let v2 = if v ? set || v ? unset then v else { set = v; };
n = if cfgWithDefaults.${flagName a} then "set" else "unset";
attr = maybeAttr n {} v2; in
if (maybeAttr "assertion" true attr)
then attr
else throw "assertion of flag ${a} of derivation ${args.name} failed"
) args2.flags );
in removeAttrs
(mergeAttrsByFuncDefaults ([args] ++ opts ++ [{ passthru = cfgWithDefaults; }]))
["flags" "cfg" "mergeAttrBy" ];
nixType = x:
if isAttrs x then
if x ? outPath then "derivation"
else "aattrs"
else if isFunction x then "function"
else if isList x then "list"
else if x == true then "bool"
else if x == false then "bool"
else if x == null then "null"
else if isInt x then "int"
else "string";
}

View File

@@ -1,466 +1,263 @@
let
lib = import ./default.nix;
spdx = lic: lic // {
url = "http://spdx.org/licenses/${lic.spdxId}";
};
in
lib.mapAttrs (n: v: v // { shortName = n; }) rec {
/* License identifiers from spdx.org where possible.
{
/* License identifiers loosely based on: http://fedoraproject.org/wiki/Licensing
* If you cannot find your license here, then look for a similar license or
* add it to this list. The URL mentioned above is a good source for inspiration.
*/
afl21 = spdx {
spdxId = "AFL-2.1";
fullName = "Academic Free License";
artistic2 = {
shortName = "Artistic 2.0";
fullName = "Artistic 2.0";
url = "http://opensource.org/licenses/artistic-license-2.0.php";
};
agpl3 = spdx {
spdxId = "AGPL-3.0";
fullName = "GNU Affero General Public License v3.0";
agpl3 = {
shortName = "AGPLv3";
fullName = "GNU Affero General Public License version 3 only";
url = https://www.gnu.org/licenses/agpl.html;
};
agpl3Plus = {
fullName = "GNU Affero General Public License v3.0 or later";
inherit (agpl3) url;
};
amazonsl = {
fullName = "Amazon Software License";
url = http://aws.amazon.com/asl/;
free = false;
shortName = "AGPLv3+";
fullName = "GNU Affero General Public License version 3 or later";
url = https://www.gnu.org/licenses/agpl.html;
};
amd = {
shortName = "amd";
fullName = "AMD License Agreement";
url = http://developer.amd.com/amd-license-agreement/;
};
};#
apsl20 = spdx {
spdxId = "APSL-2.0";
apsl20 = {
shortName = "APSL 2.0";
fullName = "Apple Public Source License 2.0";
url = http://opensource.org/licenses/APSL-2.0;
};
artistic1 = spdx {
spdxId = "Artistic-1.0";
fullName = "Artistic License 1.0";
asl20 = {
shortName = "ASL2.0";
fullName = "Apache Software License 2.0";
url = http://www.apache.org/licenses/LICENSE-2.0;
};
artistic2 = spdx {
spdxId = "Artistic-2.0";
fullName = "Artistic License 2.0";
boost = {
shortName = "boost";
fullName = "Boost Software License";
url = http://www.boost.org/LICENSE_1_0.txt;
};
asl20 = spdx {
spdxId = "Apache-2.0";
fullName = "Apache License 2.0";
bsd2 = {
shortName = "BSD-2";
fullName = "BSD license (2 clause)";
url = http://opensource.org/licenses/BSD-2-Clause;
};
boost = spdx {
spdxId = "BSL-1.0";
fullName = "Boost Software License 1.0";
bsd3 = {
shortName = "BSD-3";
fullName = "BSD license (3 clause)";
url = http://opensource.org/licenses/BSD-3-Clause;
};
bsd2 = spdx {
spdxId = "BSD-2-Clause";
fullName = ''BSD 2-clause "Simplified" License'';
bsdOriginal = {
shortName = "BSD-original";
fullName = "Original BSD license with advertising clause";
url = https://fedoraproject.org/wiki/Licensing/BSD;
};
bsd3 = spdx {
spdxId = "BSD-3-Clause";
fullName = ''BSD 3-clause "New" or "Revised" License'';
};
bsdOriginal = spdx {
spdxId = "BSD-4-Clause";
fullName = ''BSD 4-clause "Original" or "Old" License'';
};
cc0 = spdx {
spdxId = "CC0-1.0";
fullName = "Creative Commons Zero v1.0 Universal";
};
cc-by-sa-25 = spdx {
spdxId = "CC-BY-SA-2.5";
fullName = "Creative Commons Attribution Share Alike 2.5";
};
cc-by-30 = spdx {
spdxId = "CC-BY-3.0";
cc-by-30 = {
shortName = "CC BY 3.0";
fullName = "Creative Commons Attribution 3.0";
url = http://creativecommons.org/licenses/by/3.0;
};
cc-by-sa-30 = spdx {
spdxId = "CC-BY-SA-3.0";
fullName = "Creative Commons Attribution Share Alike 3.0";
cddl = {
shortName = "CDDL";
fullName = "Common Development Distribution License ";
url = http://www.opensolaris.org/os/licensing/cddllicense.txt;
};
cc-by-40 = spdx {
spdxId = "CC-BY-4.0";
fullName = "Creative Commons Attribution 4.0";
cpl10 = {
shortName = "CPL 1.0";
fullName = "Common Public License version 1.0";
url = http://www.eclipse.org/legal/cpl-v10.html;
};
cc-by-sa-40 = spdx {
spdxId = "CC-BY-SA-4.0";
fullName = "Creative Commons Attribution Share Alike 4.0";
epl10 = {
shortName = "EPL 1.0";
fullName = "Eclipse Public License version 1.0";
url = http://www.eclipse.org/legal/epl-v10.html;
};
cddl = spdx {
spdxId = "CDDL-1.0";
fullName = "Common Development and Distribution License 1.0";
};
cecill20 = spdx {
spdxId = "CECILL-2.0";
fullName = "CeCILL Free Software License Agreement v2.0";
};
cecill-b = spdx {
spdxId = "CECILL-B";
fullName = "CeCILL-B Free Software License Agreement";
};
cecill-c = spdx {
spdxId = "CECILL-C";
fullName = "CeCILL-C Free Software License Agreement";
};
cpl10 = spdx {
spdxId = "CPL-1.0";
fullName = "Common Public License 1.0";
};
efl10 = spdx {
spdxId = "EFL-1.0";
fullName = "Eiffel Forum License v1.0";
};
efl20 = spdx {
spdxId = "EFL-2.0";
fullName = "Eiffel Forum License v2.0";
};
epl10 = spdx {
spdxId = "EPL-1.0";
fullName = "Eclipse Public License 1.0";
};
fdl12 = spdx {
spdxId = "GFDL-1.2";
fullName = "GNU Free Documentation License v1.2";
};
fdl13 = spdx {
spdxId = "GFDL-1.3";
fullName = "GNU Free Documentation License v1.2";
};
free = {
fullName = "Unspecified free software license";
};
gpl1 = spdx {
spdxId = "GPL-1.0";
fullName = "GNU General Public License v1.0 only";
};
gpl1Plus = spdx {
spdxId = "GPL-1.0+";
fullName = "GNU General Public License v1.0 or later";
};
gpl2 = spdx {
spdxId = "GPL-2.0";
fullName = "GNU General Public License v2.0 only";
};
gpl2ClasspathPlus = {
fullName = "GNU General Public License v2.0 or later (with Classpath exception)";
url = https://fedoraproject.org/wiki/Licensing/GPL_Classpath_Exception;
gpl2 = {
shortName = "GPLv2";
fullName = "GNU General Public License version 2";
url = http://www.gnu.org/licenses/old-licenses/gpl-2.0.html;
};
gpl2Oss = {
shortName = "GPLv2+OSS";
fullName = "GNU General Public License version 2 only (with OSI approved licenses linking exception)";
url = http://www.mysql.com/about/legal/licensing/foss-exception;
};
gpl2Plus = spdx {
spdxId = "GPL-2.0+";
fullName = "GNU General Public License v2.0 or later";
gpl2Plus = {
shortName = "GPLv2+";
fullName = "GNU General Public License version 2 or later";
url = http://www.gnu.org/licenses/old-licenses/gpl-2.0.html;
};
gpl3 = spdx {
spdxId = "GPL-3.0";
fullName = "GNU General Public License v3.0 only";
gpl3 = {
shortName = "GPLv3";
fullName = "GNU General Public License version 3 only";
url = http://www.fsf.org/licensing/licenses/gpl.html;
};
gpl3Plus = spdx {
spdxId = "GPL-3.0+";
fullName = "GNU General Public License v3.0 or later";
gpl3Plus = {
shortName = "GPLv3+";
fullName = "GNU General Public License version 3 or later";
url = http://www.fsf.org/licensing/licenses/gpl.html;
};
gpl3ClasspathPlus = {
fullName = "GNU General Public License v3.0 or later (with Classpath exception)";
shortName = "GPLv3+classpath+";
fullName = "GNU General Public License version 3 or later (with Classpath exception)";
url = https://fedoraproject.org/wiki/Licensing/GPL_Classpath_Exception;
};
# Intel's license, seems free
iasl = {
fullName = "iASL";
url = http://www.calculate-linux.org/packages/licenses/iASL;
isc = {
shortName = "ISC";
fullName = "Internet Systems Consortium License";
url = http://www.opensource.org/licenses/ISC;
};
ijg = spdx {
spdxId = "IJG";
ipl10 = {
shortName = "IPL 1.0";
fullName = "IBM Public License Version 1.0";
url = http://www.ibm.com/developerworks/opensource/library/os-i18n2/os-ipl.html;
};
ijg = {
shortName = "IJG";
fullName = "Independent JPEG Group License";
url = https://fedoraproject.org/wiki/Licensing/IJG;
};
inria = {
fullName = "INRIA Non-Commercial License Agreement";
url = "http://compcert.inria.fr/doc/LICENSE";
libtiff = {
shortName = "libtiff";
fullName = "libtiff license";
url = https://fedoraproject.org/wiki/Licensing/libtiff;
};
ipa = spdx {
spdxId = "IPA";
fullName = "IPA Font License";
lgpl2 = {
shortName = "LGPLv2";
fullName = "GNU Library General Public License version 2";
url = http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html;
};
ipl10 = spdx {
spdxId = "IPL-1.0";
fullName = "IBM Public License v1.0";
lgpl2Plus = {
shortName = "LGPLv2+";
fullName = "GNU Library General Public License version 2 or later";
url = http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html;
};
isc = spdx {
spdxId = "ISC";
fullName = "ISC License";
lgpl21 = {
shortName = "LGPLv2.1";
fullName = "GNU Lesser General Public License version 2.1";
url = http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html;
};
lgpl2 = spdx {
spdxId = "LGPL-2.0";
fullName = "GNU Library General Public License v2 only";
};
lgpl2Plus = spdx {
spdxId = "LGPL-2.0+";
fullName = "GNU Library General Public License v2 or later";
};
lgpl21 = spdx {
spdxId = "LGPL-2.1";
fullName = "GNU Library General Public License v2.1 only";
};
lgpl21Plus = spdx {
spdxId = "LGPL-2.1+";
fullName = "GNU Library General Public License v2.1 or later";
};
lgpl3 = spdx {
spdxId = "LGPL-3.0";
fullName = "GNU Lesser General Public License v3.0 only";
};
lgpl3Plus = spdx {
spdxId = "LGPL-3.0+";
fullName = "GNU Lesser General Public License v3.0 or later";
};
libpng = spdx {
spdxId = "Libpng";
fullName = "libpng License";
};
libtiff = spdx {
spdxId = "libtiff";
fullName = "libtiff License";
lgpl21Plus = {
shortName = "LGPLv2.1+";
fullName = "GNU Lesser General Public License version 2.1 or later";
url = http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html;
};
llgpl21 = {
shortName = "LLGPLv2.1";
fullName = "Lisp LGPL; GNU Lesser General Public License version 2.1 with Franz Inc. preamble for clarification of LGPL terms in context of Lisp";
url = http://opensource.franz.com/preamble.html;
};
lppl12 = spdx {
spdxId = "LPPL-1.2";
fullName = "LaTeX Project Public License v1.2";
lgpl3 = {
shortName = "LGPLv3";
fullName = "GNU Lesser General Public License version 3 only";
url = http://www.fsf.org/licensing/licenses/lgpl.html;
};
lppl13c = spdx {
spdxId = "LPPL-1.3c";
fullName = "LaTeX Project Public License v1.3c";
lgpl3Plus = {
shortName = "LGPLv3+";
fullName = "GNU Lesser General Public License version 3 or later";
url = http://www.fsf.org/licensing/licenses/lgpl.html;
};
lpl-102 = spdx {
spdxId = "LPL-1.02";
fullName = "Lucent Public License v1.02";
mit = {
shortName = "MIT";
fullName = "MIT/X11 license";
url = http://www.opensource.org/licenses/mit-license.php;
};
# spdx.org does not (yet) differentiate between the X11 and Expat versions
# for details see http://en.wikipedia.org/wiki/MIT_License#Various_versions
mit = spdx {
spdxId = "MIT";
fullName = "MIT License";
mpl11 = {
shortName = "MPL1.1";
fullName = "Mozilla Public License version 1.1";
url = http://www.mozilla.org/MPL/MPL-1.1.html;
};
mpl10 = spdx {
spdxId = "MPL-1.0";
fullName = "Mozilla Public License 1.0";
mpl20 = {
shortName = "MPL2.0";
fullName = "Mozilla Public License version 2.0";
url = https://www.mozilla.org/MPL/2.0;
};
mpl11 = spdx {
spdxId = "MPL-1.1";
fullName = "Mozilla Public License 1.1";
};
mpl20 = spdx {
spdxId = "MPL-2.0";
fullName = "Mozilla Public License 2.0";
};
msrla = {
fullName = "Microsoft Research License Agreement";
url = "http://research.microsoft.com/en-us/projects/pex/msr-la.txt";
};
ncsa = spdx {
spdxId = "NCSA";
fullName = "University of Illinois/NCSA Open Source License";
};
notion_lgpl = {
url = "https://raw.githubusercontent.com/raboof/notion/master/LICENSE";
fullName = "Notion modified LGPL";
};
ofl = spdx {
spdxId = "OFL-1.1";
fullName = "SIL Open Font License 1.1";
};
openldap = spdx {
spdxId = "OLDAP-2.8";
fullName = "Open LDAP Public License v2.8";
};
openssl = spdx {
spdxId = "OpenSSL";
fullName = "OpenSSL License";
};
php301 = spdx {
spdxId = "PHP-3.01";
fullName = "PHP License v3.01";
};
postgresql = spdx {
spdxId = "PostgreSQL";
fullName = "PostgreSQL License";
};
psfl = spdx {
spdxId = "Python-2.0";
fullName = "Python Software Foundation License version 2";
#url = http://docs.python.org/license.html;
openssl = {
shortName = "openssl";
fullName = "OpenSSL license";
url = http://www.openssl.org/source/license.html;
};
publicDomain = {
fullName = "Public Domain";
shortName = "Public Domain";
fullname = "Public Domain";
};
qpl = spdx {
spdxId = "QPL-1.0";
fullName = "Q Public License 1.0";
psfl = {
shortName = "PSFL";
fullName = "Python Software Foundation License";
url = http://docs.python.org/license.html;
};
qwt = {
fullName = "Qwt License, Version 1.0";
url = http://qwt.sourceforge.net/qwtlicense.html;
tcltk = {
shortName = "Tcl/Tk";
fullName = "Tcl/Tk license";
url = http://www.tcl.tk/software/tcltk/license.html;
};
ruby = spdx {
spdxId = "Ruby";
fullName = "Ruby License";
unfree = "unfree";
unfreeRedistributable = "unfree-redistributable";
unfreeRedistributableFirmware = "unfree-redistributable-firmware";
zlib = {
shortName = "zlib";
fullName = "zlib license";
url = http://www.gzip.org/zlib/zlib_license.html;
};
sgi-b-20 = spdx {
spdxId = "SGI-B-2.0";
fullName = "SGI Free Software License B v2.0";
};
sleepycat = spdx {
spdxId = "Sleepycat";
fullName = "Sleepycat License";
};
tcltk = spdx {
spdxId = "TCL";
fullName = "TCL/TK License";
};
unfree = {
fullName = "Unfree";
free = false;
};
unfreeRedistributable = {
fullName = "Unfree redistributable";
free = false;
};
unfreeRedistributableFirmware = {
fullName = "Unfree redistributable firmware";
# Note: we currently consider these "free" for inclusion in the
# channel and NixOS images.
};
unlicense = spdx {
spdxId = "Unlicense";
fullName = "The Unlicense";
};
vim = spdx {
spdxId = "Vim";
fullName = "Vim License";
};
vsl10 = spdx {
spdxId = "VSL-1.0";
fullName = "Vovida Software License v1.0";
};
w3c = spdx {
spdxId = "W3C";
fullName = "W3C Software Notice and License";
};
wadalab = {
fullName = "Wadalab Font License";
url = https://fedoraproject.org/wiki/Licensing:Wadalab?rd=Licensing/Wadalab;
};
wtfpl = spdx {
spdxId = "WTFPL";
fullName = "Do What The F*ck You Want To Public License";
};
zlib = spdx {
spdxId = "Zlib";
fullName = "zlib License";
};
zpt20 = spdx { # FIXME: why zpt* instead of zpl*
spdxId = "ZPL-2.0";
zpt20 = {
shortName = "ZPT2.0";
fullName = "Zope Public License 2.0";
url = "http://old.zope.org/Resources/License/ZPL-2.0";
};
zpt21 = spdx {
spdxId = "ZPL-2.1";
zpt21 = {
shortName = "ZPT2.1";
fullName = "Zope Public License 2.1";
url = "http://old.zope.org/Resources/License/ZPL-2.1";
};
sleepycat = {
shortName = "Sleepycat";
fullName = "Sleepycat Public License";
url = "https://en.wikipedia.org/wiki/Sleepycat_License";
};
}

View File

@@ -2,9 +2,15 @@
with import ./trivial.nix;
rec {
let
inherit (builtins) head tail length isList elemAt concatLists filter elem genList;
inc = builtins.add 1;
dec = n: builtins.sub n 1;
in rec {
inherit (builtins) head tail length isList elemAt concatLists filter elem;
# Create a list consisting of a single element. `singleton x' is
@@ -23,7 +29,7 @@ rec {
fold' = n:
if n == len
then nul
else op (elemAt list n) (fold' (n + 1));
else op (elemAt list n) (fold' (inc n));
in fold' 0;
# Left fold: `fold op nul [x_1 x_2 ... x_n] == op (... (op (op nul
@@ -32,30 +38,24 @@ rec {
let
len = length list;
foldl' = n:
if n == -1
if n == minus1
then nul
else op (foldl' (n - 1)) (elemAt list n);
in foldl' (length list - 1);
else op (foldl' (dec n)) (elemAt list n);
in foldl' (dec (length list));
minus1 = dec 0;
# Strict version of foldl.
foldl' = builtins.foldl' or foldl;
# Map with index: `imap (i: v: "${v}-${toString i}") ["a" "b"] ==
# ["a-1" "b-2"]'. FIXME: why does this start to count at 1?
imap =
if builtins ? genList then
f: list: genList (n: f (n + 1) (elemAt list n)) (length list)
else
f: list:
let
len = length list;
imap' = n:
if n == len
then []
else [ (f (n + 1) (elemAt list n)) ] ++ imap' (n + 1);
in imap' 0;
# map with index: `imap (i: v: "${v}-${toString i}") ["a" "b"] ==
# ["a-1" "b-2"]'
imap = f: list:
let
len = length list;
imap' = n:
if n == len
then []
else [ (f (inc n) (elemAt list n)) ] ++ imap' (inc n);
in imap' 0;
# Map and concatenate the result.
@@ -67,7 +67,7 @@ rec {
# == [1 2 3 4 5]' and `flatten 1 == [1]'.
flatten = x:
if isList x
then foldl' (x: y: x ++ (flatten y)) [] x
then fold (x: y: (flatten x) ++ y) [] x
else [x];
@@ -94,17 +94,17 @@ rec {
# Return true iff function `pred' returns true for at least element
# of `list'.
any = builtins.any or (pred: fold (x: y: if pred x then true else y) false);
any = pred: fold (x: y: if pred x then true else y) false;
# Return true iff function `pred' returns true for all elements of
# `list'.
all = builtins.all or (pred: fold (x: y: if pred x then y else false) true);
all = pred: fold (x: y: if pred x then y else false) true;
# Count how many times function `pred' returns true for the elements
# of `list'.
count = pred: foldl' (c: x: if pred x then c + 1 else c) 0;
count = pred: fold (x: c: if pred x then inc c else c) 0;
# Return a singleton list or an empty list, depending on a boolean
@@ -124,17 +124,10 @@ rec {
# Return a list of integers from `first' up to and including `last'.
range =
if builtins ? genList then
first: last:
if first > last
then []
else genList (n: first + n) (last - first + 1)
else
first: last:
if last < first
then []
else [first] ++ range (first + 1) last;
range = first: last:
if lessThan last first
then []
else [first] ++ range (add first 1) last;
# Partition the elements of a list in two lists, `right' and
@@ -147,41 +140,34 @@ rec {
) { right = []; wrong = []; };
zipListsWith =
if builtins ? genList then
f: fst: snd: genList (n: f (elemAt fst n) (elemAt snd n)) (min (length fst) (length snd))
else
f: fst: snd:
let
len = min (length fst) (length snd);
zipListsWith' = n:
if n != len then
[ (f (elemAt fst n) (elemAt snd n)) ]
++ zipListsWith' (n + 1)
else [];
in zipListsWith' 0;
zipListsWith = f: fst: snd:
let
len1 = length fst;
len2 = length snd;
len = if lessThan len1 len2 then len1 else len2;
zipListsWith' = n:
if n != len then
[ (f (elemAt fst n) (elemAt snd n)) ]
++ zipListsWith' (inc n)
else [];
in zipListsWith' 0;
zipLists = zipListsWith (fst: snd: { inherit fst snd; });
# Reverse the order of the elements of a list.
reverseList =
if builtins ? genList then
xs: let l = length xs; in genList (n: elemAt xs (l - n - 1)) l
else
fold (e: acc: acc ++ [ e ]) [];
# Reverse the order of the elements of a list. FIXME: O(n^2)!
reverseList = fold (e: acc: acc ++ [ e ]) [];
# Sort a list based on a comparator function which compares two
# elements and returns true if the first argument is strictly below
# the second argument. The returned list is sorted in an increasing
# order. The implementation does a quick-sort.
sort = builtins.sort or (
strictLess: list:
sort = strictLess: list:
let
len = length list;
first = head list;
pivot' = n: acc@{ left, right }: let el = elemAt list n; next = pivot' (n + 1); in
pivot' = n: acc@{ left, right }: let el = elemAt list n; next = pivot' (inc n); in
if n == len
then acc
else if strictLess first el
@@ -190,84 +176,55 @@ rec {
next { left = [ el ] ++ left; inherit right; };
pivot = pivot' 1 { left = []; right = []; };
in
if len < 2 then list
else (sort strictLess pivot.left) ++ [ first ] ++ (sort strictLess pivot.right));
if lessThan len 2 then list
else (sort strictLess pivot.left) ++ [ first ] ++ (sort strictLess pivot.right);
# Return the first (at most) N elements of a list.
take =
if builtins ? genList then
count: sublist 0 count
else
count: list:
let
len = length list;
take' = n:
if n == len || n == count
then []
else
[ (elemAt list n) ] ++ take' (n + 1);
in take' 0;
take = count: list:
let
len = length list;
take' = n:
if n == len || n == count
then []
else
[ (elemAt list n) ] ++ take' (inc n);
in take' 0;
# Remove the first (at most) N elements of a list.
drop =
if builtins ? genList then
count: list: sublist count (length list) list
else
count: list:
let
len = length list;
drop' = n:
if n == -1 || n < count
then []
else
drop' (n - 1) ++ [ (elemAt list n) ];
in drop' (len - 1);
# Return a list consisting of at most count elements of list,
# starting at index start.
sublist = start: count: list:
let len = length list; in
genList
(n: elemAt list (n + start))
(if start >= len then 0
else if start + count > len then len - start
else count);
drop = count: list:
let
len = length list;
drop' = n:
if n == minus1 || lessThan n count
then []
else
drop' (dec n) ++ [ (elemAt list n) ];
in drop' (dec len);
# Return the last element of a list.
last = list:
assert list != []; elemAt list (length list - 1);
assert list != []; elemAt list (dec (length list));
# Return all elements but the last
init = list: assert list != []; take (length list - 1) list;
# Zip two lists together.
zipTwoLists = xs: ys:
let
len1 = length xs;
len2 = length ys;
len = if lessThan len1 len2 then len1 else len2;
zipTwoLists' = n:
if n != len then
[ { first = elemAt xs n; second = elemAt ys n; } ]
++ zipTwoLists' (inc n)
else [];
in zipTwoLists' 0;
deepSeqList = xs: y: if any (x: deepSeq x false) xs then y else y;
crossLists = f: foldl (fs: args: concatMap (f: map f args) fs) [f];
# Remove duplicate elements from the list. O(n^2) complexity.
unique = list:
if list == [] then
[]
else
let
x = head list;
xs = unique (drop 1 list);
in [x] ++ remove x xs;
# Intersects list 'e' and another list. O(nm) complexity.
intersectLists = e: filter (x: elem x e);
# Subtracts list 'e' from another list. O(nm) complexity.
subtractLists = e: filter (x: !(elem x e));
}

View File

@@ -1,307 +1,101 @@
/* -*- coding: utf-8; -*- */
{
/* Add your name and email address here.
Keep the list alphabetically sorted.
Prefer the same attrname as your github username, please,
so it's easy to ping a package @maintainer.
*/
/* Add your name and email address here. Keep the list
alphabetically sorted. */
a1russell = "Adam Russell <adamlr6+pub@gmail.com>";
abaldeau = "Andreas Baldeau <andreas@baldeau.net>";
abbradar = "Nikolay Amiantov <ab@fmap.me>";
adev = "Adrien Devresse <adev@adev.name>";
_1126 = "Christian Lask <mail@elfsechsundzwanzig.de>";
aforemny = "Alexander Foremny <alexanderforemny@googlemail.com>";
aflatter = "Alexander Flatter <flatter@fastmail.fm>";
aherrmann = "Andreas Herrmann <andreash87@gmx.ch>";
ak = "Alexander Kjeldaas <ak@formalprivacy.com>";
akaWolf = "Artjom Vejsel <akawolf0@gmail.com>";
akc = "Anders Claesson <akc@akc.is>";
algorith = "Dries Van Daele <dries_van_daele@telenet.be>";
all = "Nix Committers <nix-commits@lists.science.uu.nl>";
ambrop72 = "Ambroz Bizjak <ambrop7@gmail.com>";
amiddelk = "Arie Middelkoop <amiddelk@gmail.com>";
amorsillo = "Andrew Morsillo <andrew.morsillo@gmail.com>";
AndersonTorres = "Anderson Torres <torres.anderson.85@gmail.com>";
anderspapitto = "Anders Papitto <anderspapitto@gmail.com>";
andres = "Andres Loeh <ksnixos@andres-loeh.de>";
andrewrk = "Andrew Kelley <superjoe30@gmail.com>";
antono = "Antono Vasiljev <self@antono.info>";
ardumont = "Antoine R. Dumont <eniotna.t@gmail.com>";
aristid = "Aristid Breitkreuz <aristidb@gmail.com>";
arobyn = "Alexei Robyn <shados@shados.net>";
asppsa = "Alastair Pharo <asppsa@gmail.com>";
astsmtl = "Alexander Tsamutali <astsmtl@yandex.ru>";
aszlig = "aszlig <aszlig@redmoonstudios.org>";
auntie = "Jonathan Glines <auntieNeo@gmail.com>";
avnik = "Alexander V. Nikolaev <avn@avnik.info>";
aycanirican = "Aycan iRiCAN <iricanaycan@gmail.com>";
badi = "Badi' Abdul-Wahid <abdulwahidc@gmail.com>";
balajisivaraman = "Balaji Sivaraman<sivaraman.balaji@gmail.com>";
bbenoist = "Baptist BENOIST <return_0@live.com>";
bcarrell = "Brandon Carrell <brandoncarrell@gmail.com>";
bcdarwin = "Ben Darwin <bcdarwin@gmail.com>";
bdimcheff = "Brandon Dimcheff <brandon@dimcheff.com>";
bennofs = "Benno Fünfstück <benno.fuenfstueck@gmail.com>";
benley = "Benjamin Staffin <benley@gmail.com>";
berdario = "Dario Bertini <berdario@gmail.com>";
bergey = "Daniel Bergey <bergey@teallabs.org>";
bjg = "Brian Gough <bjg@gnu.org>";
bjornfor = "Bjørn Forsman <bjorn.forsman@gmail.com>";
bluescreen303 = "Mathijs Kwik <mathijs@bluescreen303.nl>";
bobvanderlinden = "Bob van der Linden <bobvanderlinden@gmail.com>";
bodil = "Bodil Stokke <nix@bodil.org>";
boothead = "Ben Ford <ben@perurbis.com>";
bosu = "Boris Sukholitko <boriss@gmail.com>";
bramd = "Bram Duvigneau <bram@bramd.nl>";
bstrik = "Berno Strik <dutchman55@gmx.com>";
c0dehero = "CodeHero <codehero@nerdpol.ch>";
calrama = "Moritz Maxeiner <moritz@ucworks.org>";
campadrenalin = "Philip Horger <campadrenalin@gmail.com>";
cdepillabout = "Dennis Gosnell <cdep.illabout@gmail.com>";
cfouche = "Chaddaï Fouché <chaddai.fouche@gmail.com>";
chaoflow = "Florian Friesdorf <flo@chaoflow.net>";
chattered = "Phil Scott <me@philscotted.com>";
christopherpoole = "Christopher Mark Poole <mail@christopherpoole.net>";
coconnor = "Corey O'Connor <coreyoconnor@gmail.com>";
codyopel = "Cody Opel <codyopel@gmail.com>";
copumpkin = "Dan Peebles <pumpkingod@gmail.com>";
coroa = "Jonas Hörsch <jonas@chaoflow.net>";
couchemar = "Andrey Pavlov <couchemar@yandex.ru>";
cstrahan = "Charles Strahan <charles.c.strahan@gmail.com>";
cwoac = "Oliver Matthews <oliver@codersoffortune.net>";
DamienCassou = "Damien Cassou <damien@cassou.me>";
davidak = "David Kleuker <post@davidak.de>";
davidrusu = "David Rusu <davidrusu.me@gmail.com>";
dbohdan = "Danyil Bohdan <danyil.bohdan@gmail.com>";
DerGuteMoritz = "Moritz Heidkamp <moritz@twoticketsplease.de>";
deepfire = "Kosyrev Serge <_deepfire@feelingofgreen.ru>";
desiderius = "Didier J. Devroye <didier@devroye.name>";
devhell = "devhell <\"^\"@regexmail.net>";
dezgeg = "Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>";
dfoxfranke = "Daniel Fox Franke <dfoxfranke@gmail.com>";
dmalikov = "Dmitry Malikov <malikov.d.y@gmail.com>";
dochang = "Desmond O. Chang <dochang@gmail.com>";
doublec = "Chris Double <chris.double@double.co.nz>";
ebzzry = "Rommel Martinez <ebzzry@gmail.com>";
ederoyd46 = "Matthew Brown <matt@ederoyd.co.uk>";
eduarrrd = "Eduard Bachmakov <e.bachmakov@gmail.com>";
edwtjo = "Edward Tjörnhammar <ed@cflags.cc>";
eelco = "Eelco Dolstra <eelco.dolstra@logicblox.com>";
eikek = "Eike Kettner <eike.kettner@posteo.de>";
ellis = "Ellis Whitehead <nixos@ellisw.net>";
emery = "Emery Hemingway <emery@vfemail.net>";
enolan = "Echo Nolan <echo@echonolan.net>";
epitrochoid = "Mabry Cervin <mpcervin@uncg.edu>";
ericbmerritt = "Eric Merritt <eric@afiniate.com>";
erikryb = "Erik Rybakken <erik.rybakken@math.ntnu.no>";
emery = "Emery Hemingawy <emery@vfemail.net>";
ertes = "Ertugrul Söylemez <ertesx@gmx.de>";
exlevan = "Alexey Levan <exlevan@gmail.com>";
falsifian = "James Cook <james.cook@utoronto.ca>";
flosse = "Markus Kohlhase <mail@markus-kohlhase.de>";
fluffynukeit = "Daniel Austin <dan@fluffynukeit.com>";
forkk = "Andrew Okin <forkk@forkk.net>";
fpletz = "Franz Pletz <fpletz@fnordicwalking.de>";
fps = "Florian Paul Schmidt <mista.tapas@gmx.net>";
fridh = "Frederik Rietdijk <fridh@fridh.nl>";
fro_ozen = "fro_ozen <fro_ozen@gmx.de>";
ftrvxmtrx = "Siarhei Zirukin <ftrvxmtrx@gmail.com>";
funfunctor = "Edward O'Callaghan <eocallaghan@alterapraxis.com>";
fuuzetsu = "Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>";
gal_bolle = "Florent Becker <florent.becker@ens-lyon.org>";
garbas = "Rok Garbas <rok@garbas.si>";
garrison = "Jim Garrison <jim@garrison.cc>";
gavin = "Gavin Rogers <gavin@praxeology.co.uk>";
gebner = "Gabriel Ebner <gebner@gebner.org>";
gfxmonk = "Tim Cuthbertson <tim@gfxmonk.net>";
giogadi = "Luis G. Torres <lgtorres42@gmail.com>";
globin = "Robin Gloster <robin@glob.in>";
goibhniu = "Cillian de Róiste <cillian.deroiste@gmail.com>";
gridaphobe = "Eric Seidel <eric@seidel.io>";
guibert = "David Guibert <david.guibert@gmail.com>";
havvy = "Ryan Scheel <ryan.havvy@gmail.com>";
hbunke = "Hendrik Bunke <bunke.hendrik@gmail.com>";
henrytill = "Henry Till <henrytill@gmail.com>";
hiberno = "Christian Lask <mail@elfsechsundzwanzig.de>";
hinton = "Tom Hinton <t@larkery.com>";
hrdinka = "Christoph Hrdinka <c.nix@hrdinka.at>";
iand675 = "Ian Duncan <ian@iankduncan.com>";
ianwookim = "Ian-Woo Kim <ianwookim@gmail.com>";
iElectric = "Domen Kozar <domen@dev.si>";
ikervagyok = "Balázs Lengyel <ikervagyok@gmail.com>";
iyzsong = "Song Wenwu <iyzsong@gmail.com>";
j-keck = "Jürgen Keck <jhyphenkeck@gmail.com>";
jagajaga = "Arseniy Seroka <ars.seroka@gmail.com>";
javaguirre = "Javier Aguirre <contacto@javaguirre.net>";
jb55 = "William Casarin <bill@casarin.me>";
jcumming = "Jack Cummings <jack@mudshark.org>";
jefdaj = "Jeffrey David Johnson <jefdaj@gmail.com>";
jfb = "James Felix Black <james@yamtime.com>";
jgeerds = "Jascha Geerds <jg@ekby.de>";
jirkamarsik = "Jirka Marsik <jiri.marsik89@gmail.com>";
joachifm = "Joachim Fasting <joachifm@fastmail.fm>";
joamaki = "Jussi Maki <joamaki@gmail.com>";
joelmo = "Joel Moberg <joel.moberg@gmail.com>";
joelteon = "Joel Taylor <me@joelt.io>";
jpbernardy = "Jean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com>";
jwiegley = "John Wiegley <johnw@newartisans.com>";
jwilberding = "Jordan Wilberding <jwilberding@afiniate.com>";
jzellner = "Jeff Zellner <jeffz@eml.cc>";
kamilchm = "Kamil Chmielewski <kamil.chm@gmail.com>";
kampfschlaefer = "Arnold Krille <arnold@arnoldarts.de>";
khumba = "Bryan Gardiner <bog@khumba.net>";
kkallio = "Karn Kallio <tierpluspluslists@gmail.com>";
koral = "Koral <koral@mailoo.org>";
kovirobi = "Kovacsics Robert <kovirobi@gmail.com>";
kragniz = "Louis Taylor <louis@kragniz.eu>";
ktosiek = "Tomasz Kontusz <tomasz.kontusz@gmail.com>";
lassulus = "Lassulus <lassulus@gmail.com>";
layus = "Guillaume Maudoux <layus.on@gmail.com>";
lebastr = "Alexander Lebedev <lebastr@gmail.com>";
leonardoce = "Leonardo Cecchi <leonardo.cecchi@gmail.com>";
lethalman = "Luca Bruno <lucabru@src.gnome.org>";
lhvwb = "Nathaniel Baxter <nathaniel.baxter@gmail.com>";
lihop = "Leroy Hopson <nixos@leroy.geek.nz>";
linquize = "Linquize <linquize@yahoo.com.hk>";
linus = "Linus Arver <linusarver@gmail.com>";
lnl7 = "Daiderd Jordan <daiderd@gmail.com>";
lovek323 = "Jason O'Conal <jason@oconal.id.au>";
lowfatcomputing = "Andreas Wagner <andreas.wagner@lowfatcomputing.org>";
lsix = "Lancelot SIX <lsix@lancelotsix.com>";
ludo = "Ludovic Courtès <ludo@gnu.org>";
lukego = "Luke Gorrie <luke@snabb.co>";
madjar = "Georges Dubus <georges.dubus@compiletoi.net>";
magnetophon = "Bart Brouns <bart@magnetophon.nl>";
mahe = "Matthias Herrmann <matthias.mh.herrmann@gmail.com>";
makefu = "Felix Richter <makefu@syntax-fehler.de>";
malyn = "Michael Alyn Miller <malyn@strangeGizmo.com>";
manveru = "Michael Fellinger <m.fellinger@gmail.com>";
marcweber = "Marc Weber <marco-oweber@gmx.de>";
maurer = "Matthew Maurer <matthew.r.maurer+nix@gmail.com>";
matejc = "Matej Cotman <cotman.matej@gmail.com>";
mathnerd314 = "Mathnerd314 <mathnerd314.gph+hs@gmail.com>";
matthiasbeyer = "Matthias Beyer <mail@beyermatthias.de>";
mbakke = "Marius Bakke <ymse@tuta.io>";
meditans = "Carlo Nucera <meditans@gmail.com>";
meisternu = "Matt Miemiec <meister@krutt.org>";
michelk = "Michel Kuhlmann <michel@kuhlmanns.info>";
michaelpj = "Michael Peyton Jones <michaelpj@gmail.com>";
mirdhyn = "Merlin Gaillard <mirdhyn@gmail.com>";
mschristiansen = "Mikkel Christiansen <mikkel@rheosystems.com>";
modulistic = "Pablo Costa <modulistic@gmail.com>";
mornfall = "Petr Ročkai <me@mornfall.net>";
MP2E = "Cray Elliott <MP2E@archlinux.us>";
msackman = "Matthew Sackman <matthew@wellquite.org>";
mtreskin = "Max Treskin <zerthurd@gmail.com>";
mudri = "James Wood <lamudri@gmail.com>";
muflax = "Stefan Dorn <mail@muflax.com>";
nathan-gs = "Nathan Bijnens <nathan@nathan.gs>";
nckx = "Tobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>";
nico202 = "Nicolò Balzarotti <anothersms@gmail.com>";
notthemessiah = "Brian Cohen <brian.cohen.88@gmail.com>";
np = "Nicolas Pouillard <np.nix@nicolaspouillard.fr>";
nslqqq = "Nikita Mikhailov <nslqqq@gmail.com>";
obadz = "obadz <dav-nixos@odav.org>";
ocharles = "Oliver Charles <ollie@ocharles.org.uk>";
odi = "Oliver Dunkl <oliver.dunkl@gmail.com>";
offline = "Jaka Hudoklin <jakahudoklin@gmail.com>";
olcai = "Erik Timan <dev@timan.info>";
orbitz = "Malcolm Matalka <mmatalka@gmail.com>";
osener = "Ozan Sener <ozan@ozansener.com>";
page = "Carles Pagès <page@cubata.homelinux.net>";
paholg = "Paho Lurie-Gregg <paho@paholg.com>";
pakhfn = "Fedor Pakhomov <pakhfn@gmail.com>";
pashev = "Igor Pashev <pashev.igor@gmail.com>";
pesterhazy = "Paulus Esterhazy <pesterhazy@gmail.com>";
phausmann = "Philipp Hausmann <nix@314.ch>";
philandstuff = "Philip Potter <philip.g.potter@gmail.com>";
phreedom = "Evgeny Egorochkin <phreedom@yandex.ru>";
pierron = "Nicolas B. Pierron <nixos@nbp.name>";
piotr = "Piotr Pietraszkiewicz <ppietrasa@gmail.com>";
pjones = "Peter Jones <pjones@devalot.com>";
pkmx = "Chih-Mao Chen <pkmx.tw@gmail.com>";
plcplc = "Philip Lykke Carlsen <plcplc@gmail.com>";
pmahoney = "Patrick Mahoney <pat@polycrystal.org>";
pmiddend = "Philipp Middendorf <pmidden@secure.mailbox.org>";
prikhi = "Pavan Rikhi <pavan.rikhi@gmail.com>";
psibi = "Sibi <sibi@psibi.in>";
pSub = "Pascal Wittmann <mail@pascal-wittmann.de>";
puffnfresh = "Brian McKenna <brian@brianmckenna.org>";
qknight = "Joachim Schiele <js@lastlog.de>";
ragge = "Ragnar Dahlen <r.dahlen@gmail.com>";
raskin = "Michael Raskin <7c6f434c@mail.ru>";
redbaron = "Maxim Ivanov <ivanov.maxim@gmail.com>";
refnil = "Martin Lavoie <broemartino@gmail.com>";
relrod = "Ricky Elrod <ricky@elrod.me>";
renzo = "Renzo Carbonara <renzocarbonara@gmail.com>";
rick68 = "Wei-Ming Yang <rick68@gmail.com>";
rickynils = "Rickard Nilsson <rickynils@gmail.com>";
rob = "Rob Vermaas <rob.vermaas@gmail.com>";
robberer = "Longrin Wischnewski <robberer@freakmail.de>";
robbinch = "Robbin C. <robbinch33@gmail.com>";
roconnor = "Russell O'Connor <roconnor@theorem.ca>";
roelof = "Roelof Wobben <rwobben@hotmail.com>";
romildo = "José Romildo Malaquias <malaquias@gmail.com>";
rszibele = "Richard Szibele <richard_szibele@hotmail.com>";
rushmorem = "Rushmore Mushambi <rushmore@webenchanter.com>";
rycee = "Robert Helgesson <robert@rycee.net>";
samuelrivas = "Samuel Rivas <samuelrivas@gmail.com>";
sander = "Sander van der Burg <s.vanderburg@tudelft.nl>";
schmitthenner = "Fabian Schmitthenner <development@schmitthenner.eu>";
schristo = "Scott Christopher <schristopher@konputa.com>";
sepi = "Raffael Mancini <raffael@mancini.lu>";
sheganinans = "Aistis Raulinaitis <sheganinans@gmail.com>";
shell = "Shell Turner <cam.turn@gmail.com>";
shlevy = "Shea Levy <shea@shealevy.com>";
simons = "Peter Simons <simons@cryp.to>";
simonvandel = "Simon Vandel Sillesen <simon.vandel@gmail.com>";
sjagoe = "Simon Jagoe <simon@simonjagoe.com>";
sjmackenzie = "Stewart Mackenzie <setori88@gmail.com>";
skeidel = "Sven Keidel <svenkeidel@gmail.com>";
smironov = "Sergey Mironov <ierton@gmail.com>";
spacefrogg = "Michael Raitza <spacefrogg-nixos@meterriblecrew.net>";
sprock = "Roger Mason <rmason@mun.ca>";
spwhitt = "Spencer Whitt <sw@swhitt.me>";
stephenmw = "Stephen Weinberg <stephen@q5comm.com>";
szczyp = "Szczyp <qb@szczyp.com>";
sztupi = "Attila Sztupak <attila.sztupak@gmail.com>";
tailhook = "Paul Colomiets <paul@colomiets.name>";
taktoa = "Remy Goldschmidt <taktoa@gmail.com>";
telotortium = "Robert Irelan <rirelan@gmail.com>";
thammers = "Tobias Hammerschmidt <jawr@gmx.de>";
the-kenny = "Moritz Ulrich <moritz@tarn-vedra.de>";
theuni = "Christian Theune <ct@flyingcircus.io>";
thoughtpolice = "Austin Seipp <aseipp@pobox.com>";
titanous = "Jonathan Rudenberg <jonathan@titanous.com>";
tomberek = "Thomas Bereknyei <tomberek@gmail.com>";
travisbhartwell = "Travis B. Hartwell <nafai@travishartwell.net>";
trino = "Hubert Mühlhans <muehlhans.hubert@ekodia.de>";
tstrobel = "Thomas Strobel <ts468@cam.ac.uk>";
ttuegel = "Thomas Tuegel <ttuegel@gmail.com>";
tv = "Tomislav Viljetić <tv@shackspace.de>";
twey = "James Twey Kay <twey@twey.co.uk>";
urkud = "Yury G. Kudryashov <urkud+nix@ya.ru>";
vandenoever = "Jos van den Oever <jos@vandenoever.info>";
vbgl = "Vincent Laporte <Vincent.Laporte@gmail.com>";
vbmithr = "Vincent Bernardoff <vb@luminar.eu.org>";
vcunat = "Vladimír Čunát <vcunat@gmail.com>";
viric = "Lluís Batlle i Rossell <viric@viric.name>";
vizanto = "Danny Wilson <danny@prime.vc>";
vlstill = "Vladimír Štill <xstill@fi.muni.cz>";
vmandela = "Venkateswara Rao Mandela <venkat.mandela@gmail.com>";
vozz = "Oliver Hunt <oliver.huntuk@gmail.com>";
winden = "Antonio Vargas Gonzalez <windenntw@gmail.com>";
wizeman = "Ricardo M. Correia <rcorreia@wizy.org>";
wjlroe = "William Roe <willroe@gmail.com>";
womfoo = "Kranium Gikos Mendoza <kranium@gikos.net>";
wkennington = "William A. Kennington III <william@wkennington.com>";
wmertens = "Wout Mertens <Wout.Mertens@gmail.com>";
wscott = "Wayne Scott <wsc9tt@gmail.com>";
wyvie = "Elijah Rum <elijahrum@gmail.com>";
yarr = "Dmitry V. <savraz@gmail.com>";
z77z = "Marco Maggesi <maggesi@math.unifi.it>";
zef = "Zef Hemel <zef@zef.me>";
zimbatm = "zimbatm <zimbatm@zimbatm.com>";
zoomulator = "Kim Simmons <zoomulator@gmail.com>";
Gonzih = "Max Gonzih <gonzih@gmail.com>";
}

429
lib/misc.nix Normal file
View File

@@ -0,0 +1,429 @@
let lib = import ./default.nix;
inherit (builtins) isFunction hasAttr getAttr head tail isList isAttrs isInt attrNames;
in
with import ./lists.nix;
with import ./attrsets.nix;
with import ./strings.nix;
rec {
# returns default if env var is not set
maybeEnv = name: default:
let value = builtins.getEnv name; in
if value == "" then default else value;
defaultMergeArg = x : y: if builtins.isAttrs y then
y
else
(y x);
defaultMerge = x: y: x // (defaultMergeArg x y);
foldArgs = merger: f: init: x:
let arg=(merger init (defaultMergeArg init x));
# now add the function with composed args already applied to the final attrs
base = (setAttrMerge "passthru" {} (f arg)
( z : z // rec {
function = foldArgs merger f arg;
args = (lib.attrByPath ["passthru" "args"] {} z) // x;
} ));
withStdOverrides = base // {
override = base.passthru.function;
deepOverride = a : (base.passthru.function ((lib.mapAttrs (lib.deepOverrider a) base.passthru.args) // a));
} ;
in
withStdOverrides;
# predecessors: proposed replacement for applyAndFun (which has a bug cause it merges twice)
# the naming "overridableDelayableArgs" tries to express that you can
# - override attr values which have been supplied earlier
# - use attr values before they have been supplied by accessing the fix point
# name "fixed"
# f: the (delayed overridden) arguments are applied to this
#
# initial: initial attrs arguments and settings. see defaultOverridableDelayableArgs
#
# returns: f applied to the arguments // special attributes attrs
# a) merge: merge applied args with new args. Wether an argument is overridden depends on the merge settings
# b) replace: this let's you replace and remove names no matter which merge function has been set
#
# examples: see test cases "res" below;
overridableDelayableArgs =
f : # the function applied to the arguments
initial : # you pass attrs, the functions below are passing a function taking the fix argument
let
takeFixed = if isFunction initial then initial else (fixed : initial); # transform initial to an expression always taking the fixed argument
tidy = args :
let # apply all functions given in "applyPreTidy" in sequence
applyPreTidyFun = fold ( n : a : x : n ( a x ) ) lib.id (maybeAttr "applyPreTidy" [] args);
in removeAttrs (applyPreTidyFun args) ( ["applyPreTidy"] ++ (maybeAttr "removeAttrs" [] args) ); # tidy up args before applying them
fun = n : x :
let newArgs = fixed :
let args = takeFixed fixed;
mergeFun = getAttr n args;
in if isAttrs x then (mergeFun args x)
else assert isFunction x;
mergeFun args (x ( args // { inherit fixed; }));
in overridableDelayableArgs f newArgs;
in
(f (tidy (lib.fix takeFixed))) // {
merge = fun "mergeFun";
replace = fun "keepFun";
};
defaultOverridableDelayableArgs = f :
let defaults = {
mergeFun = mergeAttrByFunc; # default merge function. merge strategie (concatenate lists, strings) is given by mergeAttrBy
keepFun = a : b : { inherit (a) removeAttrs mergeFun keepFun mergeAttrBy; } // b; # even when using replace preserve these values
applyPreTidy = []; # list of functions applied to args before args are tidied up (usage case : prepareDerivationArgs)
mergeAttrBy = mergeAttrBy // {
applyPreTidy = a : b : a ++ b;
removeAttrs = a : b: a ++ b;
};
removeAttrs = ["mergeFun" "keepFun" "mergeAttrBy" "removeAttrs" "fixed" ]; # before applying the arguments to the function make sure these names are gone
};
in (overridableDelayableArgs f defaults).merge;
# rec { # an example of how composedArgsAndFun can be used
# a = composedArgsAndFun (x : x) { a = ["2"]; meta = { d = "bar";}; };
# # meta.d will be lost ! It's your task to preserve it (eg using a merge function)
# b = a.passthru.function { a = [ "3" ]; meta = { d2 = "bar2";}; };
# # instead of passing/ overriding values you can use a merge function:
# c = b.passthru.function ( x: { a = x.a ++ ["4"]; }); # consider using (maybeAttr "a" [] x)
# }
# result:
# {
# a = { a = ["2"]; meta = { d = "bar"; }; passthru = { function = .. }; };
# b = { a = ["3"]; meta = { d2 = "bar2"; }; passthru = { function = .. }; };
# c = { a = ["3" "4"]; meta = { d2 = "bar2"; }; passthru = { function = .. }; };
# # c2 is equal to c
# }
composedArgsAndFun = f: foldArgs defaultMerge f {};
# shortcut for attrByPath ["name"] default attrs
maybeAttrNullable = name: default: attrs:
if attrs == null then default else
if __hasAttr name attrs then (__getAttr name attrs) else default;
# shortcut for attrByPath ["name"] default attrs
maybeAttr = name: default: attrs:
if __hasAttr name attrs then (__getAttr name attrs) else default;
# Return the second argument if the first one is true or the empty version
# of the second argument.
ifEnable = cond: val:
if cond then val
else if builtins.isList val then []
else if builtins.isAttrs val then {}
# else if builtins.isString val then ""
else if val == true || val == false then false
else null;
# Return true only if there is an attribute and it is true.
checkFlag = attrSet: name:
if name == "true" then true else
if name == "false" then false else
if (elem name (attrByPath ["flags"] [] attrSet)) then true else
attrByPath [name] false attrSet ;
# Input : attrSet, [ [name default] ... ], name
# Output : its value or default.
getValue = attrSet: argList: name:
( attrByPath [name] (if checkFlag attrSet name then true else
if argList == [] then null else
let x = builtins.head argList; in
if (head x) == name then
(head (tail x))
else (getValue attrSet
(tail argList) name)) attrSet );
# Input : attrSet, [[name default] ...], [ [flagname reqs..] ... ]
# Output : are reqs satisfied? It's asserted.
checkReqs = attrSet : argList : condList :
(
fold lib.and true
(map (x: let name = (head x) ; in
((checkFlag attrSet name) ->
(fold lib.and true
(map (y: let val=(getValue attrSet argList y); in
(val!=null) && (val!=false))
(tail x))))) condList)) ;
# This function has O(n^2) performance.
uniqList = {inputList, acc ? []} :
let go = xs : acc :
if xs == []
then []
else let x = head xs;
y = if elem x acc then [] else [x];
in y ++ go (tail xs) (y ++ acc);
in go inputList acc;
uniqListExt = {inputList, outputList ? [],
getter ? (x : x), compare ? (x: y: x==y)}:
if inputList == [] then outputList else
let x=head inputList;
isX = y: (compare (getter y) (getter x));
newOutputList = outputList ++
(if any isX outputList then [] else [x]);
in uniqListExt {outputList=newOutputList;
inputList = (tail inputList);
inherit getter compare;
};
condConcat = name: list: checker:
if list == [] then name else
if checker (head list) then
condConcat
(name + (head (tail list)))
(tail (tail list))
checker
else condConcat
name (tail (tail list)) checker;
lazyGenericClosure = {startSet, operator}:
let
work = list: doneKeys: result:
if list == [] then
result
else
let x = head list; key = x.key; in
if elem key doneKeys then
work (tail list) doneKeys result
else
work (tail list ++ operator x) ([key] ++ doneKeys) ([x] ++ result);
in
work startSet [] [];
genericClosure = builtins.genericClosure or lazyGenericClosure;
innerModifySumArgs = f: x: a: b: if b == null then (f a b) // x else
innerModifySumArgs f x (a // b);
modifySumArgs = f: x: innerModifySumArgs f x {};
innerClosePropagation = acc : xs :
if xs == []
then acc
else let y = head xs;
ys = tail xs;
in if ! isAttrs y
then innerClosePropagation acc ys
else let acc' = [y] ++ acc;
in innerClosePropagation
acc'
(uniqList { inputList = (maybeAttrNullable "propagatedBuildInputs" [] y)
++ (maybeAttrNullable "propagatedNativeBuildInputs" [] y)
++ ys;
acc = acc';
}
);
closePropagation = list: (uniqList {inputList = (innerClosePropagation [] list);});
# calls a function (f attr value ) for each record item. returns a list
mapAttrsFlatten = f : r : map (attr: f attr (builtins.getAttr attr r) ) (attrNames r);
# attribute set containing one attribute
nvs = name : value : listToAttrs [ (nameValuePair name value) ];
# adds / replaces an attribute of an attribute set
setAttr = set : name : v : set // (nvs name v);
# setAttrMerge (similar to mergeAttrsWithFunc but only merges the values of a particular name)
# setAttrMerge "a" [] { a = [2];} (x : x ++ [3]) -> { a = [2 3]; }
# setAttrMerge "a" [] { } (x : x ++ [3]) -> { a = [ 3]; }
setAttrMerge = name : default : attrs : f :
setAttr attrs name (f (maybeAttr name default attrs));
# Using f = a : b = b the result is similar to //
# merge attributes with custom function handling the case that the attribute
# exists in both sets
mergeAttrsWithFunc = f : set1 : set2 :
fold (n: set : if (__hasAttr n set)
then setAttr set n (f (__getAttr n set) (__getAttr n set2))
else set )
(set2 // set1) (__attrNames set2);
# merging two attribute set concatenating the values of same attribute names
# eg { a = 7; } { a = [ 2 3 ]; } becomes { a = [ 7 2 3 ]; }
mergeAttrsConcatenateValues = mergeAttrsWithFunc ( a : b : (toList a) ++ (toList b) );
# merges attributes using //, if a name exisits in both attributes
# an error will be triggered unless its listed in mergeLists
# so you can mergeAttrsNoOverride { buildInputs = [a]; } { buildInputs = [a]; } {} to get
# { buildInputs = [a b]; }
# merging buildPhase does'nt really make sense. The cases will be rare where appending /prefixing will fit your needs?
# in these cases the first buildPhase will override the second one
# ! deprecated, use mergeAttrByFunc instead
mergeAttrsNoOverride = { mergeLists ? ["buildInputs" "propagatedBuildInputs"],
overrideSnd ? [ "buildPhase" ]
} : attrs1 : attrs2 :
fold (n: set :
setAttr set n ( if (__hasAttr n set)
then # merge
if elem n mergeLists # attribute contains list, merge them by concatenating
then (__getAttr n attrs2) ++ (__getAttr n attrs1)
else if elem n overrideSnd
then __getAttr n attrs1
else throw "error mergeAttrsNoOverride, attribute ${n} given in both attributes - no merge func defined"
else __getAttr n attrs2 # add attribute not existing in attr1
)) attrs1 (__attrNames attrs2);
# example usage:
# mergeAttrByFunc {
# inherit mergeAttrBy; # defined below
# buildInputs = [ a b ];
# } {
# buildInputs = [ c d ];
# };
# will result in
# { mergeAttrsBy = [...]; buildInputs = [ a b c d ]; }
# is used by prepareDerivationArgs, defaultOverridableDelayableArgs and can be used when composing using
# foldArgs, composedArgsAndFun or applyAndFun. Example: composableDerivation in all-packages.nix
mergeAttrByFunc = x : y :
let
mergeAttrBy2 = { mergeAttrBy=lib.mergeAttrs; }
// (maybeAttr "mergeAttrBy" {} x)
// (maybeAttr "mergeAttrBy" {} y); in
fold lib.mergeAttrs {} [
x y
(mapAttrs ( a : v : # merge special names using given functions
if (hasAttr a x)
then if (hasAttr a y)
then v (getAttr a x) (getAttr a y) # both have attr, use merge func
else (getAttr a x) # only x has attr
else (getAttr a y) # only y has attr)
) (removeAttrs mergeAttrBy2
# don't merge attrs which are neither in x nor y
(filter (a : (! hasAttr a x) && (! hasAttr a y) )
(attrNames mergeAttrBy2))
)
)
];
mergeAttrsByFuncDefaults = foldl mergeAttrByFunc { inherit mergeAttrBy; };
mergeAttrsByFuncDefaultsClean = list: removeAttrs (mergeAttrsByFuncDefaults list) ["mergeAttrBy"];
# merge attrs based on version key into mkDerivation args, see mergeAttrBy to learn about smart merge defaults
#
# This function is best explained by an example:
#
# {version ? "2.x"} :
#
# mkDerivation (mergeAttrsByVersion "package-name" version
# { # version specific settings
# "git" = { src = ..; preConfigre = "autogen.sh"; buildInputs = [automake autoconf libtool]; };
# "2.x" = { src = ..; };
# }
# { // shared settings
# buildInputs = [ common build inputs ];
# meta = { .. }
# }
# )
#
# Please note that e.g. Eelco Dolstra usually prefers having one file for
# each version. On the other hand there are valuable additional design goals
# - readability
# - do it once only
# - try to avoid duplication
#
# Marc Weber and Michael Raskin sometimes prefer keeping older
# versions around for testing and regression tests - as long as its cheap to
# do so.
#
# Very often it just happens that the "shared" code is the bigger part.
# Then using this function might be appropriate.
#
# Be aware that its easy to cause recompilations in all versions when using
# this function - also if derivations get too complex splitting into multiple
# files is the way to go.
#
# See misc.nix -> versionedDerivation
# discussion: nixpkgs: pull/310
mergeAttrsByVersion = name: version: attrsByVersion: base:
mergeAttrsByFuncDefaultsClean [ { name = "${name}-${version}"; } base (maybeAttr version (throw "bad version ${version} for ${name}") attrsByVersion)];
# sane defaults (same name as attr name so that inherit can be used)
mergeAttrBy = # { buildInputs = concatList; [...]; passthru = mergeAttr; [..]; }
listToAttrs (map (n : nameValuePair n lib.concat)
[ "nativeBuildInputs" "buildInputs" "propagatedBuildInputs" "configureFlags" "prePhases" "postAll" "patches" ])
// listToAttrs (map (n : nameValuePair n lib.mergeAttrs) [ "passthru" "meta" "cfg" "flags" ])
// listToAttrs (map (n : nameValuePair n (a: b: "${a}\n${b}") ) [ "preConfigure" "postInstall" ])
;
# prepareDerivationArgs tries to make writing configurable derivations easier
# example:
# prepareDerivationArgs {
# mergeAttrBy = {
# myScript = x : y : x ++ "\n" ++ y;
# };
# cfg = {
# readlineSupport = true;
# };
# flags = {
# readline = {
# set = {
# configureFlags = [ "--with-compiler=${compiler}" ];
# buildInputs = [ compiler ];
# pass = { inherit compiler; READLINE=1; };
# assertion = compiler.dllSupport;
# myScript = "foo";
# };
# unset = { configureFlags = ["--without-compiler"]; };
# };
# };
# src = ...
# buildPhase = '' ... '';
# name = ...
# myScript = "bar";
# };
# if you don't have need for unset you can omit the surrounding set = { .. } attr
# all attrs except flags cfg and mergeAttrBy will be merged with the
# additional data from flags depending on config settings
# It's used in composableDerivation in all-packages.nix. It's also used
# heavily in the new python and libs implementation
#
# should we check for misspelled cfg options?
# TODO use args.mergeFun here as well?
prepareDerivationArgs = args:
let args2 = { cfg = {}; flags = {}; } // args;
flagName = name : "${name}Support";
cfgWithDefaults = (listToAttrs (map (n : nameValuePair (flagName n) false) (attrNames args2.flags)))
// args2.cfg;
opts = attrValues (mapAttrs (a : v :
let v2 = if v ? set || v ? unset then v else { set = v; };
n = if (getAttr (flagName a) cfgWithDefaults) then "set" else "unset";
attr = maybeAttr n {} v2; in
if (maybeAttr "assertion" true attr)
then attr
else throw "assertion of flag ${a} of derivation ${args.name} failed"
) args2.flags );
in removeAttrs
(mergeAttrsByFuncDefaults ([args] ++ opts ++ [{ passthru = cfgWithDefaults; }]))
["flags" "cfg" "mergeAttrBy" ];
nixType = x:
if isAttrs x then
if x ? outPath then "derivation"
else "aattrs"
else if isFunction x then "function"
else if isList x then "list"
else if x == true then "bool"
else if x == false then "bool"
else if x == null then "null"
else if isInt x then "int"
else "string";
}

View File

@@ -9,76 +9,28 @@ rec {
/* Evaluate a set of modules. The result is a set of two
attributes: options: the nested set of all option declarations,
and config: the nested set of all option values.
!!! Please think twice before adding to this argument list! The more
that is specified here instead of in the modules themselves the harder
it is to transparently move a set of modules to be a submodule of another
config (as the proper arguments need to be replicated at each call to
evalModules) and the less declarative the module set is. */
evalModules = { modules
, prefix ? []
, # This should only be used for special arguments that need to be evaluated
# when resolving module structure (like in imports). For everything else,
# there's _module.args.
specialArgs ? {}
, # This would be remove in the future, Prefer _module.args option instead.
args ? {}
, # This would be remove in the future, Prefer _module.check option instead.
check ? true
}:
and config: the nested set of all option values. */
evalModules = { modules, prefix ? [], args ? {}, check ? true }:
let
# This internal module declare internal options under the `_module'
# attribute. These options are fragile, as they are used by the
# module system to change the interpretation of modules.
internalModule = rec {
_file = ./modules.nix;
key = _file;
options = {
_module.args = mkOption {
type = types.attrsOf types.unspecified;
internal = true;
description = "Arguments passed to each module.";
};
_module.check = mkOption {
type = types.bool;
internal = true;
default = check;
description = "Whether to check whether all option definitions have matching declarations.";
};
};
config = {
_module.args = args;
};
};
closed = closeModules (modules ++ [ internalModule ]) ({ inherit config options; lib = import ./.; } // specialArgs);
args' = args // { lib = import ./.; } // result;
closed = closeModules modules args';
# Note: the list of modules is reversed to maintain backward
# compatibility with the old module system. Not sure if this is
# the most sensible policy.
options = mergeModules prefix (reverseList closed);
# Traverse options and extract the option values into the final
# config set. At the same time, check whether all option
# definitions have matching declarations.
# !!! _module.check's value can't depend on any other config values
# without an infinite recursion. One way around this is to make the
# 'config' passed around to the modules be unconditionally unchecked,
# and only do the check in 'result'.
config = yieldConfig prefix options;
yieldConfig = prefix: set:
let res = removeAttrs (mapAttrs (n: v:
if isOption v then v.value
else yieldConfig (prefix ++ [n]) v) set) ["_definedNames"];
in
if options._module.check.value && set ? _definedNames then
foldl' (res: m:
foldl' (res: name:
if set ? ${name} then res else throw "The option `${showOption (prefix ++ [name])}' defined in `${m.file}' does not exist.")
if check && set ? _definedNames then
fold (m: res:
fold (name: res:
if hasAttr name set then res else throw "The option `${showOption (prefix ++ [name])}' defined in `${m.file}' does not exist.")
res m.names)
res set._definedNames
else
@@ -91,11 +43,9 @@ rec {
let
toClosureList = file: parentKey: imap (n: x:
if isAttrs x || isFunction x then
let key = "${parentKey}:anon-${toString n}"; in
unifyModuleSyntax file key (unpackSubmodule (applyIfFunction key) x args)
unifyModuleSyntax file "${parentKey}:anon-${toString n}" (applyIfFunction x args)
else
let file = toString x; key = toString x; in
unifyModuleSyntax file key (applyIfFunction key (import x) args));
unifyModuleSyntax (toString x) (toString x) (applyIfFunction (import x) args));
in
builtins.genericClosure {
startSet = toClosureList unknownModule "" modules;
@@ -108,7 +58,7 @@ rec {
if m ? config || m ? options then
let badAttrs = removeAttrs m ["imports" "options" "config" "key" "_file"]; in
if badAttrs != {} then
throw "Module `${key}' has an unsupported attribute `${head (attrNames badAttrs)}'. This is caused by assignments to the top-level attributes `config' or `options'."
throw "Module `${key}' has an unsupported attribute `${head (attrNames badAttrs)}'."
else
{ file = m._file or file;
key = toString m.key or key;
@@ -124,46 +74,7 @@ rec {
config = removeAttrs m ["key" "_file" "require" "imports"];
};
applyIfFunction = key: f: args@{ config, options, lib, ... }: if isFunction f then
let
# Module arguments are resolved in a strict manner when attribute set
# deconstruction is used. As the arguments are now defined with the
# config._module.args option, the strictness used on the attribute
# set argument would cause an infinite loop, if the result of the
# option is given as argument.
#
# To work-around the strictness issue on the deconstruction of the
# attributes set argument, we create a new attribute set which is
# constructed to satisfy the expected set of attributes. Thus calling
# a module will resolve strictly the attributes used as argument but
# not their values. The values are forwarding the result of the
# evaluation of the option.
requiredArgs = builtins.attrNames (builtins.functionArgs f);
context = name: ''while evaluating the module argument `${name}' in "${key}":'';
extraArgs = builtins.listToAttrs (map (name: {
inherit name;
value = addErrorContext (context name)
(args.${name} or config._module.args.${name});
}) requiredArgs);
# Note: we append in the opposite order such that we can add an error
# context on the explicited arguments of "args" too. This update
# operator is used to make the "args@{ ... }: with args.lib;" notation
# works.
in f (args // extraArgs)
else
f;
/* We have to pack and unpack submodules. We cannot wrap the expected
result of the function as we would no longer be able to list the arguments
of the submodule. (see applyIfFunction) */
unpackSubmodule = unpack: m: args:
if isType "submodule" m then
{ _file = m.file; } // (unpack m.submodule args)
else unpack m args;
packSubmodule = file: m:
{ _type = "submodule"; file = file; submodule = m; };
applyIfFunction = f: arg: if isFunction f then f arg else f;
/* Merge a list of modules. This will recurse over the option
declarations in all modules, combining them into a single set.
@@ -182,22 +93,25 @@ rec {
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}; } ]
decls = concatLists (map (m:
if hasAttr name m.options
then [ { inherit (m) file; options = getAttr name m.options; } ]
else []
) options;
) options);
# Get all submodules that define name.
defns = concatMap (m:
if m.config ? ${name}
defns = concatLists (map (m:
if hasAttr name m.config
then map (config: { inherit (m) file; inherit config; })
(pushDownProperties m.config.${name})
(pushDownProperties (getAttr name m.config))
else []
) configs);
nrOptions = count (m: isOption m.options) decls;
# Process mkMerge and mkIf properties.
defns' = concatMap (m:
if hasAttr name m.config
then map (m': { inherit (m) file; value = m'; }) (dischargeProperties (getAttr name m.config))
else []
) configs;
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);
@@ -218,41 +132,20 @@ rec {
The exception is the options attribute, which specifies
sub-options. These can be specified multiple times to allow one
module to add sub-options to an option declared somewhere else
(e.g. multiple modules define sub-options for fileSystems).
'loc' is the list of attribute names where the option is located.
'opts' is a list of modules. Each module has an options attribute which
correspond to the definition of 'loc' in 'opt.file'. */
(e.g. multiple modules define sub-options for fileSystems). */
mergeOptionDecls = loc: opts:
foldl' (res: opt:
fold (opt: res:
if opt.options ? default && res ? default ||
opt.options ? example && res ? example ||
opt.options ? description && res ? description ||
opt.options ? apply && res ? apply ||
# Accept to merge options which have identical types.
opt.options ? type && res ? type && opt.options.type.name != res.type.name
opt.options ? type && res ? type
then
throw "The option `${showOption loc}' in `${opt.file}' is already declared in ${showFiles res.declarations}."
else
let
/* Add the modules of the current option to the list of modules
already collected. The options attribute except either a list of
submodules or a submodule. For each submodule, we add the file of the
current option declaration as the file use for the submodule. If the
submodule defines any filename, then we ignore the enclosing option file. */
options' = toList opt.options.options;
coerceOption = file: opt:
if isFunction opt then packSubmodule file opt
else packSubmodule file { options = opt; };
getSubModules = opt.options.type.getSubModules or null;
submodules =
if getSubModules != null then map (packSubmodule opt.file) getSubModules ++ res.options
else if opt.options ? options then map (coerceOption opt.file) options' ++ res.options
else res.options;
in opt.options // res //
{ declarations = res.declarations ++ [opt.file];
options = submodules;
opt.options // res //
{ declarations = [opt.file] ++ res.declarations;
options = if opt.options ? options then [(toList opt.options.options ++ res.options)] else [];
}
) { inherit loc; declarations = []; options = []; } opts;
@@ -260,69 +153,38 @@ rec {
config value. */
evalOptionValue = loc: opt: defs:
let
# Add in the default value for this option, if any.
defs' =
(optional (opt ? default)
{ file = head opt.declarations; value = mkOptionDefault opt.default; }) ++ defs;
# Handle properties, check types, and merge everything together.
res =
if opt.readOnly or false && length defs' > 1 then
throw "The option `${showOption loc}' is read-only, but it's set multiple times."
else
mergeDefinitions loc opt.type defs';
# Check whether the option is defined, and apply the apply
# function to the merged value. This allows options to yield a
# value computed from the definitions.
value =
if !res.isDefined then
# Process mkOverride properties, adding in the default
# value specified in the option declaration (if any).
defsFinal' = filterOverrides
((if opt ? default then [{ file = head opt.declarations; value = mkOptionDefault opt.default; }] else []) ++ defs);
# Sort mkOrder properties.
defsFinal =
# Avoid sorting if we don't have to.
if any (def: def.value._type or "" == "order") defsFinal'
then sortProperties defsFinal'
else defsFinal';
files = map (def: def.file) defsFinal;
# Type-check the remaining definitions, and merge them if
# possible.
merged =
if defsFinal == [] then
throw "The option `${showOption loc}' is used but not defined."
else if opt ? apply then
opt.apply res.mergedValue
else
res.mergedValue;
fold (def: res:
if opt.type.check def.value then res
else throw "The option value `${showOption loc}' in `${def.file}' is not a ${opt.type.name}.")
(opt.type.merge loc defsFinal) defsFinal;
# Finally, apply the apply function to the merged
# value. This allows options to yield a value computed
# from the definitions.
value = (opt.apply or id) merged;
in opt //
{ value = addErrorContext "while evaluating the option `${showOption loc}':" value;
definitions = map (def: def.value) res.defsFinal;
files = map (def: def.file) res.defsFinal;
inherit (res) isDefined;
definitions = map (def: def.value) defsFinal;
isDefined = defsFinal != [];
inherit files;
};
# Merge definitions of a value of a given type.
mergeDefinitions = loc: type: defs: rec {
defsFinal =
let
# Process mkMerge and mkIf properties.
defs' = concatMap (m:
map (value: { inherit (m) file; inherit value; }) (dischargeProperties m.value)
) defs;
# Process mkOverride properties.
defs'' = filterOverrides defs';
# Sort mkOrder properties.
defs''' =
# Avoid sorting if we don't have to.
if any (def: def.value._type or "" == "order") defs''
then sortProperties defs''
else defs'';
in defs''';
# Type-check the remaining definitions, and merge them.
mergedValue = foldl' (res: def:
if type.check def.value then res
else throw "The option value `${showOption loc}' in `${def.file}' is not a ${type.name}.")
(type.merge loc defsFinal) defsFinal;
isDefined = defsFinal != [];
optionalValue =
if isDefined then { value = mergedValue; }
else {};
};
/* Given a config set, expand mkMerge properties, and push down the
other properties into the children. The result is a list of
config sets that do not have properties at top-level. For
@@ -332,7 +194,7 @@ rec {
is transformed into
[ { boot = set1; } { boot = mkIf cond set2; services = mkIf cond set3; } ].
[ { boot = set1; } { boot = mkIf cond set2; services mkIf cond set3; } ].
This transform is the critical step that allows mkIf conditions
to refer to the full configuration without creating an infinite
@@ -392,7 +254,8 @@ rec {
let
defaultPrio = 100;
getPrio = def: if def.value._type or "" == "override" then def.value.priority else defaultPrio;
highestPrio = foldl' (prio: def: min (getPrio def) prio) 9999 defs;
min = x: y: if builtins.lessThan x y then x else y;
highestPrio = fold (def: prio: min (getPrio def) prio) 9999 defs;
strip = def: if def.value._type or "" == "override" then def // { value = def.value.content; } else def;
in concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
@@ -410,24 +273,23 @@ rec {
in sort compare defs';
/* Hack for backward compatibility: convert options of type
optionSet to options of type submodule. FIXME: remove
eventually. */
optionSet to configOf. FIXME: remove eventually. */
fixupOptionType = loc: opt:
let
options = opt.options or
(throw "Option `${showOption loc'}' has type optionSet but has no option attribute, in ${showFiles opt.declarations}.");
options' = opt.options or
(throw "Option `${showOption loc'}' has type optionSet but has no option attribute.");
coerce = x:
if isFunction x then x
else { config, ... }: { options = x; };
options = map coerce (flatten options');
f = tp:
if tp.name == "option set" || tp.name == "submodule" then
throw "The option ${showOption loc} uses submodules without a wrapping type, in ${showFiles opt.declarations}."
if tp.name == "option set" then types.submodule options
else if tp.name == "attribute set of option sets" then types.attrsOf (types.submodule options)
else if tp.name == "list or attribute set of option sets" then types.loaOf (types.submodule options)
else if tp.name == "list of option sets" then types.listOf (types.submodule options)
else if tp.name == "null or option set" then types.nullOr (types.submodule options)
else tp;
in
if opt.type.getSubModules or null == null
then opt // { type = f (opt.type or types.unspecified); }
else opt // { type = opt.type.substSubModules opt.options; options = []; };
in opt // { type = f (opt.type or types.unspecified); };
/* Properties. */
@@ -470,97 +332,7 @@ rec {
mkAfter = mkOrder 1500;
# Convenient property used to transfer all definitions and their
# properties from one option to another. This property is useful for
# renaming options, and also for including properties from another module
# system, including sub-modules.
#
# { config, options, ... }:
#
# {
# # 'bar' might not always be defined in the current module-set.
# config.foo.enable = mkAliasDefinitions (options.bar.enable or {});
#
# # 'barbaz' has to be defined in the current module-set.
# config.foobar.paths = mkAliasDefinitions options.barbaz.paths;
# }
#
# Note, this is different than taking the value of the option and using it
# as a definition, as the new definition will not keep the mkOverride /
# mkDefault properties of the previous option.
#
mkAliasDefinitions = mkAliasAndWrapDefinitions id;
mkAliasAndWrapDefinitions = wrap: option:
mkMerge
(optional (isOption option && option.isDefined)
(wrap (mkMerge option.definitions)));
/* Compatibility. */
fixMergeModules = modules: args: evalModules { inherit modules args; check = false; };
/* Return a module that causes a warning to be shown if the
specified option is defined. For example,
mkRemovedOptionModule [ "boot" "loader" "grub" "bootDevice" ]
causes a warning if the user defines boot.loader.grub.bootDevice.
*/
mkRemovedOptionModule = optionName:
{ options, ... }:
{ options = setAttrByPath optionName (mkOption {
visible = false;
});
config.warnings =
let opt = getAttrFromPath optionName options; in
optional opt.isDefined
"The option definition `${showOption optionName}' in ${showFiles opt.files} no longer has any effect; please remove it.";
};
/* Return a module that causes a warning to be shown if the
specified "from" option is defined; the defined value is however
forwarded to the "to" option. This can be used to rename options
while providing backward compatibility. For example,
mkRenamedOptionModule [ "boot" "copyKernels" ] [ "boot" "loader" "grub" "copyKernels" ]
forwards any definitions of boot.copyKernels to
boot.loader.grub.copyKernels while printing a warning.
*/
mkRenamedOptionModule = from: to: doRename {
inherit from to;
visible = false;
warn = true;
use = builtins.trace "Obsolete option `${showOption from}' is used. It was renamed to `${showOption to}'.";
};
/* Like mkRenamedOptionModule, but doesn't show a warning. */
mkAliasOptionModule = from: to: doRename {
inherit from to;
visible = true;
warn = false;
use = id;
};
doRename = { from, to, visible, warn, use }:
let
toOf = attrByPath to
(abort "Renaming error: option `${showOption to}' does not exists.");
in
{ config, options, ... }:
{ options = setAttrByPath from (mkOption {
description = "Alias of <option>${showOption to}</option>.";
apply = x: use (toOf config);
});
config = {
/*
warnings =
let opt = getAttrFromPath from options; in
optional (warn && opt.isDefined)
"The option `${showOption from}' defined in ${showFiles opt.files} has been renamed to `${showOption to}'.";
*/
} // setAttrByPath to (mkAliasDefinitions (getAttrFromPath from options));
};
}

View File

@@ -4,6 +4,7 @@ let lib = import ./default.nix; in
with import ./trivial.nix;
with import ./lists.nix;
with import ./misc.nix;
with import ./attrsets.nix;
with import ./strings.nix;
@@ -19,7 +20,6 @@ rec {
, apply ? null # Function that converts the option value to something else.
, internal ? null # Whether the option is for NixOS developers only.
, visible ? null # Whether the option shows up in the manual.
, readOnly ? null # Whether the option can be set only once
, options ? null # Obsolete, used by types.optionSet.
} @ attrs:
attrs // { _type = "option"; };
@@ -31,49 +31,37 @@ rec {
type = lib.types.bool;
};
# This option accept anything, but it does not produce any result. This
# is useful for sharing a module across different module sets without
# having to implement similar features as long as the value of the options
# are not expected.
mkSinkUndeclaredOptions = attrs: mkOption ({
internal = true;
visible = false;
default = false;
description = "Sink for option definitions.";
type = mkOptionType {
name = "sink";
check = x: true;
merge = loc: defs: false;
};
apply = x: throw "Option value is not readable because the option is not declared.";
} // attrs);
mergeDefaultOption = loc: defs:
let list = getValues defs; in
if length list == 1 then head list
else if all isFunction list then x: mergeDefaultOption loc (map (f: f x) list)
else if all isList list then concatLists list
else if all isAttrs list then foldl' lib.mergeAttrs {} list
else if all isBool list then foldl' lib.or false list
else if all isAttrs list then fold lib.mergeAttrs {} list
else if all isBool list then fold lib.or false list
else if all isString list then lib.concatStrings list
else if all isInt list && all (x: x == head list) list then head list
else throw "Cannot merge definitions of `${showOption loc}' given in ${showFiles (getFiles defs)}.";
/* Obsolete, will remove soon. Specify an option type or apply
function instead. */
mergeTypedOption = typeName: predicate: merge: loc: list:
let list' = map (x: x.value) list; in
if all predicate list then merge list'
else throw "Expected a ${typeName}.";
mergeEnableOption = mergeTypedOption "boolean"
(x: true == x || false == x) (fold lib.or false);
mergeListOption = mergeTypedOption "list" isList concatLists;
mergeStringOption = mergeTypedOption "string" isString lib.concatStrings;
mergeOneOption = loc: defs:
if defs == [] then abort "This case should never happen."
else if length defs != 1 then
throw "The unique option `${showOption loc}' is defined multiple times, in ${showFiles (getFiles defs)}."
else (head defs).value;
/* "Merge" option definitions by checking that they all have the same value. */
mergeEqualOption = loc: defs:
if defs == [] then abort "This case should never happen."
else foldl' (val: def:
if def.value != val then
throw "The option `${showOption loc}' has conflicting definitions, in ${showFiles (getFiles defs)}."
else
val) (head defs).value defs;
getValues = map (x: x.value);
getFiles = map (x: x.file);
@@ -83,7 +71,7 @@ rec {
optionAttrSetToDocList = optionAttrSetToDocList' [];
optionAttrSetToDocList' = prefix: options:
concatMap (opt:
fold (opt: rest:
let
docOption = rec {
name = showOption opt.loc;
@@ -91,18 +79,17 @@ rec {
declarations = filter (x: x != unknownModule) opt.declarations;
internal = opt.internal or false;
visible = opt.visible or true;
readOnly = opt.readOnly or false;
type = opt.type.name or null;
}
// (if opt ? example then { example = scrubOptionValue opt.example; } else {})
// (if opt ? default then { default = scrubOptionValue opt.default; } else {})
// (if opt ? defaultText then { default = opt.defaultText; } else {});
// optionalAttrs (opt ? example) { example = scrubOptionValue opt.example; }
// optionalAttrs (opt ? default) { default = scrubOptionValue opt.default; }
// optionalAttrs (opt ? defaultText) { default = opt.defaultText; };
subOptions =
let ss = opt.type.getSubOptions opt.loc;
in if ss != {} then optionAttrSetToDocList' opt.loc ss else [];
in
[ docOption ] ++ subOptions) (collect isOption options);
# FIXME: expensive, O(n^2)
[ docOption ] ++ subOptions ++ rest) [] (collect isOption options);
/* This function recursively removes all derivation attributes from

View File

@@ -7,14 +7,10 @@ rec {
freebsd = ["i686-freebsd" "x86_64-freebsd"];
openbsd = ["i686-openbsd" "x86_64-openbsd"];
netbsd = ["i686-netbsd" "x86_64-netbsd"];
cygwin = ["i686-cygwin" "x86_64-cygwin"];
cygwin = ["i686-cygwin"];
unix = linux ++ darwin ++ freebsd ++ openbsd;
all = linux ++ darwin ++ cygwin ++ freebsd ++ openbsd;
none = [];
allBut = platforms: lists.filter (x: !(builtins.elem x platforms)) all;
allBut = platform: lists.filter (x: platform != x) all;
mesaPlatforms = ["i686-linux" "x86_64-linux" "x86_64-darwin" "armv5tel-linux" "armv6l-linux"];
x86_64 = ["x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin"];
i686 = ["i686-linux" "i686-freebsd" "i686-netbsd" "i686-cygwin"];
arm = ["armv5tel-linux" "armv6l-linux" "armv7l-linux" ];
mips = [ "mips64el-linux" ];
}

View File

@@ -21,12 +21,12 @@ rec {
# Get all files ending with the specified suffices from the given
# directory or its descendants. E.g. `sourceFilesBySuffices ./dir
# [".xml" ".c"]'.
# directory. E.g. `sourceFilesBySuffices ./dir [".xml" ".c"]'.
sourceFilesBySuffices = path: exts:
let filter = name: type:
let base = baseNameOf (toString name);
in type == "directory" || lib.any (ext: lib.hasSuffix ext base) exts;
in type != "directory" && lib.any (ext: lib.hasSuffix ext base) exts;
in builtins.filterSource filter path;
}

View File

@@ -62,8 +62,8 @@ rec {
in { result = x.result ++ [entry.text] ++ y.result;
done = y.done;
}
else if done ? ${entry} then f done (tail todo)
else f (done // listToAttrs [{name = entry; value = 1;}]) ([predefined.${entry}] ++ tail todo);
else if hasAttr entry done then f done (tail todo)
else f (done // listToAttrs [{name = entry; value = 1;}]) ([(builtins.getAttr entry predefined)] ++ tail todo);
in (f {} arg).result;
textClosureMap = f: predefined: names:

View File

@@ -2,21 +2,17 @@
let lib = import ./default.nix;
inherit (builtins) length;
inherit (builtins) add sub lessThan length;
in
rec {
inherit (builtins) stringLength substring head tail isString replaceStrings;
inherit (builtins) stringLength substring head tail isString;
# Concatenate a list of strings.
concatStrings =
if builtins ? concatStringsSep then
builtins.concatStringsSep ""
else
lib.foldl' (x: y: x + y) "";
concatStrings = lib.fold (x: y: x + y) "";
# Map a function over a list and concatenate the resulting strings.
@@ -29,16 +25,14 @@ rec {
intersperse = separator: list:
if list == [] || length list == 1
then list
else tail (lib.concatMap (x: [separator x]) list);
else [(head list) separator]
++ (intersperse separator (tail list));
# Concatenate a list of strings with a separator between each element, e.g.
# concatStringsSep " " ["foo" "bar" "xyzzy"] == "foo bar xyzzy"
concatStringsSep = builtins.concatStringsSep or (separator: list:
concatStrings (intersperse separator list));
concatMapStringsSep = sep: f: list: concatStringsSep sep (map f list);
concatImapStringsSep = sep: f: list: concatStringsSep sep (lib.imap f list);
concatStringsSep = separator: list:
concatStrings (intersperse separator list);
# Construct a Unix-style search path consisting of each `subDir"
@@ -62,15 +56,12 @@ rec {
optionalString = cond: string: if cond then string else "";
# Determine whether a string has given prefix/suffix.
hasPrefix = pref: str:
substring 0 (stringLength pref) str == pref;
hasSuffix = suff: str:
let
lenStr = stringLength str;
lenSuff = stringLength suff;
in lenStr >= lenSuff &&
substring (lenStr - lenSuff) lenStr str == suff;
# Determine whether a filename ends in the given suffix.
hasSuffix = ext: fileName:
let lenFileName = stringLength fileName;
lenExt = stringLength ext;
in !(lessThan lenFileName lenExt) &&
substring (sub lenFileName lenExt) lenFileName fileName == ext;
# Convert a string to a list of characters (i.e. singleton strings).
@@ -79,75 +70,77 @@ rec {
# will likely be horribly inefficient; Nix is not a general purpose
# programming language. Complex string manipulations should, if
# appropriate, be done in a derivation.
stringToCharacters = s:
map (p: substring p 1 s) (lib.range 0 (stringLength s - 1));
stringToCharacters = s: let l = stringLength s; in
if l == 0
then []
else map (p: substring p 1 s) (lib.range 0 (sub l 1));
# Manipulate a string charactter by character and replace them by
# strings before concatenating the results.
# Manipulate a string charcater by character and replace them by strings
# before concatenating the results.
stringAsChars = f: s:
concatStrings (
map f (stringToCharacters s)
);
# Escape occurrence of the elements of list in string by
# prefixing it with a backslash. For example, escape ["(" ")"]
# "(foo)" returns the string \(foo\).
escape = list: replaceChars list (map (c: "\\${c}") list);
# same as vim escape function.
# Each character contained in list is prefixed by "\"
escape = list : string :
stringAsChars (c: if lib.elem c list then "\\${c}" else c) string;
# Escape all characters that have special meaning in the Bourne shell.
# still ugly slow. But more correct now
# [] for zsh
escapeShellArg = lib.escape (stringToCharacters "\\ ';$`()|<>\t*[]");
# Obsolete - use replaceStrings instead.
replaceChars = builtins.replaceStrings or (
del: new: s:
# replace characters by their substitutes. This function is equivalent to
# the `tr' command except that one character can be replace by multiple
# ones. e.g.,
# replaceChars ["<" ">"] ["&lt;" "&gt;"] "<foo>" returns "&lt;foo&gt;".
replaceChars = del: new: s:
let
substList = lib.zipLists del new;
subst = c:
let found = lib.findFirst (sub: sub.fst == c) null substList; in
if found == null then
c
else
found.snd;
(lib.fold
(sub: res: if sub.fst == c then sub else res)
{fst = c; snd = c;} (lib.zipLists del new)
).snd;
in
stringAsChars subst s);
stringAsChars subst s;
# Case conversion utilities.
# Case conversion utilities
lowerChars = stringToCharacters "abcdefghijklmnopqrstuvwxyz";
upperChars = stringToCharacters "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
toLower = replaceChars upperChars lowerChars;
toUpper = replaceChars lowerChars upperChars;
# Appends string context from another string.
addContextFrom = a: b: substring 0 0 a + b;
# Compares strings not requiring context equality
# Obviously, a workaround but works on all Nix versions
eqStrings = a: b: (a+(substring 0 0 b)) == ((substring 0 0 a)+b);
# Cut a string with a separator and produces a list of strings which
# were separated by this separator; e.g., `splitString "."
# "foo.bar.baz"' returns ["foo" "bar" "baz"].
splitString = _sep: _s:
# Cut a string with a separator and produces a list of strings which were
# separated by this separator. e.g.,
# `splitString "." "foo.bar.baz"' returns ["foo" "bar" "baz"].
splitString = sep: s:
let
sep = addContextFrom _s _sep;
s = addContextFrom _sep _s;
sepLen = stringLength sep;
sLen = stringLength s;
lastSearch = sLen - sepLen;
lastSearch = sub sLen sepLen;
startWithSep = startAt:
substring startAt sepLen s == sep;
recurse = index: startAt:
let cutUntil = i: [(substring startAt (i - startAt) s)]; in
if index < lastSearch then
let cutUntil = i: [(substring startAt (sub i startAt) s)]; in
if lessThan index lastSearch then
if startWithSep index then
let restartAt = index + sepLen; in
let restartAt = add index sepLen; in
cutUntil index ++ recurse restartAt restartAt
else
recurse (index + 1) startAt
recurse (add index 1) startAt
else
cutUntil sLen;
in
@@ -162,8 +155,8 @@ rec {
preLen = stringLength pre;
sLen = stringLength s;
in
if hasPrefix pre s then
substring preLen (sLen - preLen) s
if pre == substring 0 preLen s then
substring preLen (sub sLen preLen) s
else
s;
@@ -191,36 +184,18 @@ rec {
# Extract name with version from URL. Ask for separator which is
# supposed to start extension.
nameFromURL = url: sep:
let
components = splitString "/" url;
filename = lib.last components;
name = builtins.head (splitString sep filename);
in assert name != filename; name;
# supposed to start extension
nameFromURL = url: sep: let
components = splitString "/" url;
filename = lib.last components;
name = builtins.head (splitString sep filename);
in
assert ! eqStrings name filename;
name;
# Create an --{enable,disable}-<feat> string that can be passed to
# standard GNU Autoconf scripts.
enableFeature = enable: feat: "--${if enable then "enable" else "disable"}-${feat}";
# Create a fixed width string with additional prefix to match
# required width.
fixedWidthString = width: filler: str:
let
strw = lib.stringLength str;
reqWidth = width - (lib.stringLength filler);
in
assert strw <= width;
if strw == width then str else filler + fixedWidthString reqWidth filler str;
# Format a number adding leading zeroes up to fixed width.
fixedWidthNumber = width: n: fixedWidthString width "0" (toString n);
# Check whether a value is a store path.
isStorePath = x: builtins.substring 0 1 (toString x) == "/" && dirOf (builtins.toPath x) == builtins.storeDir;
}

View File

@@ -24,7 +24,7 @@ rec {
isCpuType = x: isType "cpu-type" x
&& elem x.bits [8 16 32 64 128]
&& (8 < x.bits -> isSignificantByte x.significantByte);
&& (builtins.lessThan 8 x.bits -> isSignificantByte x.significantByte);
cpuTypes = with significantBytes;
setTypes "cpu-type" {

View File

@@ -1,127 +0,0 @@
#!/bin/sh
#
# This script is used to test that the module system is working as expected.
# By default it test the version of nixpkgs which is defined in the NIX_PATH.
cd ./modules
pass=0
fail=0
evalConfig() {
local attr=$1
shift;
local script="import ./default.nix { modules = [ $@ ];}"
nix-instantiate --timeout 1 -E "$script" -A "$attr" --eval-only --show-trace
}
reportFailure() {
local attr=$1
shift;
local script="import ./default.nix { modules = [ $@ ];}"
echo 2>&1 "$ nix-instantiate -E '$script' -A '$attr' --eval-only"
evalConfig "$attr" "$@"
fail=$((fail + 1))
}
checkConfigOutput() {
local outputContains=$1
shift;
if evalConfig "$@" 2>/dev/null | grep --silent "$outputContains" ; then
pass=$((pass + 1))
return 0;
else
echo 2>&1 "error: Expected result matching '$outputContains', while evaluating"
reportFailure "$@"
return 1
fi
}
checkConfigError() {
local errorContains=$1
local err=""
shift;
if err==$(evalConfig "$@" 2>&1 >/dev/null); then
echo 2>&1 "error: Expected error code, got exit code 0, while evaluating"
reportFailure "$@"
return 1
else
if echo "$err" | grep --silent "$errorContains" ; then
pass=$((pass + 1))
return 0;
else
echo 2>&1 "error: Expected error matching '$errorContains', while evaluating"
reportFailure "$@"
return 1
fi
fi
}
# Check boolean option.
checkConfigOutput "false" config.enable ./declare-enable.nix
checkConfigError 'The option .* defined in .* does not exist.' config.enable ./define-enable.nix
# Check mkForce without submodules.
set -- config.enable ./declare-enable.nix ./define-enable.nix
checkConfigOutput "true" "$@"
checkConfigOutput "false" "$@" ./define-force-enable.nix
checkConfigOutput "false" "$@" ./define-enable-force.nix
# Check mkForce with option and submodules.
checkConfigError 'attribute .*foo.* .* not found' config.loaOfSub.foo.enable ./declare-loaOfSub-any-enable.nix
checkConfigOutput 'false' config.loaOfSub.foo.enable ./declare-loaOfSub-any-enable.nix ./define-loaOfSub-foo.nix
set -- config.loaOfSub.foo.enable ./declare-loaOfSub-any-enable.nix ./define-loaOfSub-foo-enable.nix
checkConfigOutput 'true' "$@"
checkConfigOutput 'false' "$@" ./define-force-loaOfSub-foo-enable.nix
checkConfigOutput 'false' "$@" ./define-loaOfSub-force-foo-enable.nix
checkConfigOutput 'false' "$@" ./define-loaOfSub-foo-force-enable.nix
checkConfigOutput 'false' "$@" ./define-loaOfSub-foo-enable-force.nix
# Check overriding effect of mkForce on submodule definitions.
checkConfigError 'attribute .*bar.* .* not found' config.loaOfSub.bar.enable ./declare-loaOfSub-any-enable.nix ./define-loaOfSub-foo.nix
checkConfigOutput 'false' config.loaOfSub.bar.enable ./declare-loaOfSub-any-enable.nix ./define-loaOfSub-foo.nix ./define-loaOfSub-bar.nix
set -- config.loaOfSub.bar.enable ./declare-loaOfSub-any-enable.nix ./define-loaOfSub-foo.nix ./define-loaOfSub-bar-enable.nix
checkConfigOutput 'true' "$@"
checkConfigError 'attribute .*bar.* .* not found' "$@" ./define-force-loaOfSub-foo-enable.nix
checkConfigError 'attribute .*bar.* .* not found' "$@" ./define-loaOfSub-force-foo-enable.nix
checkConfigOutput 'true' "$@" ./define-loaOfSub-foo-force-enable.nix
checkConfigOutput 'true' "$@" ./define-loaOfSub-foo-enable-force.nix
# Check mkIf with submodules.
checkConfigError 'attribute .*foo.* .* not found' config.loaOfSub.foo.enable ./declare-enable.nix ./declare-loaOfSub-any-enable.nix
set -- config.loaOfSub.foo.enable ./declare-enable.nix ./declare-loaOfSub-any-enable.nix
checkConfigError 'attribute .*foo.* .* not found' "$@" ./define-if-loaOfSub-foo-enable.nix
checkConfigError 'attribute .*foo.* .* not found' "$@" ./define-loaOfSub-if-foo-enable.nix
checkConfigError 'attribute .*foo.* .* not found' "$@" ./define-loaOfSub-foo-if-enable.nix
checkConfigOutput 'false' "$@" ./define-loaOfSub-foo-enable-if.nix
checkConfigOutput 'true' "$@" ./define-enable.nix ./define-if-loaOfSub-foo-enable.nix
checkConfigOutput 'true' "$@" ./define-enable.nix ./define-loaOfSub-if-foo-enable.nix
checkConfigOutput 'true' "$@" ./define-enable.nix ./define-loaOfSub-foo-if-enable.nix
checkConfigOutput 'true' "$@" ./define-enable.nix ./define-loaOfSub-foo-enable-if.nix
# Check _module.args.
set -- config.enable ./declare-enable.nix ./define-enable-with-custom-arg.nix
checkConfigError 'while evaluating the module argument .*custom.* in .*define-enable-with-custom-arg.nix.*:' "$@"
checkConfigOutput "true" "$@" ./define-_module-args-custom.nix
# Check that using _module.args on imports cause infinite recursions, with
# the proper error context.
set -- "$@" ./define-_module-args-custom.nix ./import-custom-arg.nix
checkConfigError 'while evaluating the module argument .*custom.* in .*import-custom-arg.nix.*:' "$@"
checkConfigError 'infinite recursion encountered' "$@"
# Check _module.check.
set -- config.enable ./declare-enable.nix ./define-enable.nix ./define-loaOfSub-foo.nix
checkConfigError 'The option .* defined in .* does not exist.' "$@"
checkConfigOutput "true" "$@" ./define-module-check.nix
cat <<EOF
====== module tests ======
$pass Pass
$fail Fail
EOF
if test $fail -ne 0; then
exit 1
fi
exit 0

View File

@@ -1,14 +0,0 @@
{ lib, ... }:
{
options = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = ''
Some descriptive text
'';
};
};
}

View File

@@ -1,29 +0,0 @@
{ lib, ... }:
let
submod = { ... }: {
options = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = ''
Some descriptive text
'';
};
};
};
in
{
options = {
loaOfSub = lib.mkOption {
default = {};
example = {};
type = lib.types.loaOf (lib.types.submodule [ submod ]);
description = ''
Some descriptive text
'';
};
};
}

View File

@@ -1,7 +0,0 @@
{ lib ? import <nixpkgs/lib>, modules ? [] }:
{
inherit (lib.evalModules {
inherit modules;
}) config options;
}

View File

@@ -1,7 +0,0 @@
{ lib, ... }:
{
config = {
_module.args.custom = true;
};
}

View File

@@ -1,5 +0,0 @@
{ lib, ... }:
{
enable = lib.mkForce false;
}

View File

@@ -1,7 +0,0 @@
{ lib, custom, ... }:
{
config = {
enable = custom;
};
}

View File

@@ -1,3 +0,0 @@
{
enable = true;
}

View File

@@ -1,5 +0,0 @@
{ lib, ... }:
lib.mkForce {
enable = false;
}

View File

@@ -1,5 +0,0 @@
{ lib, ... }:
lib.mkForce {
loaOfSub.foo.enable = false;
}

View File

@@ -1,5 +0,0 @@
{ config, lib, ... }:
lib.mkIf config.enable {
loaOfSub.foo.enable = true;
}

View File

@@ -1,3 +0,0 @@
{
loaOfSub.bar.enable = true;
}

View File

@@ -1,3 +0,0 @@
{
loaOfSub.bar = {};
}

View File

@@ -1,5 +0,0 @@
{ lib, ... }:
{
loaOfSub.foo.enable = lib.mkForce false;
}

View File

@@ -1,5 +0,0 @@
{ config, lib, ... }:
{
loaOfSub.foo.enable = lib.mkIf config.enable true;
}

View File

@@ -1,3 +0,0 @@
{
loaOfSub.foo.enable = true;
}

View File

@@ -1,7 +0,0 @@
{ lib, ... }:
{
loaOfSub.foo = lib.mkForce {
enable = false;
};
}

View File

@@ -1,7 +0,0 @@
{ config, lib, ... }:
{
loaOfSub.foo = lib.mkIf config.enable {
enable = true;
};
}

View File

@@ -1,3 +0,0 @@
{
loaOfSub.foo = {};
}

View File

@@ -1,7 +0,0 @@
{ lib, ... }:
{
loaOfSub = lib.mkForce {
foo.enable = false;
};
}

View File

@@ -1,7 +0,0 @@
{ config, lib, ... }:
{
loaOfSub = lib.mkIf config.enable {
foo.enable = true;
};
}

View File

@@ -1,3 +0,0 @@
{
_module.check = false;
}

View File

@@ -1,6 +0,0 @@
{ lib, custom, ... }:
{
imports = []
++ lib.optional custom ./define-enable-force.nix;
}

View File

@@ -1,31 +0,0 @@
{ nixpkgs }:
with import ./../.. { };
with lib;
stdenv.mkDerivation {
name = "nixpkgs-lib-tests";
buildInputs = [ nix ];
NIX_PATH="nixpkgs=${nixpkgs}";
buildCommand = ''
datadir="${nix}/share"
export TEST_ROOT=$(pwd)/test-tmp
export NIX_STORE_DIR=$TEST_ROOT/store
export NIX_LOCALSTATE_DIR=$TEST_ROOT/var
export NIX_LOG_DIR=$TEST_ROOT/var/log/nix
export NIX_STATE_DIR=$TEST_ROOT/var/nix
export NIX_DB_DIR=$TEST_ROOT/db
export NIX_CONF_DIR=$TEST_ROOT/etc
export NIX_MANIFESTS_DIR=$TEST_ROOT/var/nix/manifests
export NIX_BUILD_HOOK=
export PAGER=cat
cacheDir=$TEST_ROOT/binary-cache
nix-store --init
cd ${nixpkgs}/lib/tests
./modules.sh
touch $out
'';
}

View File

@@ -1,3 +1,8 @@
with {
inherit (import ./lists.nix) deepSeqList;
inherit (import ./attrsets.nix) deepSeqAttrs;
};
rec {
# Identity function.
@@ -18,11 +23,23 @@ rec {
# Flip the order of the arguments of a binary function.
flip = f: a: b: f b a;
# `seq x y' evaluates x, then returns y. That is, it forces strict
# evaluation of its first argument.
seq = x: y: if x == null then y else y;
# Like `seq', but recurses into lists and attribute sets to force evaluation
# of all list elements/attributes.
deepSeq = x: y:
if builtins.isList x
then deepSeqList x y
else if builtins.isAttrs x
then deepSeqAttrs x y
else seq x y;
# Pull in some builtins not included elsewhere.
inherit (builtins)
pathExists readFile isBool isFunction
isInt add sub lessThan
seq deepSeq genericClosure;
isInt add sub lessThan;
# Return the Nixpkgs version number.
nixpkgsVersion =
@@ -30,11 +47,7 @@ rec {
readFile ../.version
+ (if pathExists suffixFile then readFile suffixFile else "pre-git");
# Whether we're being called by nix-shell.
# Whether we're being called by nix-shell. This is useful to
inNixShell = builtins.getEnv "IN_NIX_SHELL" == "1";
# Return minimum/maximum of two numbers.
min = x: y: if x < y then x else y;
max = x: y: if x > y then x else y;
}

View File

@@ -6,7 +6,6 @@ with import ./attrsets.nix;
with import ./options.nix;
with import ./trivial.nix;
with import ./strings.nix;
with {inherit (import ./modules.nix) mergeDefinitions filterOverrides; };
rec {
@@ -34,14 +33,9 @@ rec {
, # Return a flat list of sub-options. Used to generate
# documentation.
getSubOptions ? prefix: {}
, # List of modules if any, or null if none.
getSubModules ? null
, # Function for building the same option type with a different list of
# modules.
substSubModules ? m: null
}:
{ _type = "option-type";
inherit name check merge getSubOptions getSubModules substSubModules;
inherit name check merge getSubOptions;
};
@@ -54,7 +48,7 @@ rec {
bool = mkOptionType {
name = "boolean";
check = isBool;
merge = mergeEqualOption;
merge = loc: fold (x: y: x.value || y) false;
};
int = mkOptionType {
@@ -88,22 +82,20 @@ rec {
attrs = mkOptionType {
name = "attribute set";
check = isAttrs;
merge = loc: foldl' (res: def: mergeAttrs res def.value) {};
merge = loc: fold (def: mergeAttrs def.value) {};
};
# derivation is a reserved keyword.
package = mkOptionType {
name = "derivation";
check = x: isDerivation x || isStorePath x;
merge = loc: defs:
let res = mergeOneOption loc defs;
in if isDerivation res then res else toDerivation res;
check = isDerivation;
merge = mergeOneOption;
};
path = mkOptionType {
name = "path";
# Hacky: there is no isPath primop.
check = x: builtins.substring 0 1 (toString x) == "/";
check = x: builtins.unsafeDiscardStringContext (builtins.substring 0 1 (toString x)) == "/";
merge = mergeOneOption;
};
@@ -112,33 +104,23 @@ rec {
listOf = elemType: mkOptionType {
name = "list of ${elemType.name}s";
check = isList;
check = value: isList value && all elemType.check value;
merge = loc: defs:
map (x: x.value) (filter (x: x ? value) (concatLists (imap (n: def: imap (m: def':
(mergeDefinitions
(loc ++ ["[definition ${toString n}-entry ${toString m}]"])
elemType
[{ inherit (def) file; value = def'; }]
).optionalValue
) def.value) defs)));
concatLists (imap (n: def: imap (m: def':
elemType.merge (loc ++ ["[${toString n}-${toString m}]"])
[{ inherit (def) file; value = def'; }]) def.value) defs);
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["*"]);
getSubModules = elemType.getSubModules;
substSubModules = m: listOf (elemType.substSubModules m);
};
attrsOf = elemType: mkOptionType {
name = "attribute set of ${elemType.name}s";
check = isAttrs;
check = x: isAttrs x && all elemType.check (attrValues x);
merge = loc: defs:
mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
(mergeDefinitions (loc ++ [name]) elemType defs).optionalValue
)
zipAttrsWith (name: elemType.merge (loc ++ [name]))
# Push down position info.
(map (def: listToAttrs (mapAttrsToList (n: def':
{ name = n; value = { inherit (def) file; value = def'; }; }) def.value)) defs)));
{ name = n; value = { inherit (def) file; value = def'; }; }) def.value)) defs);
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name>"]);
getSubModules = elemType.getSubModules;
substSubModules = m: attrsOf (elemType.substSubModules m);
};
# List or attribute set of ...
@@ -159,36 +141,18 @@ rec {
attrOnly = attrsOf elemType;
in mkOptionType {
name = "list or attribute set of ${elemType.name}s";
check = x: isList x || isAttrs x;
check = x:
if isList x then listOnly.check x
else if isAttrs x then attrOnly.check x
else false;
merge = loc: defs: attrOnly.merge loc (imap convertIfList defs);
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name?>"]);
getSubModules = elemType.getSubModules;
substSubModules = m: loaOf (elemType.substSubModules m);
};
# List or element of ...
loeOf = elemType: mkOptionType {
name = "element or list of ${elemType.name}s";
check = x: isList x || elemType.check x;
merge = loc: defs:
let
defs' = filterOverrides defs;
res = (head defs').value;
in
if isList res then concatLists (getValues defs')
else if lessThan 1 (length defs') then
throw "The option `${showOption loc}' is defined multiple times, in ${showFiles (getFiles defs)}."
else if !isString res then
throw "The option `${showOption loc}' does not have a string value, in ${showFiles (getFiles defs)}."
else res;
};
uniq = elemType: mkOptionType {
inherit (elemType) name check;
merge = mergeOneOption;
getSubOptions = elemType.getSubOptions;
getSubModules = elemType.getSubModules;
substSubModules = m: uniq (elemType.substSubModules m);
};
nullOr = elemType: mkOptionType {
@@ -201,8 +165,14 @@ rec {
throw "The option `${showOption loc}' is defined both null and not null, in ${showFiles (getFiles defs)}."
else elemType.merge loc defs;
getSubOptions = elemType.getSubOptions;
getSubModules = elemType.getSubModules;
substSubModules = m: nullOr (elemType.substSubModules m);
};
functionTo = elemType: mkOptionType {
name = "function that evaluates to a(n) ${elemType.name}";
check = isFunction;
merge = loc: defs:
fnArgs: elemType.merge loc (map (fn: { inherit (fn) file; value = fn.value fnArgs; }) defs);
getSubOptions = elemType.getSubOptions;
};
submodule = opts:
@@ -217,17 +187,11 @@ rec {
let
coerce = def: if isFunction def then def else { config = def; };
modules = opts' ++ map (def: { _file = def.file; imports = [(coerce def.value)]; }) defs;
in (evalModules {
inherit modules;
args.name = last loc;
prefix = loc;
}).config;
in (evalModules { inherit modules; args.name = last loc; prefix = loc; }).config;
getSubOptions = prefix: (evalModules
{ modules = opts'; inherit prefix;
# FIXME: hack to get shit to evaluate.
args = { name = ""; }; }).options;
getSubModules = opts';
substSubModules = m: submodule m;
};
enum = values: mkOptionType {

View File

@@ -1,14 +0,0 @@
*~
,*
.*.swp
.*.swo
result
result-*
/doc/NEWS.html
/doc/NEWS.txt
/doc/manual.html
/doc/manual.pdf
.version-suffix
.DS_Store
.git

View File

@@ -1,12 +0,0 @@
FROM busybox
RUN dir=`mktemp -d` && trap 'rm -rf "$dir"' EXIT && \
wget -O- https://nixos.org/releases/nix/nix-1.7/nix-1.7-x86_64-linux.tar.bz2 | bzcat | tar x -C $dir && \
mkdir -m 0755 /nix && USER=root sh $dir/*/install && \
echo ". /root/.nix-profile/etc/profile.d/nix.sh" >> /etc/profile
ADD . /root/nix/nixpkgs
ONBUILD ENV NIX_PATH nixpkgs=/root/nix/nixpkgs:nixos=/root/nix/nixpkgs/nixos
ONBUILD ENV PATH /root/.nix-profile/bin:/root/.nix-profile/sbin:/bin:/sbin:/usr/bin:/usr/sbin
ONBUILD ENV ENV /etc/profile
ENV ENV /etc/profile

View File

@@ -0,0 +1,95 @@
#!/bin/sh
GNOME_FTP="ftp.gnome.org/pub/GNOME/sources"
project=$1
if [ "$project" == "--help" ]; then
echo "Usage: $0 project [major.minor]"
exit 0
fi
baseVersion=$2
if [ -z "$project" ]; then
echo "No project specified, exiting"
exit 1
fi
# curl -l ftp://... doesn't work from my office in HSE, and I don't want to have
# any conversations with sysadmin. Somehow lftp works.
if [ "$FTP_CLIENT" = "lftp" ]; then
ls_ftp() {
lftp -c "open $1; cls"
}
else
ls_ftp() {
curl -l "$1"/
}
fi
if [ -z "$baseVersion" ]; then
echo "Looking for available versions..." >&2
available_baseversions=( `ls_ftp ftp://${GNOME_FTP}/${project} | grep '[0-9]\.[0-9]' | sort -t. -k1,1n -k 2,2n` )
echo -e "The following versions are available:\n ${available_baseversions[@]}" >&2
echo -en "Choose one of them: " >&2
read baseVersion
fi
FTPDIR="${GNOME_FTP}/${project}/${baseVersion}"
#version=`curl -l ${FTPDIR}/ 2>/dev/null | grep LATEST-IS | sed -e s/LATEST-IS-//`
# gnome's LATEST-IS is broken. Do not trust it.
files=$(ls_ftp "${FTPDIR}")
declare -A versions
for f in $files; do
case $f in
(LATEST-IS-*|*.news|*.changes|*.sha256sum|*.diff*):
;;
($project-*.*.9*.tar.*):
tmp=${f#$project-}
tmp=${tmp%.tar*}
echo "Ignored unstable version ${tmp}" >&2
;;
($project-*.tar.*):
tmp=${f#$project-}
tmp=${tmp%.tar*}
versions[${tmp}]=1
;;
(*):
echo "UNKNOWN FILE $f"
;;
esac
done
echo "Found versions ${!versions[@]}" >&2
version=`echo ${!versions[@]} | sed -e 's/ /\n/g' | sort -t. -k1,1n -k 2,2n -k 3,3n | tail -n1`
echo "Latest version is: ${version}" >&2
name=${project}-${version}
echo "Fetching .sha256 file" >&2
curl -O http://${FTPDIR}/${name}.sha256sum
extensions=( "xz" "bz2" "gz" )
echo "Choosing archive extension (known are ${extensions[@]})..." >&2
for ext in ${extensions[@]}; do
if grep "\\.tar\\.${ext}$" ${name}.sha256sum >& /dev/null; then
ext_pref=$ext
sha256=$(grep "\\.tar\\.${ext}$" ${name}.sha256sum | cut -f1 -d\ )
break
fi
done
sha256=`nix-hash --to-base32 --type sha256 $sha256`
echo "Chosen ${ext_pref}, hash is ${sha256}" >&2
cat <<EOF
name = "${project}-${version}";
src = fetchurl {
url = mirror://gnome/sources/${project}/${baseVersion}/${project}-${version}.tar.${ext_pref};
sha256 = "${sha256}";
};
EOF
rm -v ${name}.sha256sum >&2

View File

@@ -1,138 +0,0 @@
#!/usr/bin/env bash
set -o pipefail
GNOME_FTP="ftp.gnome.org/pub/GNOME/sources"
usage() {
echo "Usage: $0 show|update project [major.minor]" >&2
exit 0
}
if [ "$#" -lt 1 ]; then
usage
fi
action="$1"
project="$2"
majorVersion="$3"
if [ "$action" != "show" ] && [ "$action" != "update" ]; then
echo "Unknown action $action" >&2
usage
fi
if [ -z "$project" ]; then
echo "No project specified, exiting"
exit 1
fi
# curl -l ftp://... doesn't work from my office in HSE, and I don't want to have
# any conversations with sysadmin. Somehow lftp works.
if [ "$FTP_CLIENT" = "lftp" ]; then
ls_ftp() {
lftp -c "open $1; cls"
}
else
ls_ftp() {
curl -s -l "$1"/
}
fi
if [ -z "$majorVersion" ]; then
echo "Looking for available versions..." >&2
available_baseversions=( `ls_ftp ftp://${GNOME_FTP}/${project} | grep '[0-9]\.[0-9]' | sort -t. -k1,1n -k 2,2n` )
if [ "$?" -ne "0" ]; then
echo "Project $project not found" >&2
exit 1
fi
echo -e "The following versions are available:\n ${available_baseversions[@]}" >&2
echo -en "Choose one of them: " >&2
read majorVersion
fi
if echo "$majorVersion" | grep -q "[0-9]\+\.[0-9]\+\.[0-9]\+"; then
# not a major version
version="$majorVersion"
majorVersion=$(echo "$majorVersion" | cut -d '.' -f 1,2)
fi
FTPDIR="${GNOME_FTP}/${project}/${majorVersion}"
#version=`curl -l ${FTPDIR}/ 2>/dev/null | grep LATEST-IS | sed -e s/LATEST-IS-//`
# gnome's LATEST-IS is broken. Do not trust it.
if [ -z "$version" ]; then
files=$(ls_ftp "${FTPDIR}")
declare -A versions
for f in $files; do
case $f in
(LATEST-IS-*|*.news|*.changes|*.sha256sum|*.diff*):
;;
($project-*.*.9*.tar.*):
tmp=${f#$project-}
tmp=${tmp%.tar*}
echo "Ignored unstable version ${tmp}" >&2
;;
($project-*.tar.*):
tmp=${f#$project-}
tmp=${tmp%.tar*}
versions[${tmp}]=1
;;
(*):
echo "UNKNOWN FILE $f"
;;
esac
done
echo "Found versions ${!versions[@]}" >&2
version=`echo ${!versions[@]} | sed -e 's/ /\n/g' | sort -t. -k1,1n -k 2,2n -k 3,3n | tail -n1`
echo "Latest version is: ${version}" >&2
fi
name=${project}-${version}
echo "Fetching .sha256 file" >&2
sha256out=$(curl -s -f http://${FTPDIR}/${name}.sha256sum)
if [ "$?" -ne "0" ]; then
echo "Version not found" >&2
exit 1
fi
extensions=( "xz" "bz2" "gz" )
echo "Choosing archive extension (known are ${extensions[@]})..." >&2
for ext in ${extensions[@]}; do
if echo -e "$sha256out" | grep -q "\\.tar\\.${ext}$"; then
ext_pref=$ext
sha256=$(echo -e "$sha256out" | grep "\\.tar\\.${ext}$" | cut -f1 -d\ )
break
fi
done
echo "Chosen ${ext_pref}, hash is ${sha256}" >&2
src="# Autogenerated by maintainers/scripts/gnome.sh update
fetchurl: {
name = \"${project}-${version}\";
src = fetchurl {
url = mirror://gnome/sources/${project}/${majorVersion}/${project}-${version}.tar.${ext_pref};
sha256 = \"${sha256}\";
};
}"
if [ "$action" == "update" ]; then
# find project in nixpkgs tree
GNOME_TOP=$(readlink -e $(dirname "${BASH_SOURCE[0]}")"/../../pkgs/desktops/gnome-3/")
projectPath=$(find "$GNOME_TOP" -name "$project" -print)
if [ -z "$projectPath" ]; then
echo "Project $project not found under $GNOME_TOP"
exit 1
fi
echo "Updating $projectPath/src.nix"
echo -e "$src" > "$projectPath/src.nix"
else
echo -e "\n$src"
fi

View File

@@ -6,7 +6,6 @@ hydra_eval_jobs \
--argstr system i686-linux \
--argstr system x86_64-darwin \
--argstr system i686-cygwin \
--argstr system x86_64-cygwin \
--argstr system i686-freebsd \
--arg officialRelease false \
--arg nixpkgs "{ outPath = builtins.storePath ./. ; rev = 1234; }" \

View File

@@ -3,7 +3,7 @@
stdenv.mkDerivation {
name = "nix-generate-from-cpan-1";
buildInputs = [ makeWrapper perl perlPackages.YAMLLibYAML perlPackages.JSON perlPackages.CPANPLUS ];
buildInputs = [ makeWrapper perl perlPackages.YAMLLibYAML perlPackages.JSON ];
unpackPhase = "true";
buildPhase = "true";
@@ -19,4 +19,4 @@ stdenv.mkDerivation {
maintainers = [ stdenv.lib.maintainers.eelco ];
description = "Utility to generate a Nix expression for a Perl package from CPAN";
};
}
}

View File

@@ -100,7 +100,7 @@ sub get_deps {
foreach my $n (keys %{$deps}) {
next if $n eq "perl";
# Hacky way to figure out if this module is part of Perl.
if ($n !~ /^JSON/ && $n !~ /^YAML/ && $n !~ /^Module::Pluggable/) {
if ($n !~ /^JSON/ && $n !~ /^YAML/) {
eval "use $n;";
if (!$@) {
print STDERR "skipping Perl-builtin module $n\n";

View File

@@ -62,7 +62,7 @@ for bin in $(find $binaryDist -executable -type f) :; do
)
if test "$names" = "glibc"; then names="stdenv.glibc"; fi
if echo $names | grep -c "gcc" &> /dev/null; then names="stdenv.cc.cc"; fi
if echo $names | grep -c "gcc" &> /dev/null; then names="stdenv.gcc.gcc"; fi
if test $lib != $libPath; then
interpreter="--interpreter \${$names}/lib/$lib"

View File

@@ -0,0 +1,146 @@
/* Tool to sort attribute sets. Primarily useful for keeping
all-packages.nix tidy.
To compile:
$ strc -i ../../maintainers/scripts/sort-attrs.str -la stratego-lib
Typical invocation:
$ sglr -m -p ~/Dev/nix/src/libexpr/nix.tbl -i all-packages.nix \
| implode-asfix --lex \
| ../../maintainers/scripts/sort-attrs \
| asfix-yield
*/
module sort-attrs
imports
libstratego-lib
libstratego-sglr
strategies
no-wsp = !appl(prod([], cf(opt(layout())), no-attrs()), [])
rules
list-sep(s): [] -> []
list-sep(s): [x | xs] -> [[x | before] | <list-sep(s)> [split | after]]
where
<split-fetch-keep(s)> xs => (before, split, after)
list-sep(s): [x | xs] -> [[x | xs]]
where
<not(split-fetch-keep(s))> xs
list-sep-end(s): xs -> [<conc> (before, [split]) | <list-sep-end(s)> after]
where
<split-fetch-keep(s)> xs => (before, split, after)
list-sep-end(s): xs -> [xs]
where
<not(split-fetch-keep(s))> xs
sort-attrs:
appl(p@prod(_, _, attrs([term(cons("Attrs"))])),
[ lit("{")
, ws1
, appl(p2@list(cf(iter-star(sort("Bind")))), attrs)
, ws2
, lit("}")
]
) ->
appl(p, [lit("{"), <no-wsp>, appl(p2, <concat> attrs'), ws2, lit("}")])
where
<debug> "found it";
<attach-wsp> [ws1 | attrs] => withWSP;
<list-sep(starts-section)> withWSP => groups;
<length; debug> groups;
<map({x', x'', x''', xs', starts, starts': \[x | xs] -> [x''' | xs']
where
<remove-section-start> x => (x', starts);
<map(regularise-empty-lines); if !starts; debug; sortable-section; debug then qsort(compare-attrs) else id end> [x' | xs] => [x'' | xs'];
<[] <+ \x -> ["\n\n\n" | x]\ > starts => starts';
<prepend-layout> (starts', x'') => x'''
\ })> groups => attrs';
<debug> "did it"
attach-wsp: [a, b | cs] -> [(a, b) | <attach-wsp> cs]
attach-wsp: [] -> []
strategies
starts-section =
?x@(appl(prod([cf(layout())], cf(opt(layout())), no-attrs()), cs), attr);
<implode-string; is-substring(!"###")> cs;
!x
rules
sortable-section = ?[s]; !s; explode-string; not(fetch({x: ?x; !(x, 97); geq}))
remove-section-start:
(appl(prod([cf(layout())], cf(opt(layout())), no-attrs()), cs), attr) ->
((appl(prod([cf(layout())], cf(opt(layout())), no-attrs()), cs'), attr), starts)
where
!cs;
list-sep-end(?10); // separate into lines, keeping the \n
map(implode-string);
partition(where(is-substring(!"###"))) => (starts, rest);
<map(explode-string); concat> rest => cs'
regularise-empty-lines:
(appl(prod([cf(layout())], cf(opt(layout())), no-attrs()), cs), attr) ->
(appl(prod([cf(layout())], cf(opt(layout())), no-attrs()), cs''), attr)
where
// separate into lines, keeping the \n
// last whitespace is significant, keep
<list-sep-end(?10); split-init-last> cs => (init, last);
<regularise-empty-lines'> init => cs'; // remove whitespace-only lines
<concat> [<explode-string> "\n\n", <concat> cs', last] => cs'' // add one empty line
/* Dirty hack: *do* keep the first empty line following a non-empty line. !!! order matters */
regularise-empty-lines': [] -> []
regularise-empty-lines': [x, y | xs] -> [x, y | <regularise-empty-lines'> xs]
where
<fetch-elem(not(?10 <+ ?32))> x;
<not(fetch-elem(not(?10 <+ ?32)))> y
regularise-empty-lines': [x | xs] -> [x | <regularise-empty-lines'> xs]
where <fetch-elem(not(?10 <+ ?32))> x
regularise-empty-lines': [x | xs] -> <regularise-empty-lines'> xs
where <not(fetch-elem(not(?10 <+ ?32)))> x
prepend-layout:
(text, (appl(prod([cf(layout())], cf(opt(layout())), no-attrs()), cs), attr)) ->
(appl(prod([cf(layout())], cf(opt(layout())), no-attrs()), cs''), attr)
where
<implode-string> cs => cs';
<conc-strings; explode-string> (<concat-strings> text, cs') => cs''
compare-attrs:
x@
( (_, appl(p1@prod(_, _, attrs([term(cons("Bind"))])), [id1 | xs1]))
, (_, appl(p2@prod(_, _, attrs([term(cons("Bind"))])), [id2 | xs2]))
)
-> x
where
<string-lt> (id1, id2)
strategies
main = io-wrap(
oncetd(sort-attrs)
)

View File

@@ -28,21 +28,14 @@ elif [[ $1 == build ]]; then
source $HOME/.nix-profile/etc/profile.d/nix.sh
if [[ $TRAVIS_PULL_REQUEST == false ]]; then
echo "=== Not a pull request"
echo "===> Not a pull request, checking evaluation"
nix-build pkgs/top-level/release.nix -A tarball
else
echo "=== Checking PR"
if ! nox-review pr ${TRAVIS_PULL_REQUEST}; then
if sudo dmesg | egrep 'Out of memory|Killed process' > /tmp/oom-log; then
echo "=== The build failed due to running out of memory:"
cat /tmp/oom-log
echo "=== Please disregard the result of this Travis build."
fi
exit 1
fi
# The current HEAD is the PR merged into origin/master, so we compare
# against origin/master
nox-review wip --against origin/master
fi
# echo "=== Checking tarball creation"
# nix-build pkgs/top-level/release.nix -A tarball
else
echo "$0: Unknown option $1" >&2
false

View File

@@ -1,112 +0,0 @@
#!/bin/sh
set -e
: ${NIXOS_CHANNELS:=https://nixos.org/channels/}
: ${CHANNELS_NAMESPACE:=refs/heads/channels/}
# List all channels which are currently in the repository which we would
# have to remove if they are not found again.
deadChannels=$(git for-each-ref --format="%(refname)" "$CHANNELS_NAMESPACE")
updateRef() {
local channelName=$1
local newRev=$2
# if the inputs are not valid, then we do not update any branch.
test -z "$newRev" -o -z "$channelName" && return;
# Update the local refs/heads/channels/* branches to be in-sync with the
# channel references.
local branch=$CHANNELS_NAMESPACE$channelName
oldRev=$(git rev-parse --short "$branch" 2>/dev/null || true)
if test "$oldRev" != "$newRev"; then
if git update-ref "$branch" "$newRev" 2>/dev/null; then
if test -z "$oldRev"; then
echo " * [new branch] $newRev -> ${branch#refs/heads/}"
else
echo " $oldRev..$newRev -> ${branch#refs/heads/}"
fi
else
if test -z "$oldRev"; then
echo " * [missing rev] $newRev -> ${branch#refs/heads/}"
else
echo " [missing rev] $oldRev..$newRev -> ${branch#refs/heads/}"
fi
fi
fi
# Filter out the current channel from the list of dead channels.
deadChannels=$(grep -v "$CHANNELS_NAMESPACE$channelName" <<EOF
$deadChannels
EOF
) ||true
}
# Find the name of all channels which are listed in the directory.
echo "Fetching channels from $NIXOS_CHANNELS:"
for channelName in : $(curl -s "$NIXOS_CHANNELS" | sed -n '/folder/ { s,.*href=",,; s,/".*,,; p }'); do
test "$channelName" = : && continue;
# Do not follow redirections, such that we can extract the
# short-changeset from the name of the directory where we are
# redirected to.
sha1=$(curl -sI "$NIXOS_CHANNELS$channelName" | sed -n '/Location/ { s,.*\.\([a-f0-9]*\)[ \r]*$,\1,; p; }')
updateRef "remotes/$channelName" "$sha1"
done
echo "Fetching channels from nixos-version:"
if currentSystem=$(nixos-version 2>/dev/null); then
# If the system is entirely build from a custom nixpkgs version,
# then the version is not annotated in git version. This sed
# expression is basically matching that the expressions end with
# ".<sha1> (Name)" to extract the sha1.
sha1=$(echo "$currentSystem" | sed -n 's,^.*\.\([a-f0-9]*\) *(.*)$,\1,; T skip; p; :skip;')
updateRef current-system "$sha1"
fi
echo "Fetching channels from $HOME/.nix-defexpr:"
for revFile in : $(find -L "$HOME/.nix-defexpr/" -maxdepth 4 -name svn-revision); do
test "$revFile" = : && continue;
# Deconstruct a path such as, into:
#
# /home/luke/.nix-defexpr/channels_root/nixos/nixpkgs/svn-revision
# channelName = root/nixos
#
# /home/luke/.nix-defexpr/channels/nixpkgs/svn-revision
# channelName = nixpkgs
#
user=${revFile#*.nix-defexpr/channels}
repo=${user#*/}
repo=${repo%%/*}
user=${user%%/*}
user=${user#_}
test -z "$user" && user=$USER
channelName="$user${user:+/}$repo"
sha1=$(sed -n 's,^.*\.\([a-f0-9]*\)$,\1,; T skip; p; :skip;' "$revFile")
updateRef "$channelName" "$sha1"
done
# Suggest to remove channel branches which are no longer found by this
# script. This is to handle the cases where a local/remote channel
# disappear. We should not attempt to remove manually any branches, as they
# might be user branches.
if test -n "$deadChannels"; then
echo "
Some old channel branches are still in your repository, if you
want to remove them, run the following command(s):
"
while read branch; do
echo " git update-ref -d $branch"
done <<EOF
$deadChannels
EOF
echo
fi

View File

@@ -1,7 +0,0 @@
viric viriketo@gmail.com
Pjotr Prins pjotr.public01@thebird.nl
Pjotr Prins pjotr.public05@thebird.nl
Wouter den Breejen wbreejen
MarcWeber marcweber
Ricardo Correia Ricardo M. Correia
ertesx@gmx.de ertes

View File

@@ -1,122 +0,0 @@
#! /bin/sh
export LANG=C LC_ALL=C LC_COLLATE=C
# Load git log
raw_git_log="$(git log)"
git_data="$(echo "$raw_git_log" | grep 'Author:' |
sed -e 's/^ *Author://; s/\\//g; s/^ *//; s/ *$//;
s/ @ .*//; s/ *[<]/\t/; s/[>]//')"
# Name - nick - email correspondence from log and from maintainer list
# Also there are a few manual entries
maintainers="$(cat "$(dirname "$0")/../../lib/maintainers.nix" |
grep '=' | sed -re 's/\\"/''/g;
s/ *([^ =]*) *= *" *(.*[^ ]) *[<](.*)[>] *".*/\1\t\2\t\3/')"
git_lines="$( ( echo "$git_data";
cat "$(dirname "$0")/vanity-manual-equalities.txt") | sort |uniq)"
emails="$(
( echo "$maintainers" | cut -f 3; echo "$git_data" | cut -f 2 ) |
sort | uniq | grep -E ".+@.+[.].+"
)"
fetchGithubName () {
commitid="$(
echo "$raw_git_log" | grep -B3 "Author: .*[<]$1[>]" | head -n 3 |
grep '^commit ' | tail -n 1 | sed -e 's/^commit //'
)"
userid="$(
curl https://github.com/NixOS/nixpkgs/commit/"$commitid" 2>/dev/null |
grep authored -B10 | grep 'href="/' |
sed -re 's@.* href="/@@; s@".*@@' |
grep -v "/commit/"
)";
echo "$userid"
}
[ -n "$NIXPKGS_GITHUB_NAME_CACHE" ] && {
echo "$emails" | while read email; do
line="$(grep "$email " "$NIXPKGS_GITHUB_NAME_CACHE")"
[ -z "$line" ] && {
echo "$email $(fetchGithubName "$email")" >> \
"$NIXPKGS_GITHUB_NAME_CACHE"
}
done
}
# For RDF
normalize_name () {
sed -e 's/%/%25/g; s/ /%20/g; s/'\''/%27/g; s/"/%22/g; s/`/%60/g; s/\^/%5e/g; '
}
denormalize_name () {
sed -e 's/%20/ /g; s/%27/'\''/g; s/%22/"/g; s/%60/`/g; s/%5e/^/g; s/%25/%/g;';
}
n3="$(mktemp --suffix .n3)"
# «The same person» relation and a sorting hint
# Full name is something with a space
(
echo "$git_lines" | sed -re 's@(.*)\t(.*)@<my://name/\1> <my://can-be> <my://name/\2>.@'
echo "$git_lines" | sed -re 's@(.*)\t(.*)@<my://name/\2> <my://can-be> <my://name/\1>.@'
echo "$maintainers" | sed -re 's@(.*)\t(.*)\t(.*)@<my://name/\1> <my://can-be> <my://name/\2>.@'
echo "$maintainers" | sed -re 's@(.*)\t(.*)\t(.*)@<my://name/\2> <my://can-be> <my://name/\3>.@'
echo "$maintainers" | sed -re 's@(.*)\t(.*)\t(.*)@<my://name/\3> <my://can-be> <my://name/\1>.@'
echo "$git_lines" | grep ' ' | cut -f 1 | sed -e 's@.*@<my://name/&> <my://is-name> <my://0>.@'
echo "$git_lines" | grep -v ' ' | cut -f 1 | sed -e 's@.*@<my://name/&> <my://is-name> <my://1>.@'
echo "$maintainers" | cut -f 2 | sed -e 's@.*@<my://name/&> <my://is-name> <my://0>.@'
[ -n "$NIXPKGS_GITHUB_NAME_CACHE" ] && cat "$NIXPKGS_GITHUB_NAME_CACHE" |
grep -v " $" |
sed -re 's@(.*)\t(.*)@<my://name/\1> <my://at-github> <my://github/\2>.@'
) | normalize_name | grep -E '<my://[-a-z]+>' | sort | uniq > "$n3"
# Get transitive closure
sparql="$(nix-build '<nixpkgs>' -Q -A apache-jena --no-out-link)/bin/sparql"
name_list="$(
"$sparql" --results=TSV --data="$n3" "
select ?x ?y ?g where {
?x <my://can-be>+ ?y.
?x <my://is-name> ?g.
}
" | tail -n +2 |
sed -re 's@<my://name/@@g; s@<my://@@g; s@>@@g;' |
sort -k 2,3 -t ' '
)"
github_name_list="$(
"$sparql" --results=TSV --data="$n3" "
select ?x ?y where {
?x (<my://can-be>+ / <my://at-github>) ?y.
}
" | tail -n +2 |
sed -re 's@<my://(name|github)/@@g; s@<my://@@g; s@>@@g;'
)"
# Take first spelling option for every person
name_list_canonical="$(echo "$name_list" | cut -f 1,2 | uniq -f1)"
cleaner_script="$(echo "$name_list_canonical" | denormalize_name |
sed -re 's/(.*)\t(.*)/s#^\2$#\1#g/g')"
# Add github usernames
if [ -n "$NIXPKGS_GITHUB_NAME_CACHE" ]; then
github_adder_script="$(echo "$github_name_list" |
grep -E "$(echo "$name_list_canonical" | cut -f 2 |
tr '\n' '|' )" |
sort | uniq |
sed -re 's/(.*)\t(.*)/s| \1$| \1\t\2|g;/' |
denormalize_name
)"
else
github_adder_script=''
fi
echo "$name_list" | denormalize_name
echo
echo "$git_data" | cut -f 1 |
sed -e "$cleaner_script" |
sort | uniq -c | sort -k1n | sed -re "$github_adder_script" |
sed -re 's/^ *([0-9]+) /\1\t/'

View File

@@ -0,0 +1,21 @@
{
boot = {
loader.grub.device = "/dev/sda";
};
fileSystems = [
{ mountPoint = "/";
device = "/dev/sda1";
}
];
swapDevices = [
{ device = "/dev/sdb1"; }
];
services = {
openssh = {
enable = true;
};
};
}

View File

@@ -0,0 +1,32 @@
{
boot = {
loader.grub.device = "/dev/sda";
copyKernels = true;
bootMount = "(hd0,0)";
};
fileSystems = [
{ mountPoint = "/";
device = "/dev/sda3";
}
{ mountPoint = "/boot";
device = "/dev/sda1";
neededForBoot = true;
}
];
swapDevices = [
{ device = "/dev/sda2"; }
];
services = {
sshd = {
enable = true;
};
};
fonts = {
enableFontConfig = false;
};
}

View File

@@ -0,0 +1,27 @@
# This configuration has / on a LVM volume. Since Grub
# doesn't know about LVM, a separate /boot is therefore
# needed.
#
# In this example, labels are used for file systems and
# swap devices: "boot" might be /dev/sda1, "root" might be
# /dev/my-volume-group/root, and "swap" might be /dev/sda2.
# In particular there is no specific reference to the fact
# that / is on LVM; that's figured out automatically.
{
boot.loader.grub.device = "/dev/sda";
boot.initrd.kernelModules = ["ata_piix"];
fileSystems = [
{ mountPoint = "/";
label = "root";
}
{ mountPoint = "/boot";
label = "boot";
}
];
swapDevices = [
{ label = "swap"; }
];
}

View File

@@ -0,0 +1,36 @@
{
boot = {
loader.grub.device = "/dev/sda";
};
fileSystems = [
{ mountPoint = "/";
device = "/dev/sda1";
}
];
services = {
sshd = {
enable = true;
};
httpd = {
enable = true;
adminAddr = "admin@example.org";
subservices = {
subversion = {
enable = true;
dataDir = "/data/subversion";
notificationSender = "svn@example.org";
};
};
};
};
}

View File

@@ -0,0 +1,20 @@
# Configuration file used to install NixOS-x86_64 on a USB stick.
{
boot = {
loader.grub.device = "/dev/sda";
initrd = {
kernelModules = ["usb_storage" "ehci_hcd" "ohci_hcd"];
};
};
fileSystems = [
{ mountPoint = "/";
label = "nixos-usb";
}
];
fonts = {
enableFontConfig = false;
};
}

View File

@@ -1,12 +0,0 @@
To build the manual, you need Nix installed on your system (no need
for NixOS). To install Nix, follow the instructions at
https://nixos.org/nix/download.html
When you have Nix on your system, in the root directory of the project
(i.e., `nixpkgs`), run:
nix-build nixos/release.nix -A manual.x86_64-linux
When this command successfully finishes, it will tell you where the
manual got generated.

View File

@@ -1,65 +0,0 @@
<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-boot-problems">
<title>Boot Problems</title>
<para>If NixOS fails to boot, there are a number of kernel command
line parameters that may help you to identify or fix the issue. You
can add these parameters in the GRUB boot menu by pressing “e” to
modify the selected boot entry and editing the line starting with
<literal>linux</literal>. The following are some useful kernel command
line parameters that are recognised by the NixOS boot scripts or by
systemd:
<variablelist>
<varlistentry><term><literal>boot.shell_on_fail</literal></term>
<listitem><para>Start a root shell if something goes wrong in
stage 1 of the boot process (the initial ramdisk). This is
disabled by default because there is no authentication for the
root shell.</para></listitem>
</varlistentry>
<varlistentry><term><literal>boot.debug1</literal></term>
<listitem><para>Start an interactive shell in stage 1 before
anything useful has been done. That is, no modules have been
loaded and no file systems have been mounted, except for
<filename>/proc</filename> and
<filename>/sys</filename>.</para></listitem>
</varlistentry>
<varlistentry><term><literal>boot.trace</literal></term>
<listitem><para>Print every shell command executed by the stage 1
and 2 boot scripts.</para></listitem>
</varlistentry>
<varlistentry><term><literal>single</literal></term>
<listitem><para>Boot into rescue mode (a.k.a. single user mode).
This will cause systemd to start nothing but the unit
<literal>rescue.target</literal>, which runs
<command>sulogin</command> to prompt for the root password and
start a root login shell. Exiting the shell causes the system to
continue with the normal boot process.</para></listitem>
</varlistentry>
<varlistentry><term><literal>systemd.log_level=debug systemd.log_target=console</literal></term>
<listitem><para>Make systemd very verbose and send log messages to
the console instead of the journal.</para></listitem>
</varlistentry>
</variablelist>
For more parameters recognised by systemd, see
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
<para>If no login prompts or X11 login screens appear (e.g. due to
hanging dependencies), you can press Alt+ArrowUp. If youre lucky,
this will start rescue mode (described above). (Also note that since
most units have a 90-second timeout before systemd gives up on them,
the <command>agetty</command> login prompts should appear eventually
unless something is very wrong.)</para>
</section>

View File

@@ -1,62 +0,0 @@
<chapter 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-nix-gc">
<title>Cleaning the Nix Store</title>
<para>Nix has a purely functional model, meaning that packages are
never upgraded in place. Instead new versions of packages end up in a
different location in the Nix store (<filename>/nix/store</filename>).
You should periodically run Nixs <emphasis>garbage
collector</emphasis> to remove old, unreferenced packages. This is
easy:
<screen>
$ nix-collect-garbage
</screen>
Alternatively, you can use a systemd unit that does the same in the
background:
<screen>
$ systemctl start nix-gc.service
</screen>
You can tell NixOS in <filename>configuration.nix</filename> to run
this unit automatically at certain points in time, for instance, every
night at 03:15:
<programlisting>
nix.gc.automatic = true;
nix.gc.dates = "03:15";
</programlisting>
</para>
<para>The commands above do not remove garbage collector roots, such
as old system configurations. Thus they do not remove the ability to
roll back to previous configurations. The following command deletes
old roots, removing the ability to roll back to them:
<screen>
$ nix-collect-garbage -d
</screen>
You can also do this for specific profiles, e.g.
<screen>
$ nix-env -p /nix/var/nix/profiles/per-user/eelco/profile --delete-generations old
</screen>
Note that NixOS system configurations are stored in the profile
<filename>/nix/var/nix/profiles/system</filename>.</para>
<para>Another way to reclaim disk space (often as much as 40% of the
size of the Nix store) is to run Nixs store optimiser, which seeks
out identical files in the store and replaces them with hard links to
a single copy.
<screen>
$ nix-store --optimise
</screen>
Since this command needs to read the entire Nix store, it can take
quite a while to finish.</para>
</chapter>

View File

@@ -1,50 +0,0 @@
<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-container-networking">
<title>Container Networking</title>
<para>When you create a container using <literal>nixos-container
create</literal>, it gets it own private IPv4 address in the range
<literal>10.233.0.0/16</literal>. You can get the containers IPv4
address as follows:
<screen>
$ nixos-container show-ip foo
10.233.4.2
$ ping -c1 10.233.4.2
64 bytes from 10.233.4.2: icmp_seq=1 ttl=64 time=0.106 ms
</screen>
</para>
<para>Networking is implemented using a pair of virtual Ethernet
devices. The network interface in the container is called
<literal>eth0</literal>, while the matching interface in the host is
called <literal>ve-<replaceable>container-name</replaceable></literal>
(e.g., <literal>ve-foo</literal>). The container has its own network
namespace and the <literal>CAP_NET_ADMIN</literal> capability, so it
can perform arbitrary network configuration such as setting up
firewall rules, without affecting or having access to the hosts
network.</para>
<para>By default, containers cannot talk to the outside network. If
you want that, you should set up Network Address Translation (NAT)
rules on the host to rewrite container traffic to use your external
IP address. This can be accomplished using the following configuration
on the host:
<programlisting>
networking.nat.enable = true;
networking.nat.internalInterfaces = ["ve-+"];
networking.nat.externalInterface = "eth0";
</programlisting>
where <literal>eth0</literal> should be replaced with the desired
external interface. Note that <literal>ve-+</literal> is a wildcard
that matches all container interfaces.</para>
</section>

View File

@@ -1,34 +0,0 @@
<chapter 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="ch-containers">
<title>Container Management</title>
<para>NixOS allows you to easily run other NixOS instances as
<emphasis>containers</emphasis>. Containers are a light-weight
approach to virtualisation that runs software in the container at the
same speed as in the host system. NixOS containers share the Nix store
of the host, making container creation very efficient.</para>
<warning><para>Currently, NixOS containers are not perfectly isolated
from the host system. This means that a user with root access to the
container can do things that affect the host. So you should not give
container root access to untrusted users.</para></warning>
<para>NixOS containers can be created in two ways: imperatively, using
the command <command>nixos-container</command>, and declaratively, by
specifying them in your <filename>configuration.nix</filename>. The
declarative approach implies that containers get upgraded along with
your host system when you run <command>nixos-rebuild</command>, which
is often not what you want. By contrast, in the imperative approach,
containers are configured and updated independently from the host
system.</para>
<xi:include href="imperative-containers.xml" />
<xi:include href="declarative-containers.xml" />
<xi:include href="container-networking.xml" />
</chapter>

View File

@@ -1,73 +0,0 @@
<chapter 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-cgroups">
<title>Control Groups</title>
<para>To keep track of the processes in a running system, systemd uses
<emphasis>control groups</emphasis> (cgroups). A control group is a
set of processes used to allocate resources such as CPU, memory or I/O
bandwidth. There can be multiple control group hierarchies, allowing
each kind of resource to be managed independently.</para>
<para>The command <command>systemd-cgls</command> lists all control
groups in the <literal>systemd</literal> hierarchy, which is what
systemd uses to keep track of the processes belonging to each service
or user session:
<screen>
$ systemd-cgls
├─user
│ └─eelco
│ └─c1
│ ├─ 2567 -:0
│ ├─ 2682 kdeinit4: kdeinit4 Running...
│ ├─ <replaceable>...</replaceable>
│ └─10851 sh -c less -R
└─system
├─httpd.service
│ ├─2444 httpd -f /nix/store/3pyacby5cpr55a03qwbnndizpciwq161-httpd.conf -DNO_DETACH
│ └─<replaceable>...</replaceable>
├─dhcpcd.service
│ └─2376 dhcpcd --config /nix/store/f8dif8dsi2yaa70n03xir8r653776ka6-dhcpcd.conf
└─ <replaceable>...</replaceable>
</screen>
Similarly, <command>systemd-cgls cpu</command> shows the cgroups in
the CPU hierarchy, which allows per-cgroup CPU scheduling priorities.
By default, every systemd service gets its own CPU cgroup, while all
user sessions are in the top-level CPU cgroup. This ensures, for
instance, that a thousand run-away processes in the
<literal>httpd.service</literal> cgroup cannot starve the CPU for one
process in the <literal>postgresql.service</literal> cgroup. (By
contrast, it they were in the same cgroup, then the PostgreSQL process
would get 1/1001 of the cgroups CPU time.) You can limit a services
CPU share in <filename>configuration.nix</filename>:
<programlisting>
systemd.services.httpd.serviceConfig.CPUShares = 512;
</programlisting>
By default, every cgroup has 1024 CPU shares, so this will halve the
CPU allocation of the <literal>httpd.service</literal> cgroup.</para>
<para>There also is a <literal>memory</literal> hierarchy that
controls memory allocation limits; by default, all processes are in
the top-level cgroup, so any service or session can exhaust all
available memory. Per-cgroup memory limits can be specified in
<filename>configuration.nix</filename>; for instance, to limit
<literal>httpd.service</literal> to 512 MiB of RAM (excluding swap):
<programlisting>
systemd.services.httpd.serviceConfig.MemoryLimit = "512M";
</programlisting>
</para>
<para>The command <command>systemd-cgtop</command> shows a
continuously updated list of all cgroups with their CPU and memory
usage.</para>
</chapter>

View File

@@ -1,56 +0,0 @@
<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-declarative-containers">
<title>Declarative Container Specification</title>
<para>You can also specify containers and their configuration in the
hosts <filename>configuration.nix</filename>. For example, the
following specifies that there shall be a container named
<literal>database</literal> running PostgreSQL:
<programlisting>
containers.database =
{ config =
{ config, pkgs, ... }:
{ services.postgresql.enable = true;
services.postgresql.package = pkgs.postgresql92;
};
};
</programlisting>
If you run <literal>nixos-rebuild switch</literal>, the container will
be built and started. If the container was already running, it will be
updated in place, without rebooting.</para>
<para>By default, declarative containers share the network namespace
of the host, meaning that they can listen on (privileged)
ports. However, they cannot change the network configuration. You can
give a container its own network as follows:
<programlisting>
containers.database =
{ privateNetwork = true;
hostAddress = "192.168.100.10";
localAddress = "192.168.100.11";
};
</programlisting>
This gives the container a private virtual Ethernet interface with IP
address <literal>192.168.100.11</literal>, which is hooked up to a
virtual Ethernet interface on the host with IP address
<literal>192.168.100.10</literal>. (See the next section for details
on container networking.)</para>
<para>To disable the container, just remove it from
<filename>configuration.nix</filename> and run <literal>nixos-rebuild
switch</literal>. Note that this will not delete the root directory of
the container in <literal>/var/lib/containers</literal>.</para>
<para>Declarative containers can be started and stopped using the
corresponding systemd service, e.g. <literal>systemctl start
container@database</literal>.</para>
</section>

View File

@@ -1,124 +0,0 @@
<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-imperative-containers">
<title>Imperative Container Management</title>
<para>Well cover imperative container management using
<command>nixos-container</command> first. You create a container with
identifier <literal>foo</literal> as follows:
<screen>
$ nixos-container create foo
</screen>
This creates the containers root directory in
<filename>/var/lib/containers/foo</filename> and a small configuration
file in <filename>/etc/containers/foo.conf</filename>. It also builds
the containers initial system configuration and stores it in
<filename>/nix/var/nix/profiles/per-container/foo/system</filename>. You
can modify the initial configuration of the container on the command
line. For instance, to create a container that has
<command>sshd</command> running, with the given public key for
<literal>root</literal>:
<screen>
$ nixos-container create foo --config 'services.openssh.enable = true; \
users.extraUsers.root.openssh.authorizedKeys.keys = ["ssh-dss AAAAB3N…"];'
</screen>
</para>
<para>Creating a container does not start it. To start the container,
run:
<screen>
$ nixos-container start foo
</screen>
This command will return as soon as the container has booted and has
reached <literal>multi-user.target</literal>. On the host, the
container runs within a systemd unit called
<literal>container@<replaceable>container-name</replaceable>.service</literal>.
Thus, if something went wrong, you can get status info using
<command>systemctl</command>:
<screen>
$ systemctl status container@foo
</screen>
</para>
<para>If the container has started succesfully, you can log in as
root using the <command>root-login</command> operation:
<screen>
$ nixos-container root-login foo
[root@foo:~]#
</screen>
Note that only root on the host can do this (since there is no
authentication). You can also get a regular login prompt using the
<command>login</command> operation, which is available to all users on
the host:
<screen>
$ nixos-container login foo
foo login: alice
Password: ***
</screen>
With <command>nixos-container run</command>, you can execute arbitrary
commands in the container:
<screen>
$ nixos-container run foo -- uname -a
Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux
</screen>
</para>
<para>There are several ways to change the configuration of the
container. First, on the host, you can edit
<literal>/var/lib/container/<replaceable>name</replaceable>/etc/nixos/configuration.nix</literal>,
and run
<screen>
$ nixos-container update foo
</screen>
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 = "foo@example.org";'
$ curl http://$(nixos-container show-ip foo)/
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">…
</screen>
However, note that this will overwrite the containers
<filename>/etc/nixos/configuration.nix</filename>.</para>
<para>Alternatively, you can change the configuration from within the
container itself by running <command>nixos-rebuild switch</command>
inside the container. Note that the container by default does not have
a copy of the NixOS channel, so you should run <command>nix-channel
--update</command> first.</para>
<para>Containers can be stopped and started using
<literal>nixos-container stop</literal> and <literal>nixos-container
start</literal>, respectively, or by using
<command>systemctl</command> on the containers service unit. To
destroy a container, including its file system, do
<screen>
$ nixos-container destroy foo
</screen>
</para>
</section>

View File

@@ -1,52 +0,0 @@
<chapter 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-logging">
<title>Logging</title>
<para>System-wide logging is provided by systemds
<emphasis>journal</emphasis>, which subsumes traditional logging
daemons such as syslogd and klogd. Log entries are kept in binary
files in <filename>/var/log/journal/</filename>. The command
<literal>journalctl</literal> allows you to see the contents of the
journal. For example,
<screen>
$ journalctl -b
</screen>
shows all journal entries since the last reboot. (The output of
<command>journalctl</command> is piped into <command>less</command> by
default.) You can use various options and match operators to restrict
output to messages of interest. For instance, to get all messages
from PostgreSQL:
<screen>
$ journalctl -u postgresql.service
-- Logs begin at Mon, 2013-01-07 13:28:01 CET, end at Tue, 2013-01-08 01:09:57 CET. --
...
Jan 07 15:44:14 hagbard postgres[2681]: [2-1] LOG: database system is shut down
-- Reboot --
Jan 07 15:45:10 hagbard postgres[2532]: [1-1] LOG: database system was shut down at 2013-01-07 15:44:14 CET
Jan 07 15:45:13 hagbard postgres[2500]: [1-1] LOG: database system is ready to accept connections
</screen>
Or to get all messages since the last reboot that have at least a
“critical” severity level:
<screen>
$ journalctl -b -p crit
Dec 17 21:08:06 mandark sudo[3673]: pam_unix(sudo:auth): auth could not identify password for [alice]
Dec 29 01:30:22 mandark kernel[6131]: [1053513.909444] CPU6: Core temperature above threshold, cpu clock throttled (total events = 1)
</screen>
</para>
<para>The system journal is readable by root and by users in the
<literal>wheel</literal> and <literal>systemd-journal</literal>
groups. All users have a private journal that can be read using
<command>journalctl</command>.</para>
</chapter>

View File

@@ -1,18 +0,0 @@
<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-maintenance-mode">
<title>Maintenance Mode</title>
<para>You can enter rescue mode by running:
<screen>
$ systemctl rescue</screen>
This will eventually give you a single-user root shell. Systemd will
stop (almost) all system services. To get out of maintenance mode,
just exit from the rescue shell.</para>
</section>

View File

@@ -1,33 +0,0 @@
<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-nix-network-issues">
<title>Network Problems</title>
<para>Nix uses a so-called <emphasis>binary cache</emphasis> to
optimise building a package from source into downloading it as a
pre-built binary. That is, whenever a command like
<command>nixos-rebuild</command> needs a path in the Nix store, Nix
will try to download that path from the Internet rather than build it
from source. The default binary cache is
<uri>https://cache.nixos.org/</uri>. If this cache is unreachable,
Nix operations may take a long time due to HTTP connection timeouts.
You can disable the use of the binary cache by adding <option>--option
use-binary-caches false</option>, e.g.
<screen>
$ nixos-rebuild switch --option use-binary-caches false
</screen>
If you have an alternative binary cache at your disposal, you can use
it instead:
<screen>
$ nixos-rebuild switch --option binary-caches http://my-cache.example.org/
</screen>
</para>
</section>

View File

@@ -1,44 +0,0 @@
<chapter 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-rebooting">
<title>Rebooting and Shutting Down</title>
<para>The system can be shut down (and automatically powered off) by
doing:
<screen>
$ shutdown
</screen>
This is equivalent to running <command>systemctl
poweroff</command>.</para>
<para>To reboot the system, run
<screen>
$ reboot
</screen>
which is equivalent to <command>systemctl reboot</command>.
Alternatively, you can quickly reboot the system using
<literal>kexec</literal>, which bypasses the BIOS by directly loading
the new kernel into memory:
<screen>
$ systemctl kexec
</screen>
</para>
<para>The machine can be suspended to RAM (if supported) using
<command>systemctl suspend</command>, and suspended to disk using
<command>systemctl hibernate</command>.</para>
<para>These commands can be run by any user who is logged in locally,
i.e. on a virtual console or in X11; otherwise, the user is asked for
authentication.</para>
</chapter>

View File

@@ -1,48 +0,0 @@
<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-rollback">
<title>Rolling Back Configuration Changes</title>
<para>After running <command>nixos-rebuild</command> to switch to a
new configuration, you may find that the new configuration doesnt
work very well. In that case, there are several ways to return to a
previous configuration.</para>
<para>First, the GRUB boot manager allows you to boot into any
previous configuration that hasnt been garbage-collected. These
configurations can be found under the GRUB submenu “NixOS - All
configurations”. This is especially useful if the new configuration
fails to boot. After the system has booted, you can make the selected
configuration the default for subsequent boots:
<screen>
$ /run/current-system/bin/switch-to-configuration boot</screen>
</para>
<para>Second, you can switch to the previous configuration in a running
system:
<screen>
$ nixos-rebuild switch --rollback</screen>
This is equivalent to running:
<screen>
$ /nix/var/nix/profiles/system-<replaceable>N</replaceable>-link/bin/switch-to-configuration switch</screen>
where <replaceable>N</replaceable> is the number of the NixOS system
configuration. To get a list of the available configurations, do:
<screen>
$ ls -l /nix/var/nix/profiles/system-*-link
<replaceable>...</replaceable>
lrwxrwxrwx 1 root root 78 Aug 12 13:54 /nix/var/nix/profiles/system-268-link -> /nix/store/202b...-nixos-13.07pre4932_5a676e4-4be1055
</screen>
</para>
</section>

View File

@@ -1,24 +0,0 @@
<part 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="ch-running">
<title>Administration</title>
<partintro>
<para>This chapter describes various aspects of managing a running
NixOS system, such as how to use the <command>systemd</command>
service manager.</para>
</partintro>
<xi:include href="service-mgmt.xml" />
<xi:include href="rebooting.xml" />
<xi:include href="user-sessions.xml" />
<xi:include href="control-groups.xml" />
<xi:include href="logging.xml" />
<xi:include href="cleaning-store.xml" />
<xi:include href="containers.xml" />
<xi:include href="troubleshooting.xml" />
</part>

View File

@@ -1,83 +0,0 @@
<chapter 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-systemctl">
<title>Service Management</title>
<para>In NixOS, all system services are started and monitored using
the systemd program. Systemd is the “init” process of the system
(i.e. PID 1), the parent of all other processes. It manages a set of
so-called “units”, which can be things like system services
(programs), but also mount points, swap files, devices, targets
(groups of units) and more. Units can have complex dependencies; for
instance, one unit can require that another unit must be successfully
started before the first unit can be started. When the system boots,
it starts a unit named <literal>default.target</literal>; the
dependencies of this unit cause all system services to be started,
file systems to be mounted, swap files to be activated, and so
on.</para>
<para>The command <command>systemctl</command> is the main way to
interact with <command>systemd</command>. Without any arguments, it
shows the status of active units:
<screen>
$ systemctl
-.mount loaded active mounted /
swapfile.swap loaded active active /swapfile
sshd.service loaded active running SSH Daemon
graphical.target loaded active active Graphical Interface
<replaceable>...</replaceable>
</screen>
</para>
<para>You can ask for detailed status information about a unit, for
instance, the PostgreSQL database service:
<screen>
$ systemctl status postgresql.service
postgresql.service - PostgreSQL Server
Loaded: loaded (/nix/store/pn3q73mvh75gsrl8w7fdlfk3fq5qm5mw-unit/postgresql.service)
Active: active (running) since Mon, 2013-01-07 15:55:57 CET; 9h ago
Main PID: 2390 (postgres)
CGroup: name=systemd:/system/postgresql.service
├─2390 postgres
├─2418 postgres: writer process
├─2419 postgres: wal writer process
├─2420 postgres: autovacuum launcher process
├─2421 postgres: stats collector process
└─2498 postgres: zabbix zabbix [local] idle
Jan 07 15:55:55 hagbard postgres[2394]: [1-1] LOG: database system was shut down at 2013-01-07 15:55:05 CET
Jan 07 15:55:57 hagbard postgres[2390]: [1-1] LOG: database system is ready to accept connections
Jan 07 15:55:57 hagbard postgres[2420]: [1-1] LOG: autovacuum launcher started
Jan 07 15:55:57 hagbard systemd[1]: Started PostgreSQL Server.
</screen>
Note that this shows the status of the unit (active and running), all
the processes belonging to the service, as well as the most recent log
messages from the service.
</para>
<para>Units can be stopped, started or restarted:
<screen>
$ systemctl stop postgresql.service
$ systemctl start postgresql.service
$ systemctl restart postgresql.service
</screen>
These operations are synchronous: they wait until the service has
finished starting or stopping (or has failed). Starting a unit will
cause the dependencies of that unit to be started as well (if
necessary).</para>
<!-- - cgroups: each service and user session is a cgroup
- cgroup resource management -->
</chapter>

View File

@@ -1,37 +0,0 @@
<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-nix-store-corruption">
<title>Nix Store Corruption</title>
<para>After a system crash, its possible for files in the Nix store
to become corrupted. (For instance, the Ext4 file system has the
tendency to replace un-synced files with zero bytes.) NixOS tries
hard to prevent this from happening: it performs a
<command>sync</command> before switching to a new configuration, and
Nixs database is fully transactional. If corruption still occurs,
you may be able to fix it automatically.</para>
<para>If the corruption is in a path in the closure of the NixOS
system configuration, you can fix it by doing
<screen>
$ nixos-rebuild switch --repair
</screen>
This will cause Nix to check every path in the closure, and if its
cryptographic hash differs from the hash recorded in Nixs database,
the path is rebuilt or redownloaded.</para>
<para>You can also scan the entire Nix store for corrupt paths:
<screen>
$ nix-store --verify --check-contents --repair
</screen>
Any corrupt paths will be redownloaded if theyre available in a
binary cache; otherwise, they cannot be repaired.</para>
</section>

View File

@@ -1,18 +0,0 @@
<chapter 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="ch-troubleshooting">
<title>Troubleshooting</title>
<para>This chapter describes solutions to common problems you might
encounter when you manage your NixOS system.</para>
<xi:include href="boot-problems.xml" />
<xi:include href="maintenance-mode.xml" />
<xi:include href="rollback.xml" />
<xi:include href="store-corruption.xml" />
<xi:include href="network-problems.xml" />
</chapter>

Some files were not shown because too many files have changed in this diff Show More