···715In the following example we change the name of the package `pandas` to `foo`.
716```
717newpkgs = pkgs.overridePackages(self: super: rec {
718- python35Packages = super.python35Packages.override {
719- self = python35Packages // { pandas = python35Packages.pandas.override{name="foo";};};
720 };
721});
722```
···727(let
728729newpkgs = pkgs.overridePackages(self: super: rec {
730- python35Packages = super.python35Packages.override {
731- self = python35Packages // { pandas = python35Packages.pandas.override{name="foo";};};
732 };
733});
734in newpkgs.python35.withPackages (ps: [ps.blaze])
···743744newpkgs = pkgs.overridePackages(self: super: rec {
745 python35Packages = super.python35Packages.override {
746- self = python35Packages // { scipy = python35Packages.scipy_0_16;};
747 };
748});
749in newpkgs.python35.withPackages (ps: [ps.blaze])
···751```
752The requested package `blaze` depends upon `pandas` which itself depends on `scipy`.
75300000000000000754### `python setup.py bdist_wheel` cannot create .whl
755756-Executing `python setup.py bdist_wheel` fails with
757```
758ValueError: ZIP does not support timestamps before 1980
759```
760This is because files are included that depend on items in the Nix store which have a timestamp of, that is, it corresponds to January the 1st, 1970 at 00:00:00. And as the error informs you, ZIP does not support that.
761-Fortunately `bdist_wheel` takes into account `SOURCE_DATE_EPOCH`. On Nix this value is set to 1. By setting it to a value correspond to 1980 or later it is possible to build wheels.
762763Use 1980 as timestamp:
764```
765-SOURCE_DATE_EPOCH=315532800 python3 setup.py bdist_wheel
766```
767or the current time:
768```
769-SOURCE_DATE_EPOCH=$(date +%s) python3 setup.py bdist_wheel
770```
0000771772### `install_data` / `data_files` problems
773
···715In the following example we change the name of the package `pandas` to `foo`.
716```
717newpkgs = pkgs.overridePackages(self: super: rec {
718+ python35Packages = (super.python35Packages.override { self = python35Packages;})
719+ // { pandas = super.python35Packages.pandas.override {name = "foo";};
720 };
721});
722```
···727(let
728729newpkgs = pkgs.overridePackages(self: super: rec {
730+ python35Packages = (super.python35Packages.override { self = python35Packages;})
731+ // { pandas = super.python35Packages.pandas.override {name = "foo";};
732 };
733});
734in newpkgs.python35.withPackages (ps: [ps.blaze])
···743744newpkgs = pkgs.overridePackages(self: super: rec {
745 python35Packages = super.python35Packages.override {
746+ self = python35Packages // { scipy = python35Packages.scipy_0_17;};
747 };
748});
749in newpkgs.python35.withPackages (ps: [ps.blaze])
···751```
752The requested package `blaze` depends upon `pandas` which itself depends on `scipy`.
753754+A similar example but now using `django`
755+```
756+with import <nixpkgs> {};
757+758+(let
759+760+newpkgs = pkgs.overridePackages(self: super: rec {
761+ python27Packages = (super.python27Packages.override {self = python27Packages;})
762+ // { django = super.python27Packages.django_1_9; };
763+});
764+in newpkgs.python27.withPackages (ps: [ps.django_guardian ])
765+).env
766+```
767+768### `python setup.py bdist_wheel` cannot create .whl
769770+Executing `python setup.py bdist_wheel` in a `nix-shell `fails with
771```
772ValueError: ZIP does not support timestamps before 1980
773```
774This is because files are included that depend on items in the Nix store which have a timestamp of, that is, it corresponds to January the 1st, 1970 at 00:00:00. And as the error informs you, ZIP does not support that.
775+The command `bdist_wheel` takes into account `SOURCE_DATE_EPOCH`, and `nix-shell` sets this to 1. By setting it to a value corresponding to 1980 or later, or by unsetting it, it is possible to build wheels.
776777Use 1980 as timestamp:
778```
779+nix-shell --run "SOURCE_DATE_EPOCH=315532800 python3 setup.py bdist_wheel"
780```
781or the current time:
782```
783+nix-shell --run "SOURCE_DATE_EPOCH=$(date +%s) python3 setup.py bdist_wheel"
784```
785+or unset:
786+"""
787+nix-shell --run "unset SOURCE_DATE_EPOCH; python3 setup.py bdist_wheel"
788+"""
789790### `install_data` / `data_files` problems
791
+2-2
lib/lists.nix
···218 partition (x: x > 2) [ 5 1 2 3 4 ]
219 => { right = [ 5 3 4 ]; wrong = [ 1 2 ]; }
220 */
221- partition = pred:
222 fold (h: t:
223 if pred h
224 then { right = [h] ++ t.right; wrong = t.wrong; }
225 else { right = t.right; wrong = [h] ++ t.wrong; }
226- ) { right = []; wrong = []; };
227228 /* Merges two lists of the same size together. If the sizes aren't the same
229 the merging stops at the shortest. How both lists are merged is defined
···218 partition (x: x > 2) [ 5 1 2 3 4 ]
219 => { right = [ 5 3 4 ]; wrong = [ 1 2 ]; }
220 */
221+ partition = builtins.partition or (pred:
222 fold (h: t:
223 if pred h
224 then { right = [h] ++ t.right; wrong = t.wrong; }
225 else { right = t.right; wrong = [h] ++ t.wrong; }
226+ ) { right = []; wrong = []; });
227228 /* Merges two lists of the same size together. If the sizes aren't the same
229 the merging stops at the shortest. How both lists are merged is defined
···52 $gidsUsed{$g->{gid}} = 1 if defined $g->{gid};
53}
5455-foreach my $u (@{$spec->{groups}}) {
56- $uidsUsed{$u->{u}} = 1 if defined $u->{uid};
57}
5859# Read the current /etc/group.
···52 $gidsUsed{$g->{gid}} = 1 if defined $g->{gid};
53}
5455+foreach my $u (@{$spec->{users}}) {
56+ $uidsUsed{$u->{uid}} = 1 if defined $u->{uid};
57}
5859# Read the current /etc/group.
···1+<chapter xmlns="http://docbook.org/ns/docbook"
2+ xmlns:xlink="http://www.w3.org/1999/xlink"
3+ xmlns:xi="http://www.w3.org/2001/XInclude"
4+ version="5.0"
5+ xml:id="sec-dnscrypt-proxy">
6+7+ <title>DNSCrypt client proxy</title>
8+9+ <para>
10+ The DNSCrypt client proxy relays DNS queries to a DNSCrypt enabled
11+ upstream resolver. The traffic between the client and the upstream
12+ resolver is encrypted and authenticated, mitigating the risk of MITM
13+ attacks, DNS poisoning attacks, and third-party snooping (assuming the
14+ upstream is trustworthy).
15+ </para>
16+17+ <sect1><title>Basic configuration</title>
18+19+ <para>
20+ To enable the client proxy, set
21+ <programlisting>
22+ services.dnscrypt-proxy.enable = true;
23+ </programlisting>
24+ </para>
25+26+ <para>
27+ Enabling the client proxy does not alter the system nameserver; to
28+ relay local queries, prepend <literal>127.0.0.1</literal> to
29+ <option>networking.nameservers</option>.
30+ </para>
31+32+ </sect1>
33+34+ <sect1><title>As a forwarder for a caching DNS client</title>
35+36+ <para>
37+ By default, DNSCrypt proxy acts as a transparent proxy for the
38+ system stub resolver. Because the client does not cache lookups, this
39+ setup can significantly slow down e.g., web browsing. The recommended
40+ configuration is to run DNSCrypt proxy as a forwarder for a caching DNS
41+ client. To achieve this, change the default proxy listening port to
42+ a non-standard value and point the caching client to it:
43+ <programlisting>
44+ services.dnscrypt-proxy.localPort = 43;
45+ </programlisting>
46+ </para>
47+48+ <sect2><title>dnsmasq</title>
49+ <para>
50+ <programlisting>
51+ {
52+ services.dnsmasq.enable = true;
53+ services.dnsmasq.servers = [ "127.0.0.1#43" ];
54+ }
55+ </programlisting>
56+ </para>
57+ </sect2>
58+59+ <sect2><title>unbound</title>
60+ <para>
61+ <programlisting>
62+ {
63+ networking.nameservers = [ "127.0.0.1" ];
64+ services.unbound.enable = true;
65+ services.unbound.forwardAddresses = [ "127.0.0.1@43" ];
66+ services.unbound.extraConfig = ''
67+ do-not-query-localhost: no
68+ '';
69+ }
70+ </programlisting>
71+ </para>
72+ </sect2>
73+74+ </sect1>
75+76+</chapter>
···154155 system.activationScripts.tmpfs =
156 ''
157+ specialMount() {
158+ local device="$1"
159+ local mountPoint="$2"
160+ local options="$3"
161+ local fsType="$4"
162+163+ ${pkgs.utillinux}/bin/mount -t "$fsType" -o "remount,$options" "$device" "$mountPoint"
164+ }
165+ source ${config.system.build.earlyMountScript}
166 '';
167168 };
+14-12
nixos/modules/system/boot/stage-1-init.sh
···59echo "[1;32m<<< NixOS Stage 1 >>>[0m"
60echo
6162-63-# Mount special file systems.
64mkdir -p /etc/udev
65touch /etc/fstab # to shut up mount
66-touch /etc/mtab # to shut up mke2fs
67touch /etc/udev/hwdb.bin # to shut up udev
68touch /etc/initrd-release
69-mkdir -p /proc
70-mount -t proc proc /proc
71-mkdir -p /sys
72-mount -t sysfs sysfs /sys
73-mount -t devtmpfs -o "size=@devSize@" devtmpfs /dev
74-mkdir -p /run
75-mount -t tmpfs -o "mode=0755,size=@runSize@" tmpfs /run
76-mkdir /dev/pts
77-mount -t devpts devpts /dev/pts
0007879# Log the script output to /dev/kmsg or /run/log/stage-1-init.log.
80mkdir -p /tmp
···59echo "[1;32m<<< NixOS Stage 1 >>>[0m"
60echo
6162+# Make several required directories.
063mkdir -p /etc/udev
64touch /etc/fstab # to shut up mount
65+ln -s /proc/mounts /etc/mtab # to shut up mke2fs
66touch /etc/udev/hwdb.bin # to shut up udev
67touch /etc/initrd-release
68+69+# Mount special file systems.
70+specialMount() {
71+ local device="$1"
72+ local mountPoint="$2"
73+ local options="$3"
74+ local fsType="$4"
75+76+ mkdir -m 0755 -p "$mountPoint"
77+ mount -n -t "$fsType" -o "$options" "$device" "$mountPoint"
78+}
79+source @earlyMountScript@
8081# Log the script output to /dev/kmsg or /run/log/stage-1-init.log.
82mkdir -p /tmp
···37# Likewise, stage 1 mounts /proc, /dev and /sys, so if we don't have a
38# stage 1, we need to do that here.
39if [ ! -e /proc/1 ]; then
40- mkdir -m 0755 -p /proc
41- mount -n -t proc proc /proc
42- mkdir -m 0755 -p /dev
43- mount -t devtmpfs devtmpfs /dev
44- mkdir -m 0755 -p /sys
45- mount -t sysfs sysfs /sys
000046fi
4748···878889# More special file systems, initialise required directories.
90-if ! mountpoint -q /dev/shm; then
91- mkdir -m 0755 /dev/shm
92- mount -t tmpfs -o "rw,nosuid,nodev,size=@devShmSize@" tmpfs /dev/shm
93-fi
94-mkdir -m 0755 -p /dev/pts
95[ -e /proc/bus/usb ] && mount -t usbfs usbfs /proc/bus/usb # UML doesn't have USB by default
96mkdir -m 01777 -p /tmp
97mkdir -m 0755 -p /var /var/log /var/lib /var/db
···111# Also get rid of temporary GC roots.
112rm -rf /nix/var/nix/gcroots/tmp /nix/var/nix/temproots
113114-115-# Create a tmpfs on /run to hold runtime state for programs such as
116-# udev (if stage 1 hasn't already done so).
117-if ! mountpoint -q /run; then
118- rm -rf /run
119- mkdir -m 0755 -p /run
120- mount -t tmpfs -o "mode=0755,size=@runSize@" tmpfs /run
121-fi
122123# Create a ramfs on /run/keys to hold secrets that shouldn't be
124# written to disk (generally used for NixOps, harmless elsewhere).
···37# Likewise, stage 1 mounts /proc, /dev and /sys, so if we don't have a
38# stage 1, we need to do that here.
39if [ ! -e /proc/1 ]; then
40+ specialMount() {
41+ local device="$1"
42+ local mountPoint="$2"
43+ local options="$3"
44+ local fsType="$4"
45+46+ mkdir -m 0755 -p "$mountPoint"
47+ mount -n -t "$fsType" -o "$options" "$device" "$mountPoint"
48+ }
49+ source @earlyMountScript@
50fi
5152···919293# More special file systems, initialise required directories.
0000094[ -e /proc/bus/usb ] && mount -t usbfs usbfs /proc/bus/usb # UML doesn't have USB by default
95mkdir -m 01777 -p /tmp
96mkdir -m 0755 -p /var /var/log /var/lib /var/db
···110# Also get rid of temporary GC roots.
111rm -rf /nix/var/nix/gcroots/tmp /nix/var/nix/temproots
11200000000113114# Create a ramfs on /run/keys to hold secrets that shouldn't be
115# written to disk (generally used for NixOps, harmless elsewhere).
···4445 postPatch = ''
46 sed -i 's|/usr/share/locale|${gettext}/share/locale|g' lisp/international/mule-cmds.el
47+ # emacs runs then dumps itself. In the process, it keeps a copy of the
48+ # PATH env var, holding all the build inputs in it's closure.
49+ # Prevent that by running the self-dumping emacs with an empty PATH.
50+ sed -i 's|^RUN_TEMACS = |&PATH= |' src/Makefile.in
51 '';
5253 buildInputs =
···17 zlib
18 ];
1920+ patchPhase = ''
21+ substituteInPlace manuskript/ui/welcome.py \
22+ --replace sample-projects $out/share/${name}/sample-projects
23+ '';
24+25 buildPhase = '''';
2627 installPhase = ''
28+ mkdir -p $out/share/${name}
29+ cp -av bin/ i18n/ libs/ manuskript/ resources/ icons/ $out
30+ cp -r sample-projects/ $out/share/${name}
31 '';
3233 doCheck = false;
···35 meta = {
36 description = "A open-source tool for writers";
37 homepage = http://www.theologeek.ch/manuskript;
38+ longDescription = ''
39+ Manuskript is a tool for those writer who like to organize and
40+ plan everything before writing. The snowflake method can help you
41+ grow your idea into a book, by leading you step by step and asking
42+ you questions to go deeper. While writing, keep track of notes
43+ about every characters, plot, event, place in your story.
44+45+ Develop complex characters and keep track of all useful infos.
46+ Create intricate plots, linked to your characters, and use them to
47+ outline your story. Organize your ideas about the world your
48+ characters live in.
49+ '';
50 license = stdenv.lib.licenses.gpl3;
51 maintainers = [ stdenv.lib.maintainers.steveej ];
52 platforms = stdenv.lib.platforms.linux;
···1+{ stdenv, fetchurl }:
2+3+stdenv.mkDerivation {
4+ name = "wavrsocvt-1.0.2.0";
5+6+ src = fetchurl {
7+ url = "http://bricxcc.sourceforge.net/wavrsocvt.tgz";
8+ sha256 = "15qlvdfwbiclljj7075ycm78yzqahzrgl4ky8pymix5179acm05h";
9+ };
10+11+ phases = [ "unpackPhase" "installPhase" ];
12+13+ unpackPhase = ''
14+ tar -zxf $src
15+ '';
16+17+ installPhase = ''
18+ mkdir -p $out/bin
19+ cp wavrsocvt $out/bin
20+ '';
21+22+ meta = with stdenv.lib; {
23+ description = "Convert .wav files into sound files for Lego NXT brick";
24+ longDescription = ''
25+ wavrsocvt is a command-line utility which can be used from a
26+ terminal window or script to convert .wav files into sound
27+ files for the NXT brick (.rso files). It can also convert the
28+ other direction (i.e., .rso -> .wav). It can produce RSO files
29+ with a sample rate between 2000 and 16000 (the min/max range of
30+ supported sample rates in the standard NXT firmware).
31+ You can then upload these with e.g. nxt-python.
32+ '';
33+ homepage = http://bricxcc.sourceforge.net/;
34+ license = licenses.mpl11;
35+ maintainers = with maintainers; [ leenaars ];
36+ platforms = with platforms; linux;
37+ };
38+}
···1+{ stdenv, fetchurl, openssl, libsamplerate, alsaLib }:
23stdenv.mkDerivation rec {
4+ name = "pjsip-${version}";
5+ version = "2.5.5";
67 src = fetchurl {
8+ url = "http://www.pjsip.org/release/${version}/pjproject-${version}.tar.bz2";
9+ sha256 = "ab39207b761d3485199cd881410afeb2d171dff7c2bf75e8caae91c6dca508f3";
10 };
1112+ buildInputs = [ openssl libsamplerate alsaLib ];
1314 postInstall = ''
15 mkdir -p $out/bin
···22 dontPatchELF = true;
2324 meta = {
25+ description = "A multimedia communication library written in C, implementing standard based protocols such as SIP, SDP, RTP, STUN, TURN, and ICE";
26 homepage = http://pjsip.org/;
27 license = stdenv.lib.licenses.gpl2Plus;
28 maintainers = with stdenv.lib.maintainers; [viric];
+10
pkgs/applications/office/libreoffice/still.nix
···69 sha256 = "1qg0dj0zwh5ifhmvv4k771nmyqddz4ifn75s9mr1p0nyix8zks8x";
70 };
71000000000072 # Openoffice will open libcups dynamically, so we link it directly
73 # to make its dlopen work.
74 # It also seems not to mention libdl explicitly in some places.
···69 sha256 = "1qg0dj0zwh5ifhmvv4k771nmyqddz4ifn75s9mr1p0nyix8zks8x";
70 };
7172+ # we only have this problem on i686 ATM
73+ patches = if stdenv.is64bit then null else [
74+ (fetchurl {
75+ name = "disable-flaky-tests.diff";
76+ url = "https://anonscm.debian.org/git/pkg-openoffice/libreoffice.git/plain"
77+ + "/patches/disable-flaky-tests.diff?h=libreoffice_5.1.5_rc2-1";
78+ sha256 = "1v1aiqdi64iijjraj6v4ljzclrd9lqan54hmy2h6m20x3ab005wb";
79+ })
80+ ];
81+82 # Openoffice will open libcups dynamically, so we link it directly
83 # to make its dlopen work.
84 # It also seems not to mention libdl explicitly in some places.
···11 sha256 = "06g691px0abndp5zvz2ba1g675rcqb64n055h5ahgnlck5cdpawg";
12 };
1314+ dontStrip = true; # Stripping breaks some of the binaries
15+16 installPhase = ''
17 mkdir -p $out/share/raspberrypi/boot
18 cp -R boot/* $out/share/raspberrypi/boot
+4-2
pkgs/os-specific/linux/kernel/common-config.nix
···346 LOGO n # not needed
347 MEDIA_ATTACH y
348 MEGARAID_NEWGEN y
349- ${optionalString (versionAtLeast version "3.15") ''
350 MLX4_EN_VXLAN y
351 ''}
352 MODVERSIONS y
···433 PARAVIRT? y
434 HYPERVISOR_GUEST y
435 PARAVIRT_SPINLOCKS? y
436- KVM_APIC_ARCHITECTURE y
00437 KVM_ASYNC_PF y
438 ${optionalString (versionAtLeast version "4.0") ''
439 KVM_COMPAT? y
···346 LOGO n # not needed
347 MEDIA_ATTACH y
348 MEGARAID_NEWGEN y
349+ ${optionalString (versionAtLeast version "3.15" && versionOlder version "4.8") ''
350 MLX4_EN_VXLAN y
351 ''}
352 MODVERSIONS y
···433 PARAVIRT? y
434 HYPERVISOR_GUEST y
435 PARAVIRT_SPINLOCKS? y
436+ ${optionalString (versionOlder version "4.8") ''
437+ KVM_APIC_ARCHITECTURE y
438+ ''}
439 KVM_ASYNC_PF y
440 ${optionalString (versionAtLeast version "4.0") ''
441 KVM_COMPAT? y
···1-{ stdenv, fetchurl, buildPythonApplication, makeWrapper, ffmpeg, zip
2-, pandoc ? null
00000003}:
45-# Pandoc is required to build the package's man page. Release tarballs
6-# contain a formatted man page already, though, so it's fine to pass
7-# "pandoc = null" to this derivation; the man page will still be
8-# installed. We keep the pandoc argument and build input in place in
9-# case someone wants to use this derivation to build a Git version of
10-# the tool that doesn't have the formatted man page included.
1112buildPythonApplication rec {
13···19 sha256 = "017x2hqc2bacypjmn9ac9f91y9y6afydl0z7dich5l627494hvfg";
20 };
2122- buildInputs = [ makeWrapper zip pandoc ];
2324 # Ensure ffmpeg is available in $PATH for post-processing & transcoding support.
25- postInstall = stdenv.lib.optionalString (ffmpeg != null)
26- ''wrapProgram $out/bin/youtube-dl --prefix PATH : "${ffmpeg.bin}/bin"'';
00002728 # Requires network
29 doCheck = false;
3031- meta = with stdenv.lib; {
32 homepage = http://rg3.github.io/youtube-dl/;
33 repositories.git = https://github.com/rg3/youtube-dl.git;
34 description = "Command-line tool to download videos from YouTube.com and other sites";
···1+{ stdenv, fetchurl, buildPythonApplication, makeWrapper, zip, ffmpeg, pandoc
2+, atomicparsley
3+# Pandoc is required to build the package's man page. Release tarballs contain a
4+# formatted man page already, though, it will still be installed. We keep the
5+# manpage argument in place in case someone wants to use this derivation to
6+# build a Git version of the tool that doesn't have the formatted man page
7+# included.
8+, generateManPage ? false
9+, ffmpegSupport ? true
10}:
1112+with stdenv.lib;
000001314buildPythonApplication rec {
15···21 sha256 = "017x2hqc2bacypjmn9ac9f91y9y6afydl0z7dich5l627494hvfg";
22 };
2324+ buildInputs = [ makeWrapper zip ] ++ optional generateManPage pandoc;
2526 # Ensure ffmpeg is available in $PATH for post-processing & transcoding support.
27+ # atomicparsley for embedding thumbnails
28+ postInstall = let
29+ packagesthatwillbeusedbelow = [ atomicparsley ] ++ optional ffmpegSupport ffmpeg;
30+ in ''
31+ wrapProgram $out/bin/youtube-dl --prefix PATH : "${makeBinPath packagesthatwillbeusedbelow}"
32+ '';
3334 # Requires network
35 doCheck = false;
3637+ meta = {
38 homepage = http://rg3.github.io/youtube-dl/;
39 repositories.git = https://github.com/rg3/youtube-dl.git;
40 description = "Command-line tool to download videos from YouTube.com and other sites";