···33## User Guide
4455Several versions of Python are available on Nix as well as a high amount of
66-packages. The default interpreter is CPython 3.5.
66+packages. The default interpreter is CPython 2.7.
7788### Using Python
99···131131132132The output of the function is a derivation, which is an attribute with the name
133133`toolz` of the set `pythonPackages`. Actually, sets are created for all interpreter versions,
134134-so `python27Packages`, `python34Packages`, `python35Packages` and `pypyPackages`.
134134+so e.g. `python27Packages`, `python35Packages` and `pypyPackages`.
135135136136The above example works when you're directly working on
137137`pkgs/top-level/python-packages.nix` in the Nixpkgs repository. Often though,
···422422423423### Interpreters
424424425425-Versions 2.6, 2.7, 3.3, 3.4 and 3.5 of the CPython interpreter are available as respectively
426426-`python26`, `python27`, `python33`, `python34` and `python35`. The PyPy interpreter
425425+Versions 2.7, 3.3, 3.4, 3.5 and 3.6 of the CPython interpreter are available as
426426+respectively `python27`, `python33`, `python34`, `python35` and `python36`. The PyPy interpreter
427427is available as `pypy`. The aliases `python2` and `python3` correspond to respectively `python27` and
428428`python35`. The default interpreter, `python`, maps to `python2`.
429429The Nix expressions for the interpreters can be found in
···472472* `pkgs.python33Packages`
473473* `pkgs.python34Packages`
474474* `pkgs.python35Packages`
475475+* `pkgs.python36Packages`
475476* `pkgs.pypyPackages`
476477477478and the aliases
···674675those using Python in a `nix-shell`.
675676676677When the environment variable `DETERMINISTIC_BUILD` is set, all bytecode will have timestamp 1.
677677-The `buildPythonPackage` function sets `DETERMINISTIC_BUILD` as well as
678678-[PYTHONHASHSEED](https://docs.python.org/3.5/using/cmdline.html#envvar-PYTHONHASHSEED).
678678+The `buildPythonPackage` function sets `DETERMINISTIC_BUILD=1` and
679679+[PYTHONHASHSEED=0](https://docs.python.org/3.5/using/cmdline.html#envvar-PYTHONHASHSEED).
679680Both are also exported in `nix-shell`.
680681681682
···1111<command>dd if=<replaceable>path-to-image</replaceable>
1212of=<replaceable>/dev/sdb</replaceable></command>. Be careful about specifying the
1313correct drive; you can use the <command>lsblk</command> command to get a list of
1414-block devices.</para>
1414+block devices. If you're on OS X you can run <command>diskutil list</command>
1515+to see the list of devices; the device you'll use for the USB must be ejected
1616+before writing the image.</para>
15171618<para>The <command>dd</command> utility will write the image verbatim to the drive,
1719making it the recommended option for both UEFI and non-UEFI installations. For
+7-9
nixos/doc/manual/release-notes/rl-1703.xml
···97979898 <listitem>
9999 <para>
100100- The Yama LSM is now enabled by default in the kernel,
101101- which prevents ptracing non-child processes.
102102- This means you will not be able to attach gdb to an existing process,
103103- but will need to start that process from gdb (so it is a child).
104104- </para>
105105- </listitem>
106106-107107- <listitem>
108108- <para>
109100 The <literal>stripHash</literal> bash function in <literal>stdenv</literal>
110101 changed according to its documentation; it now outputs the stripped name to
111102 <literal>stdout</literal> instead of putting it in the variable
···246237 <literal>services.rmilter.bindSocket.*</literal>. The default is still
247238 a unix socket in <literal>/run/rmilter/rmilter.sock</literal>. Refer to
248239 the options documentation for more information.
240240+ </para>
241241+ </listitem>
242242+243243+ <listitem>
244244+ <para>
245245+ The <literal>fetch*</literal> functions no longer support md5,
246246+ please use sha256 instead.
249247 </para>
250248 </listitem>
251249
+4
nixos/modules/config/sysctl.nix
···6464 # Removed under grsecurity.
6565 boot.kernel.sysctl."kernel.kptr_restrict" =
6666 if (config.boot.kernelPackages.kernel.features.grsecurity or false) then null else 1;
6767+6868+ # Disable YAMA by default to allow easy debugging.
6969+ boot.kernel.sysctl."kernel.yama.ptrace_scope" = mkDefault 0;
7070+6771 };
6872}
···177177 # programs to be wrapped.
178178 WRAPPER_PATH=${config.system.path}/bin:${config.system.path}/sbin
179179180180- # Remove the old /var/setuid-wrappers path from the system...
181181- #
182182- # TODO: this is only necessary for ugprades 16.09 => 17.x;
183183- # this conditional removal block needs to be removed after
184184- # the release.
185185- if [ -d /var/setuid-wrappers ]; then
186186- rm -rf /var/setuid-wrappers
187187- fi
188188-189189- # Remove the old /run/setuid-wrappers-dir path from the
190190- # system as well...
191191- #
192192- # TODO: this is only necessary for ugprades 16.09 => 17.x;
193193- # this conditional removal block needs to be removed after
194194- # the release.
195195- if [ -d /run/setuid-wrapper-dirs ]; then
196196- rm -rf /run/setuid-wrapper-dirs
197197- fi
198198-199180 # We want to place the tmpdirs for the wrappers to the parent dir.
200181 wrapperDir=$(mktemp --directory --tmpdir="${parentWrapperDir}" wrappers.XXXXXXXXXX)
201182 chmod a+rx $wrapperDir
+4-2
nixos/modules/services/hardware/udev.nix
···3535 udevRules = pkgs.runCommand "udev-rules"
3636 { preferLocalBuild = true;
3737 allowSubstitutes = false;
3838+ packages = unique (map toString cfg.packages);
3839 }
3940 ''
4041 mkdir -p $out
···4546 echo 'ENV{PATH}="${udevPath}/bin:${udevPath}/sbin"' > $out/00-path.rules
46474748 # Add the udev rules from other packages.
4848- for i in ${toString cfg.packages}; do
4949+ for i in $packages; do
4950 echo "Adding rules for package $i"
5051 for j in $i/{etc,lib}/udev/rules.d/*; do
5152 echo "Copying $j to $out/$(basename $j)"
···132133 hwdbBin = pkgs.runCommand "hwdb.bin"
133134 { preferLocalBuild = true;
134135 allowSubstitutes = false;
136136+ packages = unique (map toString ([udev] ++ cfg.packages));
135137 }
136138 ''
137139 mkdir -p etc/udev/hwdb.d
138138- for i in ${toString ([udev] ++ cfg.packages)}; do
140140+ for i in $packages; do
139141 echo "Adding hwdb files for package $i"
140142 for j in $i/{etc,lib}/udev/hwdb.d/*; do
141143 ln -s $j etc/udev/hwdb.d/$(basename $j)
···140140 };
141141142142 privoxy.enable = mkOption {
143143+ type = types.bool;
143144 default = true;
144145 description = ''
145146 Whether to enable and configure the system Privoxy to use Tor's
···443443my $tmpFile = $confFile . ".tmp";
444444writeFile($tmpFile, $conf);
445445446446+447447+# check whether to install GRUB EFI or not
448448+sub getEfiTarget {
449449+ if ($grubVersion == 1) {
450450+ return "no"
451451+ } elsif (($grub ne "") && ($grubEfi ne "")) {
452452+ # EFI can only be installed when target is set;
453453+ # A target is also required then for non-EFI grub
454454+ if (($grubTarget eq "") || ($grubTargetEfi eq "")) { die }
455455+ else { return "both" }
456456+ } elsif (($grub ne "") && ($grubEfi eq "")) {
457457+ # TODO: It would be safer to disallow non-EFI grub installation if no taget is given.
458458+ # If no target is given, then grub auto-detects the target which can lead to errors.
459459+ # E.g. it seems as if grub would auto-detect a EFI target based on the availability
460460+ # of a EFI partition.
461461+ # However, it seems as auto-detection is currently relied on for non-x86_64 and non-i386
462462+ # architectures in NixOS. That would have to be fixed in the nixos modules first.
463463+ return "no"
464464+ } elsif (($grub eq "") && ($grubEfi ne "")) {
465465+ # EFI can only be installed when target is set;
466466+ if ($grubTargetEfi eq "") { die }
467467+ else {return "only" }
468468+ } else {
469469+ # prevent an installation if neither grub nor grubEfi is given
470470+ return "neither"
471471+ }
472472+}
473473+474474+my $efiTarget = getEfiTarget();
475475+446476# Append entries detected by os-prober
447477if (get("useOSProber") eq "true") {
448448- system(get("shell"), "-c", "pkgdatadir=$grub/share/grub $grub/etc/grub.d/30_os-prober >> $tmpFile");
478478+ my $targetpackage = ($efiTarget eq "no") ? $grub : $grubEfi;
479479+ system(get("shell"), "-c", "pkgdatadir=$targetpackage/share/grub $targetpackage/etc/grub.d/30_os-prober >> $tmpFile");
449480}
450481451482# Atomically switch to the new config
···498529 }
499530 return @devices;
500531}
501501-502502-# check whether to install GRUB EFI or not
503503-sub getEfiTarget {
504504- if ($grubVersion == 1) {
505505- return "no"
506506- } elsif (($grub ne "") && ($grubEfi ne "")) {
507507- # EFI can only be installed when target is set;
508508- # A target is also required then for non-EFI grub
509509- if (($grubTarget eq "") || ($grubTargetEfi eq "")) { die }
510510- else { return "both" }
511511- } elsif (($grub ne "") && ($grubEfi eq "")) {
512512- # TODO: It would be safer to disallow non-EFI grub installation if no taget is given.
513513- # If no target is given, then grub auto-detects the target which can lead to errors.
514514- # E.g. it seems as if grub would auto-detect a EFI target based on the availability
515515- # of a EFI partition.
516516- # However, it seems as auto-detection is currently relied on for non-x86_64 and non-i386
517517- # architectures in NixOS. That would have to be fixed in the nixos modules first.
518518- return "no"
519519- } elsif (($grub eq "") && ($grubEfi ne "")) {
520520- # EFI can only be installed when target is set;
521521- if ($grubTargetEfi eq "") { die }
522522- else {return "only" }
523523- } else {
524524- # prevent an installation if neither grub nor grubEfi is given
525525- return "neither"
526526- }
527527-}
528528-529532my @deviceTargets = getDeviceTargets();
530530-my $efiTarget = getEfiTarget();
531533my $prevGrubState = readGrubState();
532534my @prevDeviceTargets = split/,/, $prevGrubState->devices;
533535
···11-WGET_ARGS=( http://download.kde.org/stable/plasma/5.9.3/ -A '*.tar.xz' )
11+WGET_ARGS=( http://download.kde.org/stable/plasma/5.9.4/ -A '*.tar.xz' )
···7676 ++ optional langAda ../gnat-cflags.patch
7777 ++ optional langFortran ../gfortran-driving.patch
78787979- # This could be applied unconditionally but I don't want to cause a full Linux rebuild.
7979+ # This could be applied unconditionally but I don't want to cause a full
8080+ # Linux rebuild.
8081 ++ optional stdenv.cc.isClang ./libcxx38-and-above.patch;
81828283 javaEcj = fetchurl {
···233234 NIX_NO_SELF_RPATH = true;
234235235236 libc_dev = stdenv.cc.libc_dev;
237237+238238+ # This should kill all the stdinc frameworks that gcc and friends like to
239239+ # insert into default search paths.
240240+ prePatch = if stdenv.isDarwin then ''
241241+ substituteInPlace gcc/config/darwin-c.c \
242242+ --replace 'if (stdinc)' 'if (0)'
243243+ '' else null;
236244237245 postPatch =
238246 if (stdenv.isGNU
···11{ stdenv, fetchurl, xlibsWrapper, libpng, libjpeg, libtiff, zlib, bzip2, libXcursor, libXrandr, libXft
22, CoreServices ? null }:
3344-let
55- version = "1.7.9";
66-in
77-84stdenv.mkDerivation rec {
95 name = "fox-${version}";
66+ version = "1.7.9";
107118 src = fetchurl {
129 url = "ftp://ftp.fox-toolkit.org/pub/${name}.tar.gz";
1310 sha256 = "1jb9368xsin3ppdf6979n5s7in3s9klbxqbwcp0z8misjixl7nzg";
1411 };
1212+1313+ patches = [ ./clang.patch ];
15141615 buildInputs = [ libpng xlibsWrapper libjpeg libtiff zlib bzip2 libXcursor libXrandr libXft ]
1717- ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices ];
1616+ ++ stdenv.lib.optional stdenv.isDarwin CoreServices;
18171918 doCheck = true;
2019···22212322 hardeningDisable = [ "format" ];
24232525- meta = {
2424+ meta = with stdenv.lib; {
2625 description = "C++ based class library for building Graphical User Interfaces";
2726 longDescription = ''
2828- FOX stands for Free Objects for X.
2929- It is a C++ based class library for building Graphical User Interfaces.
3030- Initially, it was developed for LINUX, but the scope of this project has in the course of time become somewhat more ambitious.
3131- Current aims are to make FOX completely platform independent, and thus programs written against the FOX library will be only a compile away from running on a variety of platforms.
3232- '';
2727+ FOX stands for Free Objects for X.
2828+ It is a C++ based class library for building Graphical User Interfaces.
2929+ Initially, it was developed for LINUX, but the scope of this project has in the course of time become somewhat more ambitious.
3030+ Current aims are to make FOX completely platform independent, and thus programs written against the FOX library will be only a compile away from running on a variety of platforms.
3131+ '';
3332 homepage = "http://fox-toolkit.org";
3434- license = stdenv.lib.licenses.lgpl3;
3535- maintainers = [ stdenv.lib.maintainers.bbenoist ];
3636- platforms = stdenv.lib.platforms.all;
3333+ license = licenses.lgpl3;
3434+ maintainers = [];
3535+ platforms = platforms.all;
3736 };
3837}
···11-WGET_ARGS=( http://download.kde.org/stable/frameworks/5.31/ -A '*.tar.xz' )
11+WGET_ARGS=( http://download.kde.org/stable/frameworks/5.32/ -A '*.tar.xz' )
···11+{ stdenv, lib, buildGoPackage, fetchFromGitLab }:
22+buildGoPackage rec {
33+ name = "loccount-${version}";
44+ version = "1.0";
55+66+ goPackagePath = "gitlab.com/esr/loccount";
77+ excludedPackages = "tests";
88+99+ src = fetchFromGitLab {
1010+ owner = "esr";
1111+ repo = "loccount";
1212+ rev = version;
1313+ sha256 = "081wf7fckn76m4x0jwq4h2fsbhpb6f67dha77ni3p6wg7q6sihqx";
1414+ };
1515+1616+ meta = with stdenv.lib; {
1717+ description = "Re-implementation of sloccount in Go";
1818+ longDescription = ''
1919+ loccount is a re-implementation of David A. Wheeler's sloccount tool
2020+ in Go. It is faster and handles more different languages. Because
2121+ it's one source file in Go, it is easier to maintain and extend than the
2222+ multi-file, multi-language implementation of the original.
2323+2424+ The algorithms are largely unchanged and can be expected to produce
2525+ identical numbers for languages supported by both tools. Python is
2626+ an exception; loccount corrects buggy counting of single-quote multiline
2727+ literals in sloccount 2.26.
2828+ '';
2929+ homepage="https://gitlab.com/esr/loccount";
3030+ downloadPage="https://gitlab.com/esr/loccount/tree/master";
3131+ license = licenses.bsd2;
3232+ maintainers = with maintainers; [ calvertvl ];
3333+ platforms = platforms.linux;
3434+ };
3535+}
···1313 --replace "#include <msgtracer_client.h>" ''$'#include <asl.h>\nstatic void msgtracer_log_with_keys(...) { };'
14141515 substituteInPlace Definitions.h \
1616- --replace "#include <System/pthread_machdep.h>" ""
1616+ --replace "#include <System/pthread_machdep.h>" "" \
1717+ --replace 'void * const, void * const' 'void * const, void *'
17181819 # getspecific_direct is more efficient, but this should be equivalent...
1920 substituteInPlace Zone.h \
+12-3
pkgs/os-specific/linux/kernel/common-config.nix
···3333 DEBUG_KERNEL y
3434 DYNAMIC_DEBUG y
3535 BACKTRACE_SELF_TEST n
3636- CPU_NOTIFIER_ERROR_INJECT? n
3736 DEBUG_DEVRES n
3837 DEBUG_STACK_USAGE n
3938 DEBUG_STACKOVERFLOW n
4039 RCU_TORTURE_TEST n
4140 SCHEDSTATS n
4241 DETECT_HUNG_TASK y
4242+4343+ ${optionalString (versionOlder version "4.10") ''
4444+ CPU_NOTIFIER_ERROR_INJECT? n
4545+ ''}
43464447 ${optionalString (versionOlder version "4.11") ''
4548 TIMER_STATS y
···308311 NLS_ISO8859_1 m # VFAT default for the iocharset= mount option
309312310313 # Runtime security tests
311311- DEBUG_SET_MODULE_RONX? y # Detect writes to read-only module pages
314314+ ${optionalString (versionOlder version "4.11") ''
315315+ DEBUG_SET_MODULE_RONX? y # Detect writes to read-only module pages
316316+ ''}
312317313318 # Security related features.
314319 RANDOMIZE_BASE? y
···456461 FTRACE_SYSCALLS y
457462 SCHED_TRACER y
458463 STACK_TRACER y
459459- UPROBE_EVENT? y
464464+465465+ ${optionalString (versionOlder version "4.11") ''
466466+ UPROBE_EVENT? y
467467+ ''}
468468+460469 ${optionalString (versionAtLeast version "4.4") ''
461470 BPF_SYSCALL y
462471 BPF_EVENTS y