summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/darwin/cf-private/default.nix16
-rw-r--r--pkgs/os-specific/darwin/goku/default.nix27
-rw-r--r--pkgs/os-specific/linux/alsa-tools/default.nix4
-rw-r--r--pkgs/os-specific/linux/alsa-utils/default.nix4
-rw-r--r--pkgs/os-specific/linux/dropwatch/default.nix35
-rw-r--r--pkgs/os-specific/linux/firejail/default.nix8
-rw-r--r--pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix8
-rw-r--r--pkgs/os-specific/linux/hwdata/default.nix8
-rw-r--r--pkgs/os-specific/linux/kbd/default.nix13
-rw-r--r--pkgs/os-specific/linux/kernel-headers/default.nix58
-rw-r--r--pkgs/os-specific/linux/kernel-headers/no-dynamic-cc-version-check.patch32
-rw-r--r--pkgs/os-specific/linux/kernel-headers/no-relocs.patch13
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.14.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.18.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.19.nix18
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.4.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.9.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-hardkernel-4.14.nix6
-rw-r--r--pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix6
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix2
-rw-r--r--pkgs/os-specific/linux/libcgroup/default.nix9
-rw-r--r--pkgs/os-specific/linux/mdadm/default.nix5
-rw-r--r--pkgs/os-specific/linux/nfs-utils/default.nix3
-rw-r--r--pkgs/os-specific/linux/numactl/default.nix5
-rwxr-xr-xpkgs/os-specific/linux/nvidia-x11/builder.sh60
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/default.nix18
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/generic.nix25
-rw-r--r--pkgs/os-specific/linux/open-isns/default.nix4
-rw-r--r--pkgs/os-specific/linux/pmtools/default.nix23
-rw-r--r--pkgs/os-specific/linux/r8168/default.nix56
-rw-r--r--pkgs/os-specific/linux/rdma-core/default.nix4
-rw-r--r--pkgs/os-specific/linux/sysstat/default.nix4
-rw-r--r--pkgs/os-specific/linux/systemd/default.nix7
-rw-r--r--pkgs/os-specific/linux/upower/default.nix6
-rw-r--r--pkgs/os-specific/linux/usbutils/default.nix2
-rw-r--r--pkgs/os-specific/linux/zfs/default.nix4
36 files changed, 386 insertions, 123 deletions
diff --git a/pkgs/os-specific/darwin/cf-private/default.nix b/pkgs/os-specific/darwin/cf-private/default.nix
index 3fac20d23c78..dc1b0112a219 100644
--- a/pkgs/os-specific/darwin/cf-private/default.nix
+++ b/pkgs/os-specific/darwin/cf-private/default.nix
@@ -1,4 +1,4 @@
-{ CF, apple_sdk }:
+{ CF, apple_sdk, osx_private_sdk }:
 
 # cf-private is a bit weird, but boils down to CF with a weird setup-hook that
 # makes a build link against the system CoreFoundation rather than our pure one.
@@ -13,10 +13,10 @@
 # because of their magic "toll-free bridging" support, the symbols for those types
 # live in CoreFoundation with an ObjC runtime. And because that isn't public, we have
 # this hack in place to let people link properly anyway. Phew!
-# 
+#
 # This can be revisited if Apple ever decide to release the ObjC backend in a publicly
 # buildable form.
-# 
+#
 # This doesn't really need to rebuild CF, but it's cheap, and adding a setup hook to
 # an existing package was annoying. We need a buildEnv that knows how to add those
 CF.overrideAttrs (orig: {
@@ -38,22 +38,24 @@ CF.overrideAttrs (orig: {
   # this is watchman, who can almost certainly switch to the pure CF once the header
   # and functionality is merged in.
   installPhase = orig.installPhase + ''
+    # Copy or overwrite private headers, some of these might already
+    # exist in CF but the private versions have more information.
     basepath="Library/Frameworks/CoreFoundation.framework/Headers"
-    path="$basepath/CFFileDescriptor.h"
+    cp -Lfv --no-preserve mode ${osx_private_sdk}/include/CoreFoundationPrivateHeaders/* "$out/$basepath"
 
     # Append the include at top level or nobody will notice the header we're about to add
     sed -i '/CFNotificationCenter.h/a #include <CoreFoundation/CFFileDescriptor.h>' \
       "$out/$basepath/CoreFoundation.h"
 
-    cp ${apple_sdk.frameworks.CoreFoundation}/$path $out/$path
+    cp ${apple_sdk.frameworks.CoreFoundation}/$basepath/CFFileDescriptor.h $out/$basepath/CFFileDescriptor.h
   '' +
   # This one is less likely to go away, but I'll mention it anyway. The issue is at
   # https://bugs.swift.org/browse/SR-8744, and the main user I know of is qtbase
   ''
-    path="$basepath/CFURLEnumerator.h"    
+    path="$basepath/CFURLEnumerator.h"
     sed -i '/CFNotificationCenter.h/a #include <CoreFoundation/CFURLEnumerator.h>' \
       "$out/$basepath/CoreFoundation.h"
 
     cp ${apple_sdk.frameworks.CoreFoundation}/$path $out/$path
   '';
-})
\ No newline at end of file
+})
diff --git a/pkgs/os-specific/darwin/goku/default.nix b/pkgs/os-specific/darwin/goku/default.nix
new file mode 100644
index 000000000000..190c0ae22131
--- /dev/null
+++ b/pkgs/os-specific/darwin/goku/default.nix
@@ -0,0 +1,27 @@
+{stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "goku-${version}";
+  version = "0.1.11";
+
+  src = fetchurl {
+    url = "https://github.com/yqrashawn/GokuRakuJoudo/releases/download/v${version}/goku.tar.gz";
+    sha256 = "49562342be114c2656726c5c697131acd286965ab3903a1a1e157cc689e20b15";
+  };
+
+  sourceRoot = ".";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp goku $out/bin
+    cp gokuw $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Karabiner configurator";
+    homepage = https://github.com/yqrashawn/GokuRakuJoudo;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.nikitavoloboev ];
+    platforms = platforms.darwin;
+  };
+}
diff --git a/pkgs/os-specific/linux/alsa-tools/default.nix b/pkgs/os-specific/linux/alsa-tools/default.nix
index 8faba250fb3e..14b10e6752bb 100644
--- a/pkgs/os-specific/linux/alsa-tools/default.nix
+++ b/pkgs/os-specific/linux/alsa-tools/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "alsa-tools-${version}";
-  version = "1.1.6";
+  version = "1.1.7";
 
   src = fetchurl {
     url = "mirror://alsa/tools/${name}.tar.bz2";
-    sha256 = "09rjb6hw1mn9y1jfdfj5djncgc2cr5wfps83k56rf6k4zg14v76n";
+    sha256 = "1xjfghr9s0j6n91kgs95cc4r6qrjsgc4yj2w0nir3xpnm0l36950";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/os-specific/linux/alsa-utils/default.nix b/pkgs/os-specific/linux/alsa-utils/default.nix
index 60e3b9750d71..c9cf12912670 100644
--- a/pkgs/os-specific/linux/alsa-utils/default.nix
+++ b/pkgs/os-specific/linux/alsa-utils/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "alsa-utils-${version}";
-  version = "1.1.6";
+  version = "1.1.7";
 
   src = fetchurl {
     url = "mirror://alsa/utils/${name}.tar.bz2";
-    sha256 = "0vnkyymgwj9rfdb11nvab30dnfrylmakdfildxl0y8mj836awp0m";
+    sha256 = "02jlw6a22j2rr7inggfgk2hzx3w0fjhvhs0dn1afpzdp9aspzchx";
   };
 
   patchPhase = ''
diff --git a/pkgs/os-specific/linux/dropwatch/default.nix b/pkgs/os-specific/linux/dropwatch/default.nix
new file mode 100644
index 000000000000..936dbf719a87
--- /dev/null
+++ b/pkgs/os-specific/linux/dropwatch/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
+, libnl, readline, libbfd, ncurses, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "dropwatch";
+  version = "1.5";
+  name = "${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "nhorman";
+    repo = pname;
+    rev = version;
+    sha256 = "085hyyl28v0vpxfnmzchl97fjfnzj46ynhkg6y4i6h194y0d99m7";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+
+  buildInputs = [ libbfd libnl ncurses readline zlib ];
+
+  # To avoid running into https://sourceware.org/bugzilla/show_bug.cgi?id=14243 we need to define:
+  NIX_CFLAGS_COMPILE = [
+    "-DPACKAGE=${pname}"
+    "-DPACKAGE_VERSION=${version}"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Kernel dropped packet monitor";
+    homepage = https://github.com/nhorman/dropwatch;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.c0bw3b ];
+  };
+}
diff --git a/pkgs/os-specific/linux/firejail/default.nix b/pkgs/os-specific/linux/firejail/default.nix
index 568e474f444a..553b3804a038 100644
--- a/pkgs/os-specific/linux/firejail/default.nix
+++ b/pkgs/os-specific/linux/firejail/default.nix
@@ -37,6 +37,14 @@ stdenv.mkDerivation {
     sed -e "s@/etc/@$out/etc/@g" -e "/chmod u+s/d" -i Makefile
   '';
 
+  # We need to set the directory for the .local override files back to
+  # /etc/firejail so we can actually override them
+  postInstall = ''
+    sed -E -e 's@^include (.*)(/firejail/.*.local)$@include /etc\2@g' -i $out/etc/firejail/*.profile
+  '';
+
+  enableParallelBuilding = true;
+
   meta = {
     inherit (s) version;
     description = ''Namespace-based sandboxing tool for Linux'';
diff --git a/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix b/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix
index 82978d3e3ca9..43747aeaf0d0 100644
--- a/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix
+++ b/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   name = "firmware-linux-nonfree-${version}";
-  version = "2018-08-25";
+  version = "2018-10-17";
 
   src = fetchgit {
     url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git";
-    rev = "fea76a04f25fd0a217c0d566ff5ff8f23ad3e648";
-    sha256 = "1xy1s9vd7jny4hf4f1hzhlbnm0l4pnw7xycky0v6kfwlg5nnjii5";
+    rev = "de9cefa74bba6fce3834144460868a468b8818f2";
+    sha256 = "101j4jk3ixl8r3mxbkcrr5ybhb44ij3l52js4dqfxpylpiaw2cgk";
   };
 
   installFlags = [ "DESTDIR=$(out)" ];
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   outputHashMode = "recursive";
   outputHashAlgo = "sha256";
-  outputHash = "1p1dkzclj718w7di81s6486dn5zw77c4i2qn63bvp9q4vid452hn";
+  outputHash = "1ndwp9yhpmx0kzayddy9i93mpv3d8gxypqm85069ic13lrjz1gdf";
 
   meta = with stdenv.lib; {
     description = "Binary firmware collection packaged by kernel.org";
diff --git a/pkgs/os-specific/linux/hwdata/default.nix b/pkgs/os-specific/linux/hwdata/default.nix
index 5943ced2f8f9..dfca87e27165 100644
--- a/pkgs/os-specific/linux/hwdata/default.nix
+++ b/pkgs/os-specific/linux/hwdata/default.nix
@@ -2,24 +2,24 @@
 
 stdenv.mkDerivation rec {
   name = "hwdata-${version}";
-  version = "0.314";
+  version = "0.316";
 
   src = fetchFromGitHub {
     owner = "vcrhonek";
     repo = "hwdata";
     rev = "v${version}";
-    sha256 = "12k466ndg152fqld1w5v1zfdyv000yypazcwy75ywlxvlknv4y90";
+    sha256 = "0k3fypykbq9943cnxlmmpk0xp9nhhf46pfdhkgm99iaa27b8s1gb";
   };
 
   preConfigure = "patchShebangs ./configure";
 
-  configureFlags = [ "--datadir=$(prefix)/data" ];
+  configureFlags = [ "--datadir=${placeholder "out"}/share" ];
 
   doCheck = false; # this does build machine-specific checks (e.g. enumerates PCI bus)
 
   outputHashMode = "recursive";
   outputHashAlgo = "sha256";
-  outputHash = "1w00y5kj8rd8slzydw1gw8cablxlkham4vq786kdd8zga286zabb";
+  outputHash = "0g2w4jr4p1hykracp2za7jb0rcr51kks1m43pzcaf7g99x8669ww";
 
   meta = {
     homepage = https://github.com/vcrhonek/hwdata;
diff --git a/pkgs/os-specific/linux/kbd/default.nix b/pkgs/os-specific/linux/kbd/default.nix
index bfade509fcac..a37e65f8cb50 100644
--- a/pkgs/os-specific/linux/kbd/default.nix
+++ b/pkgs/os-specific/linux/kbd/default.nix
@@ -25,6 +25,19 @@ stdenv.mkDerivation rec {
       # Add Neo keymap subdirectory
       sed -i -e 's,^KEYMAPSUBDIRS *= *,&i386/neo ,' data/Makefile.am
 
+      # Renaming keymaps with name clashes, because loadkeys just picks
+      # the first keymap it sees. The clashing names lead to e.g.
+      # "loadkeys no" defaulting to a norwegian dvorak map instead of
+      # the much more common qwerty one.
+      pushd data/keymaps/i386
+      mv qwertz/cz{,-qwertz}.map
+      mv olpc/es{,-olpc}.map
+      mv olpc/pt{,-olpc}.map
+      mv dvorak/{no.map,dvorak-no.map}
+      mv fgGIod/trf{,-fgGIod}.map
+      mv colemak/{en-latin9,colemak}.map
+      popd
+
       # Fix the path to gzip/bzip2.
       substituteInPlace src/libkeymap/findfile.c \
         --replace gzip ${gzip}/bin/gzip \
diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix
index 23dcbb05f30a..011668f0c679 100644
--- a/pkgs/os-specific/linux/kernel-headers/default.nix
+++ b/pkgs/os-specific/linux/kernel-headers/default.nix
@@ -1,9 +1,10 @@
 { stdenvNoCC, lib, buildPackages
-, fetchurl, perl
+, fetchurl, fetchpatch, perl
+, elf-header
 }:
 
 let
-  common = { version, sha256, patches ? [] }: stdenvNoCC.mkDerivation {
+  common = { version, sha256, patches ? [] }: stdenvNoCC.mkDerivation ({
     name = "linux-headers-${version}";
 
     src = fetchurl {
@@ -16,18 +17,55 @@ let
     # It may look odd that we use `stdenvNoCC`, and yet explicit depend on a cc.
     # We do this so we have a build->build, not build->host, C compiler.
     depsBuildBuild = [ buildPackages.stdenv.cc ];
-    nativeBuildInputs = [ perl ];
+    # TODO make unconditional next mass rebuild
+    nativeBuildInputs = [ perl ] ++ lib.optional
+      (stdenvNoCC.hostPlatform != stdenvNoCC.buildPlatform)
+      elf-header;
 
     extraIncludeDirs = lib.optional stdenvNoCC.hostPlatform.isPowerPC ["ppc"];
 
+    # "patches" array defaults to 'null' to avoid changing hash
+    # and causing mass rebuild
     inherit patches;
 
-    buildPhase = ''
+    # TODO avoid native hack next rebuild
+    makeFlags = if stdenvNoCC.hostPlatform == stdenvNoCC.buildPlatform then null else [
+      "SHELL=bash"
+      # Avoid use of runtime build->host compilers for checks. These
+      # checks only cared to work around bugs in very old compilers, so
+      # these changes should be safe.
+      "cc-version:=9999"
+      "cc-fullversion:=999999"
+      # `$(..)` expanded by make alone
+      "HOSTCC:=$(BUILD_CC)"
+      "HOSTCXX:=$(BUILD_CXX)"
+    ];
+
+    # TODO avoid native hack next rebuild
+    # Skip clean on darwin, case-sensitivity issues.
+    buildPhase = if stdenvNoCC.hostPlatform == stdenvNoCC.buildPlatform then ''
       make mrproper headers_check SHELL=bash
+    '' else lib.optionalString (!stdenvNoCC.buildPlatform.isDarwin) ''
+      make mrproper $makeFlags
+    ''
+    # For some reason, doing `make install_headers` twice, first without
+    # INSTALL_HDR_PATH=$out then with, is neccessary to get this to work
+    # for darwin cross. @Ericson2314 has no idea why.
+    + ''
+      make headers_install $makeFlags
+    '';
+
+    # TODO avoid native hack next rebuild
+    checkPhase = if stdenvNoCC.hostPlatform == stdenvNoCC.buildPlatform then null else ''
+      make headers_check $makeFlags
     '';
 
-    installPhase = ''
+    # TODO avoid native hack next rebuild
+    installPhase = (if stdenvNoCC.hostPlatform == stdenvNoCC.buildPlatform then ''
       make INSTALL_HDR_PATH=$out headers_install
+    '' else ''
+      make headers_install INSTALL_HDR_PATH=$out $makeFlags
+    '') + ''
 
       # Some builds (e.g. KVM) want a kernel.release.
       mkdir -p $out/include/config
@@ -39,11 +77,19 @@ let
       license = licenses.gpl2;
       platforms = platforms.linux;
     };
-  };
+  } // lib.optionalAttrs (stdenvNoCC.hostPlatform != stdenvNoCC.buildPlatform) {
+    # TODO Make unconditional next mass rebuild
+    hardeningDisable = lib.optional stdenvNoCC.buildPlatform.isDarwin "format";
+  });
 in {
 
   linuxHeaders = common {
     version = "4.18.3";
     sha256 = "1m23hjd02bg8mqnd8dc4z4m3kxds1cyrc6j5saiwnhzbz373rvc1";
+    # TODO make unconditional next mass rebuild
+    patches = lib.optionals (stdenvNoCC.hostPlatform != stdenvNoCC.buildPlatform) [
+       ./no-relocs.patch # for building x86 kernel headers on non-ELF platforms
+       ./no-dynamic-cc-version-check.patch # so we can use `stdenvNoCC`, see `makeFlags` above
+    ];
   };
 }
diff --git a/pkgs/os-specific/linux/kernel-headers/no-dynamic-cc-version-check.patch b/pkgs/os-specific/linux/kernel-headers/no-dynamic-cc-version-check.patch
new file mode 100644
index 000000000000..9b582cac7153
--- /dev/null
+++ b/pkgs/os-specific/linux/kernel-headers/no-dynamic-cc-version-check.patch
@@ -0,0 +1,32 @@
+diff --git a/Makefile b/Makefile
+index 863f58503bee..b778d5023208 100644
+--- a/Makefile
++++ b/Makefile
+@@ -501,11 +501,9 @@ KBUILD_CFLAGS      += $(call cc-option,-fno-PIE)
+ KBUILD_AFLAGS  += $(call cc-option,-fno-PIE)
+ 
+ # check for 'asm goto'
+-ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
+   CC_HAVE_ASM_GOTO := 1
+   KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO
+   KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO
+-endif
+ 
+ # The expansion should be delayed until arch/$(SRCARCH)/Makefile is included.
+ # Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile.
+diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
+index 065324a8046f..d09c67194549 100644
+--- a/scripts/Kbuild.include
++++ b/scripts/Kbuild.include
+@@ -216,11 +216,8 @@ cc-disable-warning = $(call try-run-cached,\
+ cc-name = $(call shell-cached,$(CC) -v 2>&1 | grep -q "clang version" && echo clang || echo gcc)
+ 
+ # cc-version
+-cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
+ 
+ # cc-fullversion
+-cc-fullversion = $(shell $(CONFIG_SHELL) \
+-	$(srctree)/scripts/gcc-version.sh -p $(CC))
+ 
+ # cc-ifversion
+ # Usage:  EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
diff --git a/pkgs/os-specific/linux/kernel-headers/no-relocs.patch b/pkgs/os-specific/linux/kernel-headers/no-relocs.patch
new file mode 100644
index 000000000000..67e8b19e23bd
--- /dev/null
+++ b/pkgs/os-specific/linux/kernel-headers/no-relocs.patch
@@ -0,0 +1,13 @@
+diff --git a/arch/x86/Makefile b/arch/x86/Makefile
+index fad55160dcb9..a48c8331cbb2 100644
+--- a/arch/x86/Makefile
++++ b/arch/x86/Makefile
+@@ -239,7 +239,7 @@ ifdef CONFIG_RETPOLINE
+ endif
+ 
+ archscripts: scripts_basic
+-	$(Q)$(MAKE) $(build)=arch/x86/tools relocs
++	$(Q)$(MAKE) $(build)=arch/x86/tools
+ 
+ ###
+ # Syscall table generation
diff --git a/pkgs/os-specific/linux/kernel/linux-4.14.nix b/pkgs/os-specific/linux/kernel/linux-4.14.nix
index 60b3ffb2d8dc..f4a728c9d25f 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.14.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.14.nix
@@ -3,7 +3,7 @@
 with stdenv.lib;
 
 buildLinux (args // rec {
-  version = "4.14.76";
+  version = "4.14.78";
 
   # modDirVersion needs to be x.y.z, will automatically add .0 if needed
   modDirVersion = if (modDirVersionArg == null) then concatStrings (intersperse "." (take 3 (splitString "." "${version}.0"))) else modDirVersionArg;
@@ -13,6 +13,6 @@ buildLinux (args // rec {
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "1gl2wkq4sazvpr0xnn4vrajj3j7w6hfiwdiy34y7jhlazyj1jgzf";
+    sha256 = "0v2cwykgd2hxlqja4yl4pq45nhd5x8917ixqq7hj1r3ry304vnpl";
   };
 } // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-4.18.nix b/pkgs/os-specific/linux/kernel/linux-4.18.nix
index 9bf33c068b55..d6c4b58b980a 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.18.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.18.nix
@@ -3,7 +3,7 @@
 with stdenv.lib;
 
 buildLinux (args // rec {
-  version = "4.18.14";
+  version = "4.18.16";
 
   # modDirVersion needs to be x.y.z, will automatically add .0 if needed
   modDirVersion = if (modDirVersionArg == null) then concatStrings (intersperse "." (take 3 (splitString "." "${version}.0"))) else modDirVersionArg;
@@ -13,6 +13,6 @@ buildLinux (args // rec {
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "1lv2hpxzlk1yzr5dcjb0q0ylvlwx4ln2jvfvf01b9smr1lvd3iin";
+    sha256 = "1rjjkhl8lz4y4sn7icy8mp6p1x7rvapybp51p92sanbjy3i19fmy";
   };
 } // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-4.19.nix b/pkgs/os-specific/linux/kernel/linux-4.19.nix
new file mode 100644
index 000000000000..5aa033348d4e
--- /dev/null
+++ b/pkgs/os-specific/linux/kernel/linux-4.19.nix
@@ -0,0 +1,18 @@
+{ stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
+
+with stdenv.lib;
+
+buildLinux (args // rec {
+  version = "4.19";
+
+  # modDirVersion needs to be x.y.z, will automatically add .0 if needed
+  modDirVersion = if (modDirVersionArg == null) then concatStrings (intersperse "." (take 3 (splitString "." "${version}.0"))) else modDirVersionArg;
+
+  # branchVersion needs to be x.y
+  extraMeta.branch = concatStrings (intersperse "." (take 2 (splitString "." version)));
+
+  src = fetchurl {
+    url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
+    sha256 = "18a92z17alh5kkvjv7l9z8wk5jgdb6raawdfkpwx9bi8amjzas0c";
+  };
+} // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-4.4.nix b/pkgs/os-specific/linux/kernel/linux-4.4.nix
index 641e368f74e6..f4ef5c6eb1cf 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.4.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.4.nix
@@ -1,11 +1,11 @@
 { stdenv, buildPackages, fetchurl, perl, buildLinux, ... } @ args:
 
 buildLinux (args // rec {
-  version = "4.4.161";
+  version = "4.4.162";
   extraMeta.branch = "4.4";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "11rz66qvbcb6y3fz9k04jzn547sqdahqknd43imsr9sjgkaq60xy";
+    sha256 = "0l2agmxzmq89jbh7r00qg4msvmhny40m2jar96fibwpklwd44kki";
   };
 } // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-4.9.nix b/pkgs/os-specific/linux/kernel/linux-4.9.nix
index cdf7000fba89..89702c44ccbc 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.9.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.9.nix
@@ -1,11 +1,11 @@
 { stdenv, buildPackages, fetchurl, perl, buildLinux, ... } @ args:
 
 buildLinux (args // rec {
-  version = "4.9.133";
+  version = "4.9.135";
   extraMeta.branch = "4.9";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "0qv5n8vipkqcd0hpf5l41h023n46rgja39h895phlcxs4p00ywsk";
+    sha256 = "1kjly5ynsg2jy5nj41z21s8f18wfs4nk843jlmmcazzax6xv08z0";
   };
 } // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-hardkernel-4.14.nix b/pkgs/os-specific/linux/kernel/linux-hardkernel-4.14.nix
index fc9cb2f238b2..8ad96f4f1bfb 100644
--- a/pkgs/os-specific/linux/kernel/linux-hardkernel-4.14.nix
+++ b/pkgs/os-specific/linux/kernel/linux-hardkernel-4.14.nix
@@ -1,10 +1,10 @@
 { stdenv, buildPackages, fetchFromGitHub, perl, buildLinux, libelf, utillinux, ... } @ args:
 
 buildLinux (args // rec {
-  version = "4.14.73-149";
+  version = "4.14.78-150";
 
   # modDirVersion needs to be x.y.z.
-  modDirVersion = "4.14.73";
+  modDirVersion = "4.14.78";
 
   # branchVersion needs to be x.y.
   extraMeta.branch = "4.14";
@@ -13,7 +13,7 @@ buildLinux (args // rec {
     owner = "hardkernel";
     repo = "linux";
     rev = version;
-    sha256 = "1zc5py6v3xyvy6dwghnqb7nsn9l1aib3d96i5bqy9dd56vyiy5m2";
+    sha256 = "0139qciaf1vlz41s9idjbcx20c1svrp1l7qaazfkwfx52ghb4pvv";
   };
 
   defconfig = "odroidxu4_defconfig";
diff --git a/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix b/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix
index f58ab5c95cc4..b4df3b7b33e8 100644
--- a/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix
+++ b/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix
@@ -1,13 +1,13 @@
 { stdenv, buildPackages, fetchgit, perl, buildLinux, ... } @ args:
 
 buildLinux (args // rec {
-  version = "4.18.2018.09.21";
+  version = "4.18.2018.10.12";
   modDirVersion = "4.18.0";
 
   src = fetchgit {
     url = "https://evilpiepirate.org/git/bcachefs.git";
-    rev = "2fe17e38d355271a8212a8123a9281e2f9df811f";
-    sha256 = "1p35qf7fdwpr8sz4alblmbq6rmhd87rwrrwk6xpgxsfkkhmf36d6";
+    rev = "d7f6da1d60ec24266301231538ff6f09716537ed";
+    sha256 = "05d7dh41nc35www8vmrn47wlf2mr2b8i4rm15vq3zgm32d0xv3lk";
   };
 
   extraConfig = "BCACHEFS_FS m";
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index 5e6023582082..1d280647c5a1 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -1,4 +1,5 @@
 { buildPackages, runCommand, nettools, bc, bison, flex, perl, rsync, gmp, libmpc, mpfr, openssl
+, pkgconfig ? null, ncurses ? null
 , libelf
 , utillinux
 , writeTextFile
@@ -265,6 +266,7 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.platform kernelPatches
       ++ optional (stdenv.lib.versionAtLeast version "4.14") libelf
       ++ optional (stdenv.lib.versionAtLeast version "4.15") utillinux
       ++ optionals (stdenv.lib.versionAtLeast version "4.16") [ bison flex ]
+      ++ optionals stdenv.lib.inNixShell [ pkgconfig ncurses ]
       ;
 
   hardeningDisable = [ "bindnow" "format" "fortify" "stackprotector" "pic" ];
diff --git a/pkgs/os-specific/linux/libcgroup/default.nix b/pkgs/os-specific/linux/libcgroup/default.nix
index a70ab13db623..1e920247a754 100644
--- a/pkgs/os-specific/linux/libcgroup/default.nix
+++ b/pkgs/os-specific/linux/libcgroup/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pam, yacc, flex }:
+{ stdenv, fetchurl, fetchpatch, pam, yacc, flex }:
 
 stdenv.mkDerivation rec {
   name    = "libcgroup-${version}";
@@ -11,6 +11,13 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ pam yacc flex ];
 
+  patches = [
+    (fetchpatch {
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-libs/libcgroup/files/libcgroup-0.41-remove-umask.patch?id=33e9f4c81de754bbf76b893ea1133ed023f2a0e5";
+      sha256 = "1x0x29ld0cgmfwq4qy13s6d5c8sym1frfh1j2q47d8gfw6qaxka5";
+    })
+  ];
+
   postPatch = ''
     substituteInPlace src/tools/Makefile.in \
       --replace 'chmod u+s' 'chmod +x'
diff --git a/pkgs/os-specific/linux/mdadm/default.nix b/pkgs/os-specific/linux/mdadm/default.nix
index 52a5f16bc52c..c6c5f8436902 100644
--- a/pkgs/os-specific/linux/mdadm/default.nix
+++ b/pkgs/os-specific/linux/mdadm/default.nix
@@ -14,11 +14,11 @@ let
   '';
 in
 stdenv.mkDerivation rec {
-  name = "mdadm-4.0";
+  name = "mdadm-4.1";
 
   src = fetchurl {
     url = "mirror://kernel/linux/utils/raid/mdadm/${name}.tar.xz";
-    sha256 = "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx";
+    sha256 = "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb";
   };
 
   # This is to avoid self-references, which causes the initrd to explode
@@ -47,6 +47,7 @@ stdenv.mkDerivation rec {
     description = "Programs for managing RAID arrays under Linux";
     homepage = http://neil.brown.name/blog/mdadm;
     license = licenses.gpl2;
+    maintainers = with maintainers; [ ekleog ];
     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/nfs-utils/default.nix b/pkgs/os-specific/linux/nfs-utils/default.nix
index 7235d8415f55..19a5184f8962 100644
--- a/pkgs/os-specific/linux/nfs-utils/default.nix
+++ b/pkgs/os-specific/linux/nfs-utils/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, fetchpatch, lib, pkgconfig, utillinux, libcap, libtirpc, libevent
 , sqlite, kerberos, kmod, libuuid, keyutils, lvm2, systemd, coreutils, tcp_wrappers
-, buildEnv
+, buildEnv, python3
 }:
 
 let
@@ -25,6 +25,7 @@ stdenv.mkDerivation rec {
   buildInputs = [
     libtirpc libcap libevent sqlite lvm2
     libuuid keyutils kerberos tcp_wrappers
+    python3
   ];
 
   enableParallelBuilding = true;
diff --git a/pkgs/os-specific/linux/numactl/default.nix b/pkgs/os-specific/linux/numactl/default.nix
index bf21f92bd66d..3c02cf2bb889 100644
--- a/pkgs/os-specific/linux/numactl/default.nix
+++ b/pkgs/os-specific/linux/numactl/default.nix
@@ -13,11 +13,6 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ];
 
-  patches = stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
-      url = https://git.alpinelinux.org/cgit/aports/plain/testing/numactl/musl.patch?id=0592b128c71c3e70d493bc7a13caed0d7fae91dd;
-      sha256 = "080b0sygmg7104qbbh1amh3b322yyiajwi2d3d0vayffgva0720v";
-    });
-
   postPatch = ''
     patchShebangs test
   '';
diff --git a/pkgs/os-specific/linux/nvidia-x11/builder.sh b/pkgs/os-specific/linux/nvidia-x11/builder.sh
index 15c3e10e1199..8882ffdd45e7 100755
--- a/pkgs/os-specific/linux/nvidia-x11/builder.sh
+++ b/pkgs/os-specific/linux/nvidia-x11/builder.sh
@@ -26,32 +26,44 @@ buildPhase() {
     fi
 }
 
-    
+
 installPhase() {
     # Install libGL and friends.
+
+    # since version 391, 32bit libraries are bundled in the 32/ sub-directory
+    if [ "$i686bundled" = "1" ]; then
+        mkdir -p "$lib32/lib"
+        cp -prd 32/*.so.* 32/tls "$lib32/lib/"
+    fi
+
     mkdir -p "$out/lib"
     cp -prd *.so.* tls "$out/lib/"
-    rm $out/lib/lib{glx,nvidia-wfb}.so.* # handled separately
-    rm -f $out/lib/libnvidia-gtk* # built from source
-    if [ "$useGLVND" = "1" ]; then
-        # Pre-built libglvnd
-        rm $out/lib/lib{GL,GLX,EGL,GLESv1_CM,GLESv2,OpenGL,GLdispatch}.so.*
-    fi
-    # Use ocl-icd instead
-    rm $out/lib/libOpenCL.so*
-    # Move VDPAU libraries to their place
-    mkdir $out/lib/vdpau
-    mv $out/lib/libvdpau* $out/lib/vdpau
-
-    # Install ICDs.
-    install -Dm644 nvidia.icd $out/etc/OpenCL/vendors/nvidia.icd
-    if [ -e nvidia_icd.json.template ]; then
-        sed "s#__NV_VK_ICD__#libGLX_nvidia.so#" nvidia_icd.json.template > nvidia_icd.json
-        install -Dm644 nvidia_icd.json $out/share/vulkan/icd.d/nvidia.json
-    fi
-    if [ "$useGLVND" = "1" ]; then
-        install -Dm644 10_nvidia.json $out/share/glvnd/egl_vendor.d/nvidia.json
-    fi
+
+    for i in $lib32 $out; do
+        rm -f $i/lib/lib{glx,nvidia-wfb}.so.* # handled separately
+        rm -f $i/lib/libnvidia-gtk* # built from source
+        if [ "$useGLVND" = "1" ]; then
+            # Pre-built libglvnd
+            rm $i/lib/lib{GL,GLX,EGL,GLESv1_CM,GLESv2,OpenGL,GLdispatch}.so.*
+        fi
+        # Use ocl-icd instead
+        rm -f $i/lib/libOpenCL.so*
+        # Move VDPAU libraries to their place
+        mkdir $i/lib/vdpau
+        mv $i/lib/libvdpau* $i/lib/vdpau
+
+        # Install ICDs.
+        install -Dm644 nvidia.icd $i/etc/OpenCL/vendors/nvidia.icd
+        if [ -e nvidia_icd.json.template ]; then
+            sed "s#__NV_VK_ICD__#libGLX_nvidia.so#" nvidia_icd.json.template > nvidia_icd.json
+            install -Dm644 nvidia_icd.json $i/share/vulkan/icd.d/nvidia.json
+        fi
+        if [ "$useGLVND" = "1" ]; then
+            install -Dm644 10_nvidia.json $i/share/glvnd/egl_vendor.d/nvidia.json
+        fi
+
+    done
+
 
     if [ -n "$bin" ]; then
         # Install the X drivers.
@@ -60,7 +72,7 @@ installPhase() {
         mkdir -p $bin/lib/xorg/modules/drivers
         cp -p nvidia_drv.so $bin/lib/xorg/modules/drivers
         mkdir -p $bin/lib/xorg/modules/extensions
-        cp -p libglx.so.* $bin/lib/xorg/modules/extensions
+        cp -p libglx*.so* $bin/lib/xorg/modules/extensions
 
         # Install the kernel module.
         mkdir -p $bin/lib/modules/$kernelVersion/misc
@@ -78,7 +90,7 @@ installPhase() {
     fi
 
     # All libs except GUI-only are installed now, so fixup them.
-    for libname in `find "$out/lib/" -name '*.so.*'` `test -z "$bin" || find "$bin/lib/" -name '*.so.*'`
+    for libname in $(find "$out/lib/" $(test -n "$lib32" && echo "$lib32/lib/") $(test -n "$bin" && echo "$bin/lib/") -name '*.so.*')
     do
       # I'm lazy to differentiate needed libs per-library, as the closure is the same.
       # Unfortunately --shrink-rpath would strip too much.
diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix
index d9ff157e1429..44598588db9d 100644
--- a/pkgs/os-specific/linux/nvidia-x11/default.nix
+++ b/pkgs/os-specific/linux/nvidia-x11/default.nix
@@ -1,4 +1,4 @@
-{ lib, callPackage, fetchurl }:
+{ lib, callPackage, fetchurl, stdenv }:
 
 let
   generic = args: callPackage (import ./generic.nix args) { };
@@ -16,7 +16,17 @@ let
 in
 rec {
   # Policy: use the highest stable version as the default (on our master).
-  stable = generic {
+  stable = if stdenv.hostPlatform.system == "x86_64-linux" then stable_410 else stable_390;
+
+  stable_410 = generic {
+    version = "410.66";
+    sha256_64bit = "05xjzvj0fgmkpz36dbd7hy2vzl6xxiflzx7kml3k7ad9gy2svdlg";
+    settingsSha256 = "1nsxz1byshgjs3c03lyx6ya36dp0f2vg2l0d9pkh1i6cpzkp53kz";
+    persistencedSha256 = "0m4wdpb8w4y323d8py105p9hizwmf2ai8frkl7h77sn3ski17zw6";
+  };
+
+  # Last one supporting x86
+  stable_390 = generic {
     version = "390.87";
     sha256_32bit = "0rlr1f4lnpb8c4qz4w5r8xw5gdy9bzz26qww45qyl1qav3wwaaaw";
     sha256_64bit = "07k1kq8lkgbvjyr2dnbxcz6nppcwpq17wf925w8kfq78345hla9q";
@@ -26,8 +36,8 @@ rec {
     patches = lib.optional (kernel.meta.branch == "4.19") ./drm_mode_connector.patch;
   };
 
-  beta = stable; # not enough interest to maintain beta ATM
-
+  # No active beta right now
+  beta = stable;
 
   legacy_340 = generic {
     version = "340.104";
diff --git a/pkgs/os-specific/linux/nvidia-x11/generic.nix b/pkgs/os-specific/linux/nvidia-x11/generic.nix
index 090fce3a485c..a40a64344932 100644
--- a/pkgs/os-specific/linux/nvidia-x11/generic.nix
+++ b/pkgs/os-specific/linux/nvidia-x11/generic.nix
@@ -1,5 +1,5 @@
 { version
-, sha256_32bit
+, sha256_32bit ? null
 , sha256_64bit
 , settingsSha256
 , persistencedSha256
@@ -22,11 +22,15 @@
 
 with stdenv.lib;
 
-assert (!libsOnly) -> kernel != null;
+assert !libsOnly -> kernel != null;
+assert versionOlder version "391" -> sha256_32bit != null;
+assert ! versionOlder version "391" -> stdenv.hostPlatform.system == "x86_64-linux";
 
 let
   nameSuffix = optionalString (!libsOnly) "-${kernel.version}";
   pkgSuffix = optionalString (versionOlder version "304") "-pkg0";
+  i686bundled = versionAtLeast version "391";
+
 
   self = stdenv.mkDerivation {
     name = "nvidia-x11-${version}${nameSuffix}";
@@ -34,24 +38,27 @@ let
     builder = ./builder.sh;
 
     src =
-      if stdenv.hostPlatform.system == "i686-linux" then
-        fetchurl {
-          url = "https://download.nvidia.com/XFree86/Linux-x86/${version}/NVIDIA-Linux-x86-${version}${pkgSuffix}.run";
-          sha256 = sha256_32bit;
-        }
-      else if stdenv.hostPlatform.system == "x86_64-linux" then
+      if stdenv.hostPlatform.system == "x86_64-linux" then
         fetchurl {
           url = "https://download.nvidia.com/XFree86/Linux-x86_64/${version}/NVIDIA-Linux-x86_64-${version}${pkgSuffix}.run";
           sha256 = sha256_64bit;
         }
+      else if stdenv.hostPlatform.system == "i686-linux" then
+        fetchurl {
+          url = "https://download.nvidia.com/XFree86/Linux-x86/${version}/NVIDIA-Linux-x86-${version}${pkgSuffix}.run";
+          sha256 = sha256_32bit;
+        }
       else throw "nvidia-x11 does not support platform ${stdenv.hostPlatform.system}";
 
     patches = if libsOnly then null else patches;
     inherit prePatch;
     inherit version useGLVND useProfiles;
     inherit (stdenv.hostPlatform) system;
+    inherit i686bundled;
 
-    outputs = [ "out" ] ++ optional (!libsOnly) "bin";
+    outputs = [ "out" ]
+        ++ optional i686bundled "lib32"
+        ++ optional (!libsOnly) "bin";
     outputDev = if libsOnly then null else "bin";
 
     kernel = if libsOnly then null else kernel.dev;
diff --git a/pkgs/os-specific/linux/open-isns/default.nix b/pkgs/os-specific/linux/open-isns/default.nix
index c8b404c6be7f..21d32af3ba83 100644
--- a/pkgs/os-specific/linux/open-isns/default.nix
+++ b/pkgs/os-specific/linux/open-isns/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "open-isns-${version}";
-  version = "0.98";
+  version = "0.99";
 
   src = fetchFromGitHub {
     owner = "gonzoleeman";
     repo = "open-isns";
     rev = "v${version}";
-    sha256 = "055gjwz5hxaj5jk23bf7dy9wbxk9m8cfgl1msbzjc60gr2mmcbdg";
+    sha256 = "0m294aiv80rkihacw5094093pc0kd5bkbxqgs6i32jsglxy33hvf";
   };
 
   propagatedBuildInputs = [ openssl ];
diff --git a/pkgs/os-specific/linux/pmtools/default.nix b/pkgs/os-specific/linux/pmtools/default.nix
deleted file mode 100644
index a284924f0058..000000000000
--- a/pkgs/os-specific/linux/pmtools/default.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ stdenv, fetchurl }:
-
-stdenv.mkDerivation rec {
-  name = "pmtools-20071116";
-
-  src = fetchurl {
-    url = "http://www.lesswatts.org/patches/linux_acpi/${name}.tar.gz";
-    sha256 = "91751774976e39f6237efd0326eb35196a9346220b92ad35894a33283e872748";
-  };
-
-  installPhase = ''
-    mkdir -p $out/bin $out/share/pmtools
-    cp acpidump/acpidump acpixtract/acpixtract madt/madt $out/bin/
-    cp README $out/share/pmtools/
-  '';
-
-  meta = {
-    homepage = http://www.lesswatts.org/projects/acpi/utilities.php;
-    description = "Linux ACPI utilities";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/os-specific/linux/r8168/default.nix b/pkgs/os-specific/linux/r8168/default.nix
new file mode 100644
index 000000000000..f2c87b97c4ff
--- /dev/null
+++ b/pkgs/os-specific/linux/r8168/default.nix
@@ -0,0 +1,56 @@
+{ stdenv, lib, fetchFromGitHub, kernel }:
+
+
+let modDestDir = "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/net/wireless/realtek/r8168";
+
+in stdenv.mkDerivation rec {
+  name = "r8168-${kernel.version}-${version}";
+  # on update please verify that the source matches the realtek version
+  version = "8.046.00";
+
+  # This is a mirror. The original website[1] doesn't allow non-interactive
+  # downloads, instead emailing you a download link.
+  # [1] http://www.realtek.com.tw/downloads/downloadsView.aspx?PFid=5&Level=5&Conn=4&DownTypeID=3
+  # I've verified manually (`diff -r`) that the source code for version 8.046.00
+  # is the same as the one available on the realtek website.
+  src = fetchFromGitHub {
+    owner = "mtorromeo";
+    repo = "r8168";
+    rev = version;
+    sha256 = "0y8w3biw5mshn5bvl24b9rybfh67f1s9gfzkcv9p4m7s7nchj2dg";
+  };
+
+  hardeningDisable = [ "pic" ];
+
+  nativeBuildInputs = kernel.moduleBuildDependencies;
+
+  # avoid using the Makefile directly -- it doesn't understand
+  # any kernel but the current.
+  # based on the ArchLinux pkgbuild: https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/r8168
+  preBuild = ''
+    makeFlagsArray+=("-C${kernel.dev}/lib/modules/${kernel.modDirVersion}/build")
+    makeFlagsArray+=("SUBDIRS=$PWD/src")
+    makeFlagsArray+=("EXTRA_CFLAGS=-DCONFIG_R8168_NAPI -DCONFIG_R8168_VLAN")
+    makeFlagsArray+=("modules")
+  '';
+
+  enableParallelBuilding = true;
+
+  installPhase = ''
+    mkdir -p ${modDestDir}
+    find . -name '*.ko' -exec cp --parents '{}' ${modDestDir} \;
+    find ${modDestDir} -name '*.ko' -exec xz -f '{}' \;
+  '';
+
+  meta = with lib; {
+    description = "Realtek r8168 driver";
+    longDescription = ''
+      A kernel module for Realtek 8168 network cards.
+      If you want to use this driver, you might need to blacklist the r8169 driver
+      by adding "r8169" to boot.blacklistedKernelModules.
+    '';
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ timokau ];
+  };
+}
diff --git a/pkgs/os-specific/linux/rdma-core/default.nix b/pkgs/os-specific/linux/rdma-core/default.nix
index b66cb78a702b..ecfd8581ca9d 100644
--- a/pkgs/os-specific/linux/rdma-core/default.nix
+++ b/pkgs/os-specific/linux/rdma-core/default.nix
@@ -3,7 +3,7 @@
 } :
 
 let
-  version = "20";
+  version = "20.1";
 
 in stdenv.mkDerivation {
   name = "rdma-core-${version}";
@@ -12,7 +12,7 @@ in stdenv.mkDerivation {
     owner = "linux-rdma";
     repo = "rdma-core";
     rev = "v${version}";
-    sha256 = "1zz9r1zq9ql806sbyi7nrslx1d96hgd9zvdlzbv4j31m6kfmsyri";
+    sha256 = "1j6d3n4wzl04m0k4nxbmahfwc094185d5jyijgvg3z5hwwb8lkwv";
   };
 
   nativeBuildInputs = [ cmake pkgconfig pandoc ];
diff --git a/pkgs/os-specific/linux/sysstat/default.nix b/pkgs/os-specific/linux/sysstat/default.nix
index 5f3eb22f127e..d3a9d7834cdc 100644
--- a/pkgs/os-specific/linux/sysstat/default.nix
+++ b/pkgs/os-specific/linux/sysstat/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, gettext, bzip2 }:
 
 stdenv.mkDerivation rec {
-  name = "sysstat-12.0.1";
+  name = "sysstat-12.1.1";
 
   src = fetchurl {
     url = "http://perso.orange.fr/sebastien.godard/${name}.tar.xz";
-    sha256 = "114wh7iqi82c0az8wn3dg3y56279fb2wg81v8kvx87mq5975bg51";
+    sha256 = "0drrlv2fr64g5zf0a2bkla2rql4nmq4n192wvcr9r4zppg58d8k4";
   };
 
   buildInputs = [ gettext ];
diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix
index db64b8e6f6de..2a17a0a2875f 100644
--- a/pkgs/os-specific/linux/systemd/default.nix
+++ b/pkgs/os-specific/linux/systemd/default.nix
@@ -18,7 +18,7 @@ let
   pythonLxmlEnv = buildPackages.python3Packages.python.withPackages ( ps: with ps; [ python3Packages.lxml ]);
 
 in stdenv.mkDerivation rec {
-  version = "239";
+  version = "239.20181031";
   name = "systemd-${version}";
 
   # When updating, use https://github.com/systemd/systemd-stable tree, not the development one!
@@ -26,8 +26,8 @@ in stdenv.mkDerivation rec {
   src = fetchFromGitHub {
     owner = "NixOS";
     repo = "systemd";
-    rev = "31859ddd35fc3fa82a583744caa836d356c31d7f";
-    sha256 = "1xci0491j95vdjgs397n618zii3sgwnvanirkblqqw6bcvcjvir1";
+    rev = "nixos-v${version}";
+    sha256 = "1rzl0iqrpa4ajvama5k3cb3yc7893c55kzcxkl3cyavpdzsw5505";
   };
 
   outputs = [ "out" "lib" "man" "dev" ];
@@ -91,6 +91,7 @@ in stdenv.mkDerivation rec {
     "-Dsulogin-path=${utillinux}/bin/sulogin"
     "-Dmount-path=${utillinux}/bin/mount"
     "-Dumount-path=${utillinux}/bin/umount"
+    "-Ddns-over-tls=false"
   ];
 
   preConfigure = ''
diff --git a/pkgs/os-specific/linux/upower/default.nix b/pkgs/os-specific/linux/upower/default.nix
index 629f61bf5b16..6c6e411000ac 100644
--- a/pkgs/os-specific/linux/upower/default.nix
+++ b/pkgs/os-specific/linux/upower/default.nix
@@ -4,11 +4,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "upower-0.99.7";
+  name = "upower-0.99.9";
 
   src = fetchurl {
-    url = "https://upower.freedesktop.org/releases/${name}.tar.xz";
-    sha256 = "00d4830yvg84brdhz4kn60lr3r8rn2y8gdbhmhxm78i5mgvc5g14";
+    url = https://gitlab.freedesktop.org/upower/upower/uploads/2282c7c0e53fb31816b824c9d1f547e8/upower-0.99.9.tar.xz;
+    sha256 = "046ix7j7hmb7ycv8v54668kjsrgjhzwxn299c1d87vdnkd38kfh1";
   };
 
   buildInputs =
diff --git a/pkgs/os-specific/linux/usbutils/default.nix b/pkgs/os-specific/linux/usbutils/default.nix
index 657d6cc24a8d..8d53756d5101 100644
--- a/pkgs/os-specific/linux/usbutils/default.nix
+++ b/pkgs/os-specific/linux/usbutils/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   postInstall =
     ''
       substituteInPlace $out/bin/lsusb.py \
-        --replace /usr/share/usb.ids ${hwdata}/data/hwdata/usb.ids
+        --replace /usr/share/usb.ids ${hwdata}/share/hwdata/usb.ids
     '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix
index cae06dbd0f38..ed83313e5ddf 100644
--- a/pkgs/os-specific/linux/zfs/default.nix
+++ b/pkgs/os-specific/linux/zfs/default.nix
@@ -158,7 +158,7 @@ in {
   # to be adapted
   zfsStable = common {
     # comment/uncomment if breaking kernel versions are known
-    # incompatibleKernelVersion = null;
+    incompatibleKernelVersion = "4.19";
 
     # this package should point to the latest release.
     version = "0.7.11";
@@ -177,7 +177,7 @@ in {
 
   zfsUnstable = common rec {
     # comment/uncomment if breaking kernel versions are known
-    incompatibleKernelVersion = null;
+    incompatibleKernelVersion = "4.19";
 
     # this package should point to a version / git revision compatible with the latest kernel release
     version = "0.8.0-rc1";