···715715In the following example we change the name of the package `pandas` to `foo`.
716716```
717717newpkgs = pkgs.overridePackages(self: super: rec {
718718- python35Packages = super.python35Packages.override {
719719- self = python35Packages // { pandas = python35Packages.pandas.override{name="foo";};};
718718+ python35Packages = (super.python35Packages.override { self = python35Packages;})
719719+ // { pandas = super.python35Packages.pandas.override {name = "foo";};
720720 };
721721});
722722```
···727727(let
728728729729newpkgs = pkgs.overridePackages(self: super: rec {
730730- python35Packages = super.python35Packages.override {
731731- self = python35Packages // { pandas = python35Packages.pandas.override{name="foo";};};
730730+ python35Packages = (super.python35Packages.override { self = python35Packages;})
731731+ // { pandas = super.python35Packages.pandas.override {name = "foo";};
732732 };
733733});
734734in newpkgs.python35.withPackages (ps: [ps.blaze])
···743743744744newpkgs = pkgs.overridePackages(self: super: rec {
745745 python35Packages = super.python35Packages.override {
746746- self = python35Packages // { scipy = python35Packages.scipy_0_16;};
746746+ self = python35Packages // { scipy = python35Packages.scipy_0_17;};
747747 };
748748});
749749in newpkgs.python35.withPackages (ps: [ps.blaze])
···751751```
752752The requested package `blaze` depends upon `pandas` which itself depends on `scipy`.
753753754754+A similar example but now using `django`
755755+```
756756+with import <nixpkgs> {};
757757+758758+(let
759759+760760+newpkgs = pkgs.overridePackages(self: super: rec {
761761+ python27Packages = (super.python27Packages.override {self = python27Packages;})
762762+ // { django = super.python27Packages.django_1_9; };
763763+});
764764+in newpkgs.python27.withPackages (ps: [ps.django_guardian ])
765765+).env
766766+```
767767+754768### `python setup.py bdist_wheel` cannot create .whl
755769756756-Executing `python setup.py bdist_wheel` fails with
770770+Executing `python setup.py bdist_wheel` in a `nix-shell `fails with
757771```
758772ValueError: ZIP does not support timestamps before 1980
759773```
760774This 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.
761761-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.
775775+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.
762776763777Use 1980 as timestamp:
764778```
765765-SOURCE_DATE_EPOCH=315532800 python3 setup.py bdist_wheel
779779+nix-shell --run "SOURCE_DATE_EPOCH=315532800 python3 setup.py bdist_wheel"
766780```
767781or the current time:
768782```
769769-SOURCE_DATE_EPOCH=$(date +%s) python3 setup.py bdist_wheel
783783+nix-shell --run "SOURCE_DATE_EPOCH=$(date +%s) python3 setup.py bdist_wheel"
770784```
785785+or unset:
786786+"""
787787+nix-shell --run "unset SOURCE_DATE_EPOCH; python3 setup.py bdist_wheel"
788788+"""
771789772790### `install_data` / `data_files` problems
773791
+2-2
lib/lists.nix
···218218 partition (x: x > 2) [ 5 1 2 3 4 ]
219219 => { right = [ 5 3 4 ]; wrong = [ 1 2 ]; }
220220 */
221221- partition = pred:
221221+ partition = builtins.partition or (pred:
222222 fold (h: t:
223223 if pred h
224224 then { right = [h] ++ t.right; wrong = t.wrong; }
225225 else { right = t.right; wrong = [h] ++ t.wrong; }
226226- ) { right = []; wrong = []; };
226226+ ) { right = []; wrong = []; });
227227228228 /* Merges two lists of the same size together. If the sizes aren't the same
229229 the merging stops at the shortest. How both lists are merged is defined
···5252 $gidsUsed{$g->{gid}} = 1 if defined $g->{gid};
5353}
54545555-foreach my $u (@{$spec->{groups}}) {
5656- $uidsUsed{$u->{u}} = 1 if defined $u->{uid};
5555+foreach my $u (@{$spec->{users}}) {
5656+ $uidsUsed{$u->{uid}} = 1 if defined $u->{uid};
5757}
58585959# Read the current /etc/group.
···11+<chapter xmlns="http://docbook.org/ns/docbook"
22+ xmlns:xlink="http://www.w3.org/1999/xlink"
33+ xmlns:xi="http://www.w3.org/2001/XInclude"
44+ version="5.0"
55+ xml:id="sec-dnscrypt-proxy">
66+77+ <title>DNSCrypt client proxy</title>
88+99+ <para>
1010+ The DNSCrypt client proxy relays DNS queries to a DNSCrypt enabled
1111+ upstream resolver. The traffic between the client and the upstream
1212+ resolver is encrypted and authenticated, mitigating the risk of MITM
1313+ attacks, DNS poisoning attacks, and third-party snooping (assuming the
1414+ upstream is trustworthy).
1515+ </para>
1616+1717+ <sect1><title>Basic configuration</title>
1818+1919+ <para>
2020+ To enable the client proxy, set
2121+ <programlisting>
2222+ services.dnscrypt-proxy.enable = true;
2323+ </programlisting>
2424+ </para>
2525+2626+ <para>
2727+ Enabling the client proxy does not alter the system nameserver; to
2828+ relay local queries, prepend <literal>127.0.0.1</literal> to
2929+ <option>networking.nameservers</option>.
3030+ </para>
3131+3232+ </sect1>
3333+3434+ <sect1><title>As a forwarder for a caching DNS client</title>
3535+3636+ <para>
3737+ By default, DNSCrypt proxy acts as a transparent proxy for the
3838+ system stub resolver. Because the client does not cache lookups, this
3939+ setup can significantly slow down e.g., web browsing. The recommended
4040+ configuration is to run DNSCrypt proxy as a forwarder for a caching DNS
4141+ client. To achieve this, change the default proxy listening port to
4242+ a non-standard value and point the caching client to it:
4343+ <programlisting>
4444+ services.dnscrypt-proxy.localPort = 43;
4545+ </programlisting>
4646+ </para>
4747+4848+ <sect2><title>dnsmasq</title>
4949+ <para>
5050+ <programlisting>
5151+ {
5252+ services.dnsmasq.enable = true;
5353+ services.dnsmasq.servers = [ "127.0.0.1#43" ];
5454+ }
5555+ </programlisting>
5656+ </para>
5757+ </sect2>
5858+5959+ <sect2><title>unbound</title>
6060+ <para>
6161+ <programlisting>
6262+ {
6363+ networking.nameservers = [ "127.0.0.1" ];
6464+ services.unbound.enable = true;
6565+ services.unbound.forwardAddresses = [ "127.0.0.1@43" ];
6666+ services.unbound.extraConfig = ''
6767+ do-not-query-localhost: no
6868+ '';
6969+ }
7070+ </programlisting>
7171+ </para>
7272+ </sect2>
7373+7474+ </sect1>
7575+7676+</chapter>
···3737# Likewise, stage 1 mounts /proc, /dev and /sys, so if we don't have a
3838# stage 1, we need to do that here.
3939if [ ! -e /proc/1 ]; then
4040- mkdir -m 0755 -p /proc
4141- mount -n -t proc proc /proc
4242- mkdir -m 0755 -p /dev
4343- mount -t devtmpfs devtmpfs /dev
4444- mkdir -m 0755 -p /sys
4545- mount -t sysfs sysfs /sys
4040+ specialMount() {
4141+ local device="$1"
4242+ local mountPoint="$2"
4343+ local options="$3"
4444+ local fsType="$4"
4545+4646+ mkdir -m 0755 -p "$mountPoint"
4747+ mount -n -t "$fsType" -o "$options" "$device" "$mountPoint"
4848+ }
4949+ source @earlyMountScript@
4650fi
47514852···879188928993# More special file systems, initialise required directories.
9090-if ! mountpoint -q /dev/shm; then
9191- mkdir -m 0755 /dev/shm
9292- mount -t tmpfs -o "rw,nosuid,nodev,size=@devShmSize@" tmpfs /dev/shm
9393-fi
9494-mkdir -m 0755 -p /dev/pts
9594[ -e /proc/bus/usb ] && mount -t usbfs usbfs /proc/bus/usb # UML doesn't have USB by default
9695mkdir -m 01777 -p /tmp
9796mkdir -m 0755 -p /var /var/log /var/lib /var/db
···111110# Also get rid of temporary GC roots.
112111rm -rf /nix/var/nix/gcroots/tmp /nix/var/nix/temproots
113112114114-115115-# Create a tmpfs on /run to hold runtime state for programs such as
116116-# udev (if stage 1 hasn't already done so).
117117-if ! mountpoint -q /run; then
118118- rm -rf /run
119119- mkdir -m 0755 -p /run
120120- mount -t tmpfs -o "mode=0755,size=@runSize@" tmpfs /run
121121-fi
122113123114# Create a ramfs on /run/keys to hold secrets that shouldn't be
124115# written to disk (generally used for NixOps, harmless elsewhere).
···44444545 postPatch = ''
4646 sed -i 's|/usr/share/locale|${gettext}/share/locale|g' lisp/international/mule-cmds.el
4747+ # emacs runs then dumps itself. In the process, it keeps a copy of the
4848+ # PATH env var, holding all the build inputs in it's closure.
4949+ # Prevent that by running the self-dumping emacs with an empty PATH.
5050+ sed -i 's|^RUN_TEMACS = |&PATH= |' src/Makefile.in
4751 '';
48524953 buildInputs =
+20-2
pkgs/applications/editors/manuskript/default.nix
···1717 zlib
1818 ];
19192020+ patchPhase = ''
2121+ substituteInPlace manuskript/ui/welcome.py \
2222+ --replace sample-projects $out/share/${name}/sample-projects
2323+ '';
2424+2025 buildPhase = '''';
21262227 installPhase = ''
2323- mkdir -p $out
2424- cp -av * $out/
2828+ mkdir -p $out/share/${name}
2929+ cp -av bin/ i18n/ libs/ manuskript/ resources/ icons/ $out
3030+ cp -r sample-projects/ $out/share/${name}
2531 '';
26322733 doCheck = false;
···2935 meta = {
3036 description = "A open-source tool for writers";
3137 homepage = http://www.theologeek.ch/manuskript;
3838+ longDescription = ''
3939+ Manuskript is a tool for those writer who like to organize and
4040+ plan everything before writing. The snowflake method can help you
4141+ grow your idea into a book, by leading you step by step and asking
4242+ you questions to go deeper. While writing, keep track of notes
4343+ about every characters, plot, event, place in your story.
4444+4545+ Develop complex characters and keep track of all useful infos.
4646+ Create intricate plots, linked to your characters, and use them to
4747+ outline your story. Organize your ideas about the world your
4848+ characters live in.
4949+ '';
3250 license = stdenv.lib.licenses.gpl3;
3351 maintainers = [ stdenv.lib.maintainers.steveej ];
3452 platforms = stdenv.lib.platforms.linux;
···11+{ stdenv, fetchurl }:
22+33+stdenv.mkDerivation {
44+ name = "wavrsocvt-1.0.2.0";
55+66+ src = fetchurl {
77+ url = "http://bricxcc.sourceforge.net/wavrsocvt.tgz";
88+ sha256 = "15qlvdfwbiclljj7075ycm78yzqahzrgl4ky8pymix5179acm05h";
99+ };
1010+1111+ phases = [ "unpackPhase" "installPhase" ];
1212+1313+ unpackPhase = ''
1414+ tar -zxf $src
1515+ '';
1616+1717+ installPhase = ''
1818+ mkdir -p $out/bin
1919+ cp wavrsocvt $out/bin
2020+ '';
2121+2222+ meta = with stdenv.lib; {
2323+ description = "Convert .wav files into sound files for Lego NXT brick";
2424+ longDescription = ''
2525+ wavrsocvt is a command-line utility which can be used from a
2626+ terminal window or script to convert .wav files into sound
2727+ files for the NXT brick (.rso files). It can also convert the
2828+ other direction (i.e., .rso -> .wav). It can produce RSO files
2929+ with a sample rate between 2000 and 16000 (the min/max range of
3030+ supported sample rates in the standard NXT firmware).
3131+ You can then upload these with e.g. nxt-python.
3232+ '';
3333+ homepage = http://bricxcc.sourceforge.net/;
3434+ license = licenses.mpl11;
3535+ maintainers = with maintainers; [ leenaars ];
3636+ platforms = with platforms; linux;
3737+ };
3838+}
···11-{stdenv, fetchurl, openssl, libsamplerate}:
11+{ stdenv, fetchurl, openssl, libsamplerate, alsaLib }:
2233stdenv.mkDerivation rec {
44- name = "pjsip-2.1";
44+ name = "pjsip-${version}";
55+ version = "2.5.5";
5667 src = fetchurl {
77- url = http://www.pjsip.org/release/2.1/pjproject-2.1.tar.bz2;
88- md5 = "310eb63638dac93095f6a1fc8ee1f578";
88+ url = "http://www.pjsip.org/release/${version}/pjproject-${version}.tar.bz2";
99+ sha256 = "ab39207b761d3485199cd881410afeb2d171dff7c2bf75e8caae91c6dca508f3";
910 };
10111111- buildInputs = [ openssl libsamplerate ];
1212+ buildInputs = [ openssl libsamplerate alsaLib ];
12131314 postInstall = ''
1415 mkdir -p $out/bin
···2122 dontPatchELF = true;
22232324 meta = {
2424- description = "SIP stack and media stack for presence, im, and multimedia communication";
2525+ description = "A multimedia communication library written in C, implementing standard based protocols such as SIP, SDP, RTP, STUN, TURN, and ICE";
2526 homepage = http://pjsip.org/;
2627 license = stdenv.lib.licenses.gpl2Plus;
2728 maintainers = with stdenv.lib.maintainers; [viric];
+10
pkgs/applications/office/libreoffice/still.nix
···6969 sha256 = "1qg0dj0zwh5ifhmvv4k771nmyqddz4ifn75s9mr1p0nyix8zks8x";
7070 };
71717272+ # we only have this problem on i686 ATM
7373+ patches = if stdenv.is64bit then null else [
7474+ (fetchurl {
7575+ name = "disable-flaky-tests.diff";
7676+ url = "https://anonscm.debian.org/git/pkg-openoffice/libreoffice.git/plain"
7777+ + "/patches/disable-flaky-tests.diff?h=libreoffice_5.1.5_rc2-1";
7878+ sha256 = "1v1aiqdi64iijjraj6v4ljzclrd9lqan54hmy2h6m20x3ab005wb";
7979+ })
8080+ ];
8181+7282 # Openoffice will open libcups dynamically, so we link it directly
7383 # to make its dlopen work.
7484 # It also seems not to mention libdl explicitly in some places.
···1111 sha256 = "06g691px0abndp5zvz2ba1g675rcqb64n055h5ahgnlck5cdpawg";
1212 };
13131414+ dontStrip = true; # Stripping breaks some of the binaries
1515+1416 installPhase = ''
1517 mkdir -p $out/share/raspberrypi/boot
1618 cp -R boot/* $out/share/raspberrypi/boot
+4-2
pkgs/os-specific/linux/kernel/common-config.nix
···346346 LOGO n # not needed
347347 MEDIA_ATTACH y
348348 MEGARAID_NEWGEN y
349349- ${optionalString (versionAtLeast version "3.15") ''
349349+ ${optionalString (versionAtLeast version "3.15" && versionOlder version "4.8") ''
350350 MLX4_EN_VXLAN y
351351 ''}
352352 MODVERSIONS y
···433433 PARAVIRT? y
434434 HYPERVISOR_GUEST y
435435 PARAVIRT_SPINLOCKS? y
436436- KVM_APIC_ARCHITECTURE y
436436+ ${optionalString (versionOlder version "4.8") ''
437437+ KVM_APIC_ARCHITECTURE y
438438+ ''}
437439 KVM_ASYNC_PF y
438440 ${optionalString (versionAtLeast version "4.0") ''
439441 KVM_COMPAT? y
···11-{ stdenv, fetchurl, buildPythonApplication, makeWrapper, ffmpeg, zip
22-, pandoc ? null
11+{ stdenv, fetchurl, buildPythonApplication, makeWrapper, zip, ffmpeg, pandoc
22+, atomicparsley
33+# Pandoc is required to build the package's man page. Release tarballs contain a
44+# formatted man page already, though, it will still be installed. We keep the
55+# manpage argument in place in case someone wants to use this derivation to
66+# build a Git version of the tool that doesn't have the formatted man page
77+# included.
88+, generateManPage ? false
99+, ffmpegSupport ? true
310}:
41155-# Pandoc is required to build the package's man page. Release tarballs
66-# contain a formatted man page already, though, so it's fine to pass
77-# "pandoc = null" to this derivation; the man page will still be
88-# installed. We keep the pandoc argument and build input in place in
99-# case someone wants to use this derivation to build a Git version of
1010-# the tool that doesn't have the formatted man page included.
1212+with stdenv.lib;
11131214buildPythonApplication rec {
1315···1921 sha256 = "017x2hqc2bacypjmn9ac9f91y9y6afydl0z7dich5l627494hvfg";
2022 };
21232222- buildInputs = [ makeWrapper zip pandoc ];
2424+ buildInputs = [ makeWrapper zip ] ++ optional generateManPage pandoc;
23252426 # Ensure ffmpeg is available in $PATH for post-processing & transcoding support.
2525- postInstall = stdenv.lib.optionalString (ffmpeg != null)
2626- ''wrapProgram $out/bin/youtube-dl --prefix PATH : "${ffmpeg.bin}/bin"'';
2727+ # atomicparsley for embedding thumbnails
2828+ postInstall = let
2929+ packagesthatwillbeusedbelow = [ atomicparsley ] ++ optional ffmpegSupport ffmpeg;
3030+ in ''
3131+ wrapProgram $out/bin/youtube-dl --prefix PATH : "${makeBinPath packagesthatwillbeusedbelow}"
3232+ '';
27332834 # Requires network
2935 doCheck = false;
30363131- meta = with stdenv.lib; {
3737+ meta = {
3238 homepage = http://rg3.github.io/youtube-dl/;
3339 repositories.git = https://github.com/rg3/youtube-dl.git;
3440 description = "Command-line tool to download videos from YouTube.com and other sites";