about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/languages-frameworks/rust.md35
-rw-r--r--nixos/doc/manual/installation/installing.xml11
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/networking/nixops-dns.nix79
-rw-r--r--pkgs/build-support/rust/build-rust-crate.nix296
-rw-r--r--pkgs/build-support/rust/carnix.nix16
-rw-r--r--pkgs/build-support/rust/default.nix30
-rw-r--r--pkgs/data/misc/hackage/default.nix4
-rw-r--r--pkgs/development/compilers/mono/5.8.nix8
-rw-r--r--pkgs/development/compilers/rust/binaryBuild.nix14
-rw-r--r--pkgs/development/compilers/rust/bootstrap.nix16
-rw-r--r--pkgs/development/compilers/rust/cargo.nix20
-rw-r--r--pkgs/development/compilers/rust/default.nix23
-rw-r--r--pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch6
-rw-r--r--pkgs/development/compilers/rust/rustc.nix19
-rw-r--r--pkgs/games/xjump/darwin.patch21
-rw-r--r--pkgs/games/xjump/default.nix27
-rw-r--r--pkgs/misc/vim-plugins/default.nix10
-rw-r--r--pkgs/top-level/all-packages.nix6
19 files changed, 449 insertions, 193 deletions
diff --git a/doc/languages-frameworks/rust.md b/doc/languages-frameworks/rust.md
index d3a25e9d1358..f0498eac5b19 100644
--- a/doc/languages-frameworks/rust.md
+++ b/doc/languages-frameworks/rust.md
@@ -58,6 +58,8 @@ To install crates with nix there is also an experimental project called
 
 ## Compiling Rust crates using Nix instead of Cargo
 
+### Simple operation
+
 When run, `cargo build` produces a file called `Cargo.lock`,
 containing pinned versions of all dependencies. Nixpkgs contains a
 tool called `carnix` (`nix-env -iA nixos.carnix`), which can be used
@@ -153,6 +155,8 @@ Here, the `libc` crate has no `src` attribute, so `buildRustCrate`
 will fetch it from [crates.io](https://crates.io). A `sha256`
 attribute is still needed for Nix purity.
 
+### Handling external dependencies
+
 Some crates require external libraries. For crates from
 [crates.io](https://crates.io), such libraries can be specified in
 `defaultCrateOverrides` package in nixpkgs itself.
@@ -210,7 +214,10 @@ with import <nixpkgs> {};
 }
 ```
 
-Three more parameters can be overridden:
+### Options and phases configuration
+
+Actually, the overrides introduced in the previous section are more
+general. A number of other parameters can be overridden:
 
 - The version of rustc used to compile the crate:
 
@@ -232,6 +239,30 @@ Three more parameters can be overridden:
   (hello {}).override { verbose = false; };
   ```
 
+- Extra arguments to be passed to `rustc`:
+
+  ```
+  (hello {}).override { extraRustcOpts = "-Z debuginfo=2"; };
+  ```
+
+- Phases, just like in any other derivation, can be specified using
+  the following attributes: `preUnpack`, `postUnpack`, `prePatch`,
+  `patches`, `postPatch`, `preConfigure` (in the case of a Rust crate,
+  this is run before calling the "build" script), `postConfigure`
+  (after the "build" script),`preBuild`, `postBuild`, `preInstall` and
+  `postInstall`. As an example, here is how to create a new module
+  before running the build script:
+
+  ```
+  (hello {}).override {
+    preConfigure = ''
+       echo "pub const PATH=\"${hi.out}\";" >> src/path.rs"
+    '';
+  };
+  ```
+
+### Features
+
 One can also supply features switches. For example, if we want to
 compile `diesel_cli` only with the `postgres` feature, and no default
 features, we would write:
@@ -243,7 +274,7 @@ features, we would write:
 }
 ```
 
-
+Where `diesel.nix` is the file generated by Carnix, as explained above.
 
 ## Using the Rust nightlies overlay
 
diff --git a/nixos/doc/manual/installation/installing.xml b/nixos/doc/manual/installation/installing.xml
index d4746f2eb3a8..2a5d1fc3ce8d 100644
--- a/nixos/doc/manual/installation/installing.xml
+++ b/nixos/doc/manual/installation/installing.xml
@@ -275,11 +275,20 @@ Enter new UNIX password: ***
 Retype new UNIX password: ***
 </screen>
 
+    <note>
+      <para>
+        To prevent the password prompt, set <code>users.mutableUsers = false;</code> in
+        <filename>configuration.nix</filename>, which allows unattended installation
+        necessary in automation.
+      </para>
+    </note>
+
     </para>
 
   </listitem>
 
-  <listitem><para>If everything went well:
+  <listitem>
+    <para>If everything went well:
 
 <screen>
 # reboot</screen>
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index a3f820a35a10..795f6fda3053 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -510,6 +510,7 @@
   ./services/networking/ngircd.nix
   ./services/networking/nghttpx/default.nix
   ./services/networking/nix-serve.nix
+  ./services/networking/nixops-dns.nix
   ./services/networking/nntp-proxy.nix
   ./services/networking/nsd.nix
   ./services/networking/ntopng.nix
diff --git a/nixos/modules/services/networking/nixops-dns.nix b/nixos/modules/services/networking/nixops-dns.nix
new file mode 100644
index 000000000000..2bb1263b7fa2
--- /dev/null
+++ b/nixos/modules/services/networking/nixops-dns.nix
@@ -0,0 +1,79 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+let
+  pkg = pkgs.nixops-dns;
+  cfg = config.services.nixops-dns;
+in
+
+{
+  options = {
+    services.nixops-dns = {
+      enable = mkOption {
+        type = types.bool;
+        default = false;
+        description = ''
+          Whether to enable the nixops-dns resolution
+          of NixOps virtual machines via dnsmasq and fake domain name.
+        '';
+      };
+
+      user = mkOption {
+        type = types.str;
+        description = ''
+          The user the nixops-dns daemon should run as.
+          This should be the user, which is also used for nixops and
+          have the .nixops directory in its home.
+        '';
+      };
+
+      domain = mkOption {
+        type = types.str;
+        description = ''
+          Fake domain name to resolve to NixOps virtual machines.
+
+          For example "ops" will resolve "vm.ops".
+        '';
+        example = "ops";
+        default = "ops";
+      };
+
+      dnsmasq = mkOption {
+        type = types.bool;
+        default = true;
+        description = ''
+          Enable dnsmasq forwarding to nixops-dns. This allows to use
+          nixops-dns for `services.nixops-dns.domain` resolution
+          while forwarding the rest of the queries to original resolvers.
+        '';
+      };
+
+    };
+  };
+
+  config = mkIf cfg.enable {
+    systemd.services.nixops-dns = {
+      description = "nixops-dns: DNS server for resolving NixOps machines";
+      wantedBy = [ "multi-user.target" ];
+
+      serviceConfig = {
+        Type = "simple";
+        User = cfg.user;
+        ExecStart="${pkg}/bin/nixops-dns --domain=.${cfg.domain}";
+      };
+    };
+
+    services.dnsmasq = mkIf cfg.dnsmasq {
+      enable = true;
+      resolveLocalQueries = true;
+      servers = [
+        "/${cfg.domain}/127.0.0.1#5300"
+      ];
+      extraConfig = ''
+        bind-interfaces
+        listen-address=127.0.0.1
+      '';
+    };
+
+  };
+}
diff --git a/pkgs/build-support/rust/build-rust-crate.nix b/pkgs/build-support/rust/build-rust-crate.nix
index f1f344ca3c7d..8a9a07fd7a8f 100644
--- a/pkgs/build-support/rust/build-rust-crate.nix
+++ b/pkgs/build-support/rust/build-rust-crate.nix
@@ -6,44 +6,16 @@
 
 { lib, buildPlatform, stdenv, defaultCrateOverrides, fetchCrate, ncurses, rustc  }:
 
-let buildCrate = { crateName, crateVersion, crateAuthors, buildDependencies,
-                   dependencies, completeDeps, completeBuildDeps,
-                   crateFeatures, libName, build, release, libPath,
-                   crateType, metadata, crateBin, finalBins,
-                   verbose, colors }:
-
-      let depsDir = lib.concatStringsSep " " dependencies;
-          completeDepsDir = lib.concatStringsSep " " completeDeps;
-          completeBuildDepsDir = lib.concatStringsSep " " completeBuildDeps;
-          makeDeps = dependencies:
-            (lib.concatMapStringsSep " " (dep:
-              let extern = lib.strings.replaceStrings ["-"] ["_"] dep.libName; in
-              (if dep.crateType == "lib" then
-                 " --extern ${extern}=${dep.out}/lib/lib${extern}-${dep.metadata}.rlib"
-              else
-                 " --extern ${extern}=${dep.out}/lib/lib${extern}-${dep.metadata}${buildPlatform.extensions.sharedLibrary}")
-            ) dependencies);
-          deps = makeDeps dependencies;
-          buildDeps = makeDeps buildDependencies;
-          optLevel = if release then 3 else 0;
-          rustcOpts = (if release then "-C opt-level=3" else "-C debuginfo=2");
-          rustcMeta = "-C metadata=${metadata} -C extra-filename=-${metadata}";
-          version_ = lib.splitString "-" crateVersion;
-          versionPre = if lib.tail version_ == [] then "" else builtins.elemAt version_ 1;
-          version = lib.splitString "." (lib.head version_);
-          authors = lib.concatStringsSep ":" crateAuthors;
-      in ''
-      norm=""
-      bold=""
-      green=""
-      boldgreen=""
-      if [[ "${colors}" -eq "always" ]]; then
-        norm="$(printf '\033[0m')" #returns to "normal"
-        bold="$(printf '\033[0;1m')" #set bold
-        green="$(printf '\033[0;32m')" #set green
-        boldgreen="$(printf '\033[0;1;32m')" #set bold, and set green.
-      fi
-
+let makeDeps = dependencies:
+      (lib.concatMapStringsSep " " (dep:
+        let extern = lib.strings.replaceStrings ["-"] ["_"] dep.libName; in
+        (if dep.crateType == "lib" then
+           " --extern ${extern}=${dep.out}/lib/lib${extern}-${dep.metadata}.rlib"
+         else
+           " --extern ${extern}=${dep.out}/lib/lib${extern}-${dep.metadata}${buildPlatform.extensions.sharedLibrary}")
+      ) dependencies);
+
+    echo_build_heading = colors: ''
       echo_build_heading() {
        start=""
        end=""
@@ -57,7 +29,8 @@ let buildCrate = { crateName, crateVersion, crateAuthors, buildDependencies,
          echo "$start""Building $1 ($2)""$end"
        fi
       }
-
+    '';
+    noisily = colors: verbose: ''
       noisily() {
         start=""
         end=""
@@ -71,18 +44,29 @@ let buildCrate = { crateName, crateVersion, crateAuthors, buildDependencies,
 	''}
 	$@
       }
+    '';
 
+    configureCrate =
+      { crateName, crateVersion, crateAuthors, build, libName, crateFeatures, colors, libPath, release, buildDependencies, completeDeps, completeBuildDeps, verbose, dependencies }:
+      let version_ = lib.splitString "-" crateVersion;
+          versionPre = if lib.tail version_ == [] then "" else builtins.elemAt version_ 1;
+          version = lib.splitString "." (lib.head version_);
+          rustcOpts = (if release then "-C opt-level=3" else "-C debuginfo=2");
+          buildDeps = makeDeps buildDependencies;
+          authors = lib.concatStringsSep ":" crateAuthors;
+          optLevel = if release then 3 else 0;
+          completeDepsDir = lib.concatStringsSep " " completeDeps;
+          completeBuildDepsDir = lib.concatStringsSep " " completeBuildDeps;
+      in ''
+      runHook preConfigure
+      ${echo_build_heading colors}
+      ${noisily colors verbose}
       symlink_dependency() {
-      # $1 is the nix-store path of a dependency
+        # $1 is the nix-store path of a dependency
+        # $2 is the target path
         i=$1
-	dest=target/deps
-	if [ ! -z $2 ]; then
-           if [ "$2" = "--buildDep" ]; then
-             dest=target/buildDeps
-           fi
-	fi
-        ln -s -f $i/lib/*.rlib $dest #*/
-        ln -s -f $i/lib/*.so $i/lib/*.dylib $dest #*/
+        ln -s -f $i/lib/*.rlib $2 #*/
+        ln -s -f $i/lib/*.so $i/lib/*.dylib $2 #*/
         if [ -e "$i/lib/link" ]; then
             cat $i/lib/link >> target/link
             cat $i/lib/link >> target/link.final
@@ -92,48 +76,15 @@ let buildCrate = { crateName, crateVersion, crateAuthors, buildDependencies,
         fi
       }
 
-      build_lib() {
-         lib_src=$1
-         echo_build_heading $lib_src ${libName}
-
-         noisily rustc --crate-name $CRATE_NAME $lib_src --crate-type ${crateType} \
-           ${rustcOpts} ${rustcMeta} ${crateFeatures} --out-dir target/lib \
-           --emit=dep-info,link -L dependency=target/deps ${deps} --cap-lints allow \
-           $BUILD_OUT_DIR $EXTRA_BUILD $EXTRA_FEATURES --color ${colors}
-
-         EXTRA_LIB=" --extern $CRATE_NAME=target/lib/lib$CRATE_NAME-${metadata}.rlib"
-         if [ -e target/deps/lib$CRATE_NAME-${metadata}${buildPlatform.extensions.sharedLibrary} ]; then
-            EXTRA_LIB="$EXTRA_LIB --extern $CRATE_NAME=target/lib/lib$CRATE_NAME-${metadata}${buildPlatform.extensions.sharedLibrary}"
-         fi
-      }
-
-      build_bin() {
-        crate_name=$1
-        crate_name_=$(echo $crate_name | sed -e "s/-/_/g")
-	main_file=""
-	if [[ ! -z $2 ]]; then
-          main_file=$2
-	fi
-	echo_build_heading $@
-	noisily rustc --crate-name $crate_name_ $main_file --crate-type bin ${rustcOpts}\
-          ${crateFeatures} --out-dir target/bin --emit=dep-info,link -L dependency=target/deps \
-          $LINK ${deps}$EXTRA_LIB --cap-lints allow \
-          $BUILD_OUT_DIR $EXTRA_BUILD $EXTRA_FEATURES --color ${colors}
-        if [ "$crate_name_" -ne "$crate_name" ]; then
-          mv target/bin/$crate_name_ target/bin/$crate_name
-        fi
-      }
-
-      runHook preBuild
       mkdir -p target/{deps,lib,build,buildDeps}
       chmod uga+w target -R
       for i in ${completeDepsDir}; do
-        symlink_dependency $i
+        symlink_dependency $i target/deps
       done
       for i in ${completeBuildDepsDir}; do
-         symlink_dependency $i --buildDep
+         symlink_dependency $i target/buildDeps
       done
-      if [ -e target/link ]; then
+      if [[ -e target/link ]]; then
         sort -u target/link > target/link.sorted
         mv target/link.sorted target/link
         sort -u target/link.final > target/link.final.sorted
@@ -145,10 +96,16 @@ let buildCrate = { crateName, crateVersion, crateAuthors, buildDependencies,
       export CARGO_PKG_NAME=${crateName}
       export CARGO_PKG_VERSION=${crateVersion}
       export CARGO_PKG_AUTHORS="${authors}"
+
       export CARGO_CFG_TARGET_ARCH=${buildPlatform.parsed.cpu.name}
       export CARGO_CFG_TARGET_OS=${buildPlatform.parsed.kernel.name}
-
+      export CARGO_CFG_TARGET_FAMILY="unix"
+      export CARGO_CFG_UNIX=1
       export CARGO_CFG_TARGET_ENV="gnu"
+      export CARGO_CFG_TARGET_ENDIAN=${if buildPlatform.parsed.cpu.significantByte.name == "littleEndian" then "little" else "big"}
+      export CARGO_CFG_TARGET_POINTER_WIDTH=${toString buildPlatform.parsed.cpu.bits}
+      export CARGO_CFG_TARGET_VENDOR=${buildPlatform.parsed.vendor.name}
+
       export CARGO_MANIFEST_DIR="."
       export DEBUG="${toString (!release)}"
       export OPT_LEVEL="${toString optLevel}"
@@ -159,7 +116,7 @@ let buildCrate = { crateName, crateVersion, crateAuthors, buildDependencies,
       export CARGO_PKG_VERSION_MAJOR=${builtins.elemAt version 0}
       export CARGO_PKG_VERSION_MINOR=${builtins.elemAt version 1}
       export CARGO_PKG_VERSION_PATCH=${builtins.elemAt version 2}
-      if [ -n "${versionPre}" ]; then
+      if [[ -n "${versionPre}" ]]; then
         export CARGO_PKG_VERSION_PRE="${versionPre}"
       fi
 
@@ -180,8 +137,8 @@ let buildCrate = { crateName, crateVersion, crateAuthors, buildDependencies,
            EXTRA_BUILD_FLAGS="$EXTRA_BUILD_FLAGS $(cat target/link.build)"
          fi
          noisily rustc --crate-name build_script_build $BUILD --crate-type bin ${rustcOpts} \
-          ${crateFeatures} --out-dir target/build/${crateName} --emit=dep-info,link \
-          -L dependency=target/buildDeps ${buildDeps} --cap-lints allow $EXTRA_BUILD_FLAGS --color ${colors}
+           ${crateFeatures} --out-dir target/build/${crateName} --emit=dep-info,link \
+           -L dependency=target/buildDeps ${buildDeps} --cap-lints allow $EXTRA_BUILD_FLAGS --color ${colors}
 
          mkdir -p target/build/${crateName}.out
          export RUST_BACKTRACE=1
@@ -198,33 +155,104 @@ let buildCrate = { crateName, crateVersion, crateAuthors, buildDependencies,
            | sed -e "s/cargo:\([^=]*\)=\(.*\)/export DEP_$(echo $CRATENAME)_\U\1\E=\2/" > target/env
 
          set -e
-         if [ -n "$(ls target/build/${crateName}.out)" ]; then
+         if [[ -n "$(ls target/build/${crateName}.out)" ]]; then
 
-            if [ -e "${libPath}" ] ; then
+            if [[ -e "${libPath}" ]]; then
                cp -r target/build/${crateName}.out/* $(dirname ${libPath}) #*/
             else
                cp -r target/build/${crateName}.out/* src #*/
             fi
          fi
       fi
+      runHook postConfigure
+    '';
+
+    buildCrate = { crateName, crateVersion, crateAuthors,
+                   dependencies, completeDeps, completeBuildDeps,
+                   crateFeatures, libName, build, release, libPath,
+                   crateType, metadata, crateBin, finalBins,
+                   extraRustcOpts,
+                   verbose, colors }:
+
+      let depsDir = lib.concatStringsSep " " dependencies;
+          completeDepsDir = lib.concatStringsSep " " completeDeps;
+          completeBuildDepsDir = lib.concatStringsSep " " completeBuildDeps;
+          deps = makeDeps dependencies;
+          optLevel = if release then 3 else 0;
+          rustcOpts =
+            lib.lists.foldl' (opts: opt: opts + " " + opt)
+              (if release then "-C opt-level=3" else "-C debuginfo=2")
+              extraRustcOpts;
+          rustcMeta = "-C metadata=${metadata} -C extra-filename=-${metadata}";
+          version_ = lib.splitString "-" crateVersion;
+          versionPre = if lib.tail version_ == [] then "" else builtins.elemAt version_ 1;
+          version = lib.splitString "." (lib.head version_);
+          authors = lib.concatStringsSep ":" crateAuthors;
+      in ''
+      runHook preBuild
+      norm=""
+      bold=""
+      green=""
+      boldgreen=""
+      if [[ "${colors}" -eq "always" ]]; then
+        norm="$(printf '\033[0m')" #returns to "normal"
+        bold="$(printf '\033[0;1m')" #set bold
+        green="$(printf '\033[0;32m')" #set green
+        boldgreen="$(printf '\033[0;1;32m')" #set bold, and set green.
+      fi
+      ${echo_build_heading colors}
+      ${noisily colors verbose}
+
+      build_lib() {
+         lib_src=$1
+         echo_build_heading $lib_src ${libName}
+
+         noisily rustc --crate-name $CRATE_NAME $lib_src --crate-type ${crateType} \
+           ${rustcOpts} ${rustcMeta} ${crateFeatures} --out-dir target/lib \
+           --emit=dep-info,link -L dependency=target/deps ${deps} --cap-lints allow \
+           $BUILD_OUT_DIR $EXTRA_BUILD $EXTRA_FEATURES --color ${colors}
+
+         EXTRA_LIB=" --extern $CRATE_NAME=target/lib/lib$CRATE_NAME-${metadata}.rlib"
+         if [ -e target/deps/lib$CRATE_NAME-${metadata}${buildPlatform.extensions.sharedLibrary} ]; then
+            EXTRA_LIB="$EXTRA_LIB --extern $CRATE_NAME=target/lib/lib$CRATE_NAME-${metadata}${buildPlatform.extensions.sharedLibrary}"
+         fi
+      }
+
+      build_bin() {
+        crate_name=$1
+        crate_name_=$(echo $crate_name | sed -e "s/-/_/g")
+	main_file=""
+	if [[ ! -z $2 ]]; then
+          main_file=$2
+	fi
+	echo_build_heading $@
+	noisily rustc --crate-name $crate_name_ $main_file --crate-type bin ${rustcOpts}\
+          ${crateFeatures} --out-dir target/bin --emit=dep-info,link -L dependency=target/deps \
+          $LINK ${deps}$EXTRA_LIB --cap-lints allow \
+          $BUILD_OUT_DIR $EXTRA_BUILD $EXTRA_FEATURES --color ${colors}
+        if [ "$crate_name_" -ne "$crate_name" ]; then
+          mv target/bin/$crate_name_ target/bin/$crate_name
+        fi
+      }
+
 
       EXTRA_LIB=""
       CRATE_NAME=$(echo ${libName} | sed -e "s/-/_/g")
 
-      if [ -e target/link_ ]; then
+      if [[ -e target/link_ ]]; then
         EXTRA_BUILD="$(cat target/link_) $EXTRA_BUILD"
       fi
 
-      if [ -e "${libPath}" ] ; then
+      if [[ -e "${libPath}" ]]; then
          build_lib ${libPath}
-      elif [ -e src/lib.rs ] ; then
+      elif [[ -e src/lib.rs ]]; then
          build_lib src/lib.rs
-      elif [ -e src/${libName}.rs ] ; then
+      elif [[ -e src/${libName}.rs ]]; then
          build_lib src/${libName}.rs
       fi
 
       echo "$EXTRA_LINK_SEARCH" | while read i; do
-         if [ ! -z "$i" ]; then
+         if [[ ! -z "$i" ]]; then
            for lib in $i; do
              echo "-L $lib" >> target/link
              L=$(echo $lib | sed -e "s#$(pwd)/target/build#$out/lib#")
@@ -233,7 +261,7 @@ let buildCrate = { crateName, crateVersion, crateAuthors, buildDependencies,
          fi
       done
       echo "$EXTRA_LINK" | while read i; do
-         if [ ! -z "$i" ]; then
+         if [[ ! -z "$i" ]]; then
            for lib in $i; do
              echo "-l $lib" >> target/link
              echo "-l $lib" >> target/link.final
@@ -241,7 +269,7 @@ let buildCrate = { crateName, crateVersion, crateAuthors, buildDependencies,
          fi
       done
 
-      if [ -e target/link ]; then
+      if [[ -e target/link ]]; then
          sort -u target/link.final > target/link.final.sorted
          mv target/link.final.sorted target/link.final
          sort -u target/link > target/link.sorted
@@ -253,7 +281,7 @@ let buildCrate = { crateName, crateVersion, crateAuthors, buildDependencies,
 
       mkdir -p target/bin
       echo "${crateBin}" | sed -n 1'p' | tr ',' '\n' | while read BIN; do
-         if [ ! -z "$BIN" ]; then
+         if [[ ! -z "$BIN" ]]; then
            build_bin $BIN
          fi
       done
@@ -267,27 +295,32 @@ let buildCrate = { crateName, crateVersion, crateAuthors, buildDependencies,
       ''}
       # Remove object files to avoid "wrong ELF type"
       find target -type f -name "*.o" -print0 | xargs -0 rm -f
+    '' + finalBins + ''
       runHook postBuild
-    '' + finalBins;
+    '';
 
-    installCrate = crateName: ''
+    installCrate = crateName: metadata: ''
+      runHook preInstall
       mkdir -p $out
-      if [ -s target/env ]; then
+      if [[ -s target/env ]]; then
         cp target/env $out/env
       fi
-      if [ -s target/link.final ]; then
+      if [[ -s target/link.final ]]; then
         mkdir -p $out/lib
         cp target/link.final $out/lib/link
       fi
-      if [ "$(ls -A target/lib)" ]; then
+      if [[ "$(ls -A target/lib)" ]]; then
         mkdir -p $out/lib
         cp target/lib/* $out/lib #*/
+        for lib in $out/lib/*.so $out/lib/*.dylib; do #*/
+          ln -s $lib $(echo $lib | sed -e "s/-${metadata}//")
+        done
       fi
-      if [ "$(ls -A target/build)" ]; then # */
+      if [[ "$(ls -A target/build)" ]]; then # */
         mkdir -p $out/lib
         cp -r target/build/* $out/lib # */
       fi
-      if [ "$(ls -A target/bin)" ]; then
+      if [[ "$(ls -A target/bin)" ]]; then
         mkdir -p $out/bin
         cp -P target/bin/* $out/bin # */
       fi
@@ -295,9 +328,16 @@ let buildCrate = { crateName, crateVersion, crateAuthors, buildDependencies,
     '';
 in
 
-crate_: lib.makeOverridable ({ rust, release, verbose, features, buildInputs, crateOverrides }:
+crate_: lib.makeOverridable ({ rust, release, verbose, features, buildInputs, crateOverrides,
+  dependencies, buildDependencies,
+  extraRustcOpts,
+  preUnpack, postUnpack, prePatch, patches, postPatch,
+  preConfigure, postConfigure, preBuild, postBuild, preInstall, postInstall }:
 
 let crate = crate_ // (lib.attrByPath [ crate_.crateName ] (attr: {}) crateOverrides crate_);
+    release_ = release;
+    dependencies_ = dependencies;
+    buildDependencies_ = buildDependencies;
     processedAttrs = [
       "src" "buildInputs" "crateBin" "crateLib" "libName" "libPath"
       "buildDependencies" "dependencies" "features"
@@ -309,6 +349,7 @@ in
 stdenv.mkDerivation (rec {
 
     inherit (crate) crateName;
+    inherit preUnpack postUnpack prePatch patches postPatch preConfigure postConfigure preBuild postBuild preInstall postInstall;
 
     src = if lib.hasAttr "src" crate then
         crate.src
@@ -319,12 +360,12 @@ stdenv.mkDerivation (rec {
     dependencies =
       builtins.map
         (dep: dep.override { rust = rust; release = release; verbose = verbose; crateOverrides = crateOverrides; })
-        (crate.dependencies or []);
+        dependencies_;
 
     buildDependencies =
       builtins.map
         (dep: dep.override { rust = rust; release = release; verbose = verbose; crateOverrides = crateOverrides; })
-        (crate.buildDependencies or []);
+        buildDependencies_;
 
     completeDeps = lib.lists.unique (dependencies ++ lib.lists.concatMap (dep: dep.completeDeps) dependencies);
     completeBuildDeps = lib.lists.unique (
@@ -339,7 +380,8 @@ stdenv.mkDerivation (rec {
     libName = if crate ? libName then crate.libName else crate.crateName;
     libPath = if crate ? libPath then crate.libPath else "";
 
-    metadata = builtins.substring 0 10 (builtins.hashString "sha256" (crateName + "-" + crateVersion));
+    depsMetadata = builtins.foldl' (str: dep: str + dep.metadata) "" (dependencies ++ buildDependencies);
+    metadata = builtins.substring 0 10 (builtins.hashString "sha256" (crateName + "-" + crateVersion + "___" + toString crateFeatures + "___" + depsMetadata ));
 
     crateBin = if crate ? crateBin then
        builtins.foldl' (bins: bin:
@@ -370,20 +412,42 @@ stdenv.mkDerivation (rec {
     crateAuthors = if crate ? authors && lib.isList crate.authors then crate.authors else [];
     crateType =
       if lib.attrByPath ["procMacro"] false crate then "proc-macro" else
-      if lib.attrByPath ["plugin"] false crate then "dylib" else "lib";
+      if lib.attrByPath ["plugin"] false crate then "dylib" else
+      if crate ? type then crate.type else "lib";
     colors = lib.attrByPath [ "colors" ] "always" crate;
-    buildPhase = buildCrate {
+    configurePhase = configureCrate {
       inherit crateName dependencies buildDependencies completeDeps completeBuildDeps
+              crateFeatures libName build release libPath crateVersion
+              crateAuthors verbose colors;
+    };
+    extraRustcOpts = if crate ? extraRustcOpts then crate.extraRustcOpts else [];
+    buildPhase = buildCrate {
+      inherit crateName dependencies completeDeps completeBuildDeps
               crateFeatures libName build release libPath crateType crateVersion
-              crateAuthors metadata crateBin finalBins verbose colors;
+              crateAuthors metadata crateBin finalBins verbose colors extraRustcOpts;
     };
-    installPhase = installCrate crateName;
+    installPhase = installCrate crateName metadata;
 
-} // extraDerivationAttrs)) {
+} // extraDerivationAttrs
+)) {
   rust = rustc;
-  release = true;
-  verbose = true;
+  release = crate_.release or true;
+  verbose = crate_.verbose or true;
+  extraRustcOpts = [];
   features = [];
   buildInputs = [];
   crateOverrides = defaultCrateOverrides;
+  preUnpack = crate_.preUnpack or "";
+  postUnpack = crate_.postUnpack or "";
+  prePatch = crate_.prePatch or "";
+  patches = crate_.patches or [];
+  postPatch = crate_.postPatch or "";
+  preConfigure = crate_.preConfigure or "";
+  postConfigure = crate_.postConfigure or "";
+  preBuild = crate_.preBuild or "";
+  postBuild = crate_.postBuild or "";
+  preInstall = crate_.preInstall or "";
+  postInstall = crate_.postInstall or "";
+  dependencies = crate_.dependencies or [];
+  buildDependencies = crate_.buildDependencies or [];
 }
diff --git a/pkgs/build-support/rust/carnix.nix b/pkgs/build-support/rust/carnix.nix
index 8b0af499c8f1..ebb46b0f5921 100644
--- a/pkgs/build-support/rust/carnix.nix
+++ b/pkgs/build-support/rust/carnix.nix
@@ -1,4 +1,4 @@
-# Generated by carnix 0.6.5: carnix -o carnix.nix Cargo.lock --src ./.
+# Generated by carnix 0.6.5: carnix -o carnix.nix Cargo.lock
 { lib, buildPlatform, buildRustCrate, fetchgit }:
 let kernel = buildPlatform.parsed.kernel.name;
     abi = buildPlatform.parsed.abi.name;
@@ -18,7 +18,7 @@ let kernel = buildPlatform.parsed.kernel.name;
     ) [] (builtins.attrNames feat);
 in
 rec {
-  carnix = f: carnix_0_6_5 { features = carnix_0_6_5_features { carnix_0_6_5 = f; }; };
+  carnix = f: carnix_0_6_6 { features = carnix_0_6_6_features { carnix_0_6_6 = f; }; };
   aho_corasick_0_6_3_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
     crateName = "aho-corasick";
     version = "0.6.3";
@@ -71,11 +71,11 @@ rec {
     sha256 = "0p4b3nr0s5nda2qmm7xdhnvh4lkqk3xd8l9ffmwbvqw137vx7mj1";
     inherit dependencies buildDependencies features;
   };
-  carnix_0_6_5_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
+  carnix_0_6_6_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
     crateName = "carnix";
-    version = "0.6.5";
+    version = "0.6.6";
     authors = [ "pe@pijul.org <pe@pijul.org>" ];
-    sha256 = "0r952s5az5mhw7z2r421i5lr0w5h436hah61md2bdb3204c2pl9c";
+    sha256 = "1ai2r52j6vlrclhb7cvifx3lsg9naiy3jpsrbi3mmfmr6zbi7rdw";
     inherit dependencies buildDependencies features;
   };
   cc_1_0_3_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
@@ -623,11 +623,11 @@ rec {
       (f.bitflags_1_0_1.default or false) ||
       (bitflags_1_0_1.default or false);
   }) [];
-  carnix_0_6_5 = { features?(carnix_0_6_5_features {}) }: carnix_0_6_5_ {
+  carnix_0_6_6 = { features?(carnix_0_6_6_features {}) }: carnix_0_6_6_ {
     dependencies = mapFeatures features ([ clap_2_28_0 env_logger_0_5_3 error_chain_0_11_0 itertools_0_7_3 log_0_4_1 nom_3_2_1 regex_0_2_2 rusqlite_0_13_0 serde_1_0_21 serde_derive_1_0_21 serde_json_1_0_6 tempdir_0_3_5 toml_0_4_5 ]);
   };
-  carnix_0_6_5_features = f: updateFeatures f (rec {
-    carnix_0_6_5.default = (f.carnix_0_6_5.default or true);
+  carnix_0_6_6_features = f: updateFeatures f (rec {
+    carnix_0_6_6.default = (f.carnix_0_6_6.default or true);
     clap_2_28_0.default = true;
     env_logger_0_5_3.default = true;
     error_chain_0_11_0.default = true;
diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix
index 63d08e1d0311..83ef146de5f8 100644
--- a/pkgs/build-support/rust/default.nix
+++ b/pkgs/build-support/rust/default.nix
@@ -4,7 +4,7 @@ let
     inherit stdenv cacert git rust cargo-vendor;
   };
 in
-{ name, cargoSha256
+{ name, cargoSha256 ? null
 , src ? null
 , srcs ? null
 , sourceRoot ? null
@@ -13,15 +13,31 @@ in
 , cargoUpdateHook ? ""
 , cargoDepsHook ? ""
 , cargoBuildFlags ? []
+
+, cargoVendorDir ? null
 , ... } @ args:
 
+assert cargoVendorDir == null -> cargoSha256 != null;
+
 let
   lib = stdenv.lib;
 
-  cargoDeps = fetchcargo {
-    inherit name src srcs sourceRoot cargoUpdateHook;
-    sha256 = cargoSha256;
-  };
+  cargoDeps = if cargoVendorDir == null
+    then fetchcargo {
+        inherit name src srcs sourceRoot cargoUpdateHook;
+        sha256 = cargoSha256;
+      }
+    else null;
+
+  setupVendorDir = if cargoVendorDir == null
+    then ''
+      unpackFile "$cargoDeps"
+      cargoDepsCopy=$(stripHash $(basename $cargoDeps))
+      chmod -R +w "$cargoDepsCopy"
+    ''
+    else ''
+      cargoDepsCopy="$sourceRoot/${cargoVendorDir}"
+    '';
 
 in stdenv.mkDerivation (args // {
   inherit cargoDeps;
@@ -39,9 +55,7 @@ in stdenv.mkDerivation (args // {
   postUnpack = ''
     eval "$cargoDepsHook"
 
-    unpackFile "$cargoDeps"
-    cargoDepsCopy=$(stripHash $(basename $cargoDeps))
-    chmod -R +w "$cargoDepsCopy"
+    ${setupVendorDir}
 
     mkdir .cargo
     cat >.cargo/config <<-EOF
diff --git a/pkgs/data/misc/hackage/default.nix b/pkgs/data/misc/hackage/default.nix
index bdf2abf9b6f8..7f7932d01b4f 100644
--- a/pkgs/data/misc/hackage/default.nix
+++ b/pkgs/data/misc/hackage/default.nix
@@ -1,6 +1,6 @@
 { fetchurl }:
 
 fetchurl {
-  url = "https://github.com/commercialhaskell/all-cabal-hashes/archive/00012ce23948b9547fe6609d595109741e0f58cf.tar.gz";
-  sha256 = "1swgfx7b41jxq0pyws2wipdiyvy8nn6cp54yj3ip3r9l3gdv3f7b";
+  url = "https://github.com/commercialhaskell/all-cabal-hashes/archive/4c8b3501ea6fc9f41cd192ddc08e2d9583a1e679.tar.gz";
+  sha256 = "0aa4pimgllqgn8bcy2p2cdwbpz6s6wk8j41w35jvzaqfj15gysnq";
 }
diff --git a/pkgs/development/compilers/mono/5.8.nix b/pkgs/development/compilers/mono/5.8.nix
new file mode 100644
index 000000000000..6db9e19807bb
--- /dev/null
+++ b/pkgs/development/compilers/mono/5.8.nix
@@ -0,0 +1,8 @@
+{ stdenv, callPackage, Foundation, libobjc }:
+
+callPackage ./generic-cmake.nix (rec {
+  inherit Foundation libobjc;
+  version = "5.8.0.108";
+  sha256 = "177khb06dfll0pcncr84vvibni7f8m5fgb30ndgsdjk25xfcbmzc";
+  enableParallelBuilding = false;
+})
diff --git a/pkgs/development/compilers/rust/binaryBuild.nix b/pkgs/development/compilers/rust/binaryBuild.nix
index 6c6f6b55e1e6..1904c12dfdc1 100644
--- a/pkgs/development/compilers/rust/binaryBuild.nix
+++ b/pkgs/development/compilers/rust/binaryBuild.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, cacert, zlib, buildRustPackage, curl, darwin
+{ stdenv, fetchurl, makeWrapper, bash, cacert, zlib, buildRustPackage, curl, darwin
 , version
 , src
 , platform
@@ -34,9 +34,11 @@ rec {
       license = [ licenses.mit licenses.asl20 ];
     };
 
-    phases = ["unpackPhase" "installPhase" "fixupPhase"];
+    buildInputs = [ bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;
 
-    buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
+    postPatch = ''
+      patchShebangs .
+    '';
 
     installPhase = ''
       ./install.sh --prefix=$out \
@@ -86,9 +88,11 @@ rec {
       license = [ licenses.mit licenses.asl20 ];
     };
 
-    phases = ["unpackPhase" "installPhase" "fixupPhase"];
+    buildInputs = [ makeWrapper bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;
 
-    buildInputs = [ makeWrapper ] ++ stdenv.lib.optional stdenv.isDarwin Security;
+    postPatch = ''
+      patchShebangs .
+    '';
 
     installPhase = ''
       patchShebangs ./install.sh
diff --git a/pkgs/development/compilers/rust/bootstrap.nix b/pkgs/development/compilers/rust/bootstrap.nix
index 034334f58500..9b488bab5b3b 100644
--- a/pkgs/development/compilers/rust/bootstrap.nix
+++ b/pkgs/development/compilers/rust/bootstrap.nix
@@ -3,16 +3,16 @@
 let
   # Note: the version MUST be one version prior to the version we're
   # building
-  version = "1.21.0";
+  version = "1.23.0";
 
-  # fetch hashes by running `print-hashes.sh 1.21.0`
+  # fetch hashes by running `print-hashes.sh 1.23.0`
   hashes = {
-    i686-unknown-linux-gnu = "b7caed0f602cdb8ef22e0bfa9125a65bec411e15c0b8901d937e43303ec7dbee";
-    x86_64-unknown-linux-gnu = "b41e70e018402bc04d02fde82f91bea24428e6be432f0df12ac400cfb03108e8";
-    armv7-unknown-linux-gnueabihf = "416fa6f107ad9e386002e6af1aec495472e2ee489c842183dd429a25b07488d6";
-    aarch64-unknown-linux-gnu = "491ee6c43cc672006968d665bd34c94cc2219ef3592d93d38097c97eaaa864c3";
-    i686-apple-darwin = "c8b0fabeebcde66b683f3a871187e614e07305adda414c2862cb332aecb2b3bf";
-    x86_64-apple-darwin = "75a7f4bd7c72948030bb9e421df27e8a650dea826fb5b836cf59d23d6f985a0d";
+    i686-unknown-linux-gnu = "dc5bd0ef47e1036c8ca64676d8967102cb86ce4bf50b90a9845951c3e940423f";
+    x86_64-unknown-linux-gnu = "9a34b23a82d7f3c91637e10ceefb424539dcfa327c2dcd292ff10c047b1fdc7e";
+    armv7-unknown-linux-gnueabihf = "587027899267f1961520438c2c7f6775fe224160d43ddf07332b9b943a26b08e";
+    aarch64-unknown-linux-gnu = "38379fbd976d2286cb73f21466db40a636a583b9f8a80af5eea73617c7912bc7";
+    i686-apple-darwin = "4709eb1ad2fb871fdaee4b3449569cef366b0d170453cf17484a12286564f2ad";
+    x86_64-apple-darwin = "9274e977322bb4b153f092255ac9bd85041142c73eaabf900cb2ef3d3abb2eba";
   };
 
   platform =
diff --git a/pkgs/development/compilers/rust/cargo.nix b/pkgs/development/compilers/rust/cargo.nix
index 4c397c8c1a48..fecf80a44853 100644
--- a/pkgs/development/compilers/rust/cargo.nix
+++ b/pkgs/development/compilers/rust/cargo.nix
@@ -1,7 +1,8 @@
 { stdenv, fetchFromGitHub, file, curl, pkgconfig, python, openssl, cmake, zlib
 , makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2, darwin
-, version, srcSha, cargoSha256
-, patches ? [] }:
+, version
+, patches ? []
+, src }:
 
 let
   inherit (darwin.apple_sdk.frameworks) CoreFoundation;
@@ -9,17 +10,12 @@ in
 
 rustPlatform.buildRustPackage rec {
   name = "cargo-${version}";
-  inherit version;
+  inherit version src patches;
 
-  src = fetchFromGitHub {
-    owner  = "rust-lang";
-    repo   = "cargo";
-    rev    = version;
-    sha256 = srcSha;
-  };
-
-  inherit cargoSha256;
-  inherit patches;
+  # the rust source tarball already has all the dependencies vendored, no need to fetch them again
+  cargoVendorDir = "src/vendor";
+  preBuild = "cd src; pushd tools/cargo";
+  postBuild = "popd";
 
   passthru.rustc = rustc;
 
diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix
index b5550a96a835..576e42eb08ab 100644
--- a/pkgs/development/compilers/rust/default.nix
+++ b/pkgs/development/compilers/rust/default.nix
@@ -6,21 +6,20 @@
 
 let
   rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {}));
-  version = "1.22.1";
-in
-rec {
+  version = "1.24.0";
+  cargoVersion = "0.24.0";
+  src = fetchurl {
+    url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
+    sha256 = "17v3jpyky8vkkgai5yd2zr8zl87qpgj6dx99gx27x1sf0kv7d0mv";
+  };
+in rec {
   rustc = callPackage ./rustc.nix {
-    inherit llvm targets targetPatches targetToolchains rustPlatform version;
+    inherit llvm targets targetPatches targetToolchains rustPlatform version src;
 
     forceBundledLLVM = true;
 
     configureFlags = [ "--release-channel=stable" ];
 
-    src = fetchurl {
-      url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
-      sha256 = "1lrzzp0nh7s61wgfs2h6ilaqi6iq89f1pd1yaf65l87bssyl4ylb";
-    };
-
     patches = [
       ./patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch
     ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch
@@ -30,10 +29,8 @@ rec {
   };
 
   cargo = callPackage ./cargo.nix rec {
-    version = "0.23.0";
-    srcSha = "14b2n1msxma19ydchj54hd7f2zdsr524fg133dkmdn7j65f1x6aj";
-    cargoSha256 = "1sj59z0w172qvjwg1ma5fr5am9dgw27086xwdnrvlrk4hffcr7y7";
-
+    version = cargoVersion;
+    inherit src;
     inherit rustc; # the rustc that will be wrapped by cargo
     inherit rustPlatform; # used to build cargo
   };
diff --git a/pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch b/pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch
index d29eb16cfe55..bafab0e9ef71 100644
--- a/pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch
+++ b/pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch
@@ -1,7 +1,7 @@
-diff --git a/src/librustc_back/dynamic_lib.rs b/src/librustc_back/dynamic_lib.rs
+diff --git a/src/librustc_metadata/dynamic_lib.rs b/src/librustc_metadata/dynamic_lib.rs
 index 1b42fa0..92256dc 100644
---- a/src/librustc_back/dynamic_lib.rs
-+++ b/src/librustc_back/dynamic_lib.rs
+--- a/src/librustc_metadata/dynamic_lib.rs
++++ b/src/librustc_metadata/dynamic_lib.rs
 @@ -80,6 +80,7 @@ mod tests {
      use std::mem;
  
diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index efed388ce4ca..92b149865fa2 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -57,9 +57,9 @@ stdenv.mkDerivation {
   # We need rust to build rust. If we don't provide it, configure will try to download it.
   configureFlags = configureFlags
                 ++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ]
-                ++ [ "--enable-vendor" "--disable-locked-deps" ]
+                ++ [ "--enable-vendor" ]
                 # ++ [ "--jemalloc-root=${jemalloc}/lib"
-                ++ [ "--default-linker=${targetPackages.stdenv.cc}/bin/cc" "--default-ar=${targetPackages.stdenv.cc.bintools}/bin/ar" ]
+                ++ [ "--default-linker=${targetPackages.stdenv.cc}/bin/cc" ]
                 ++ optional (!forceBundledLLVM) [ "--enable-llvm-link-shared" ]
                 ++ optional (targets != []) "--target=${target}"
                 ++ optional (!forceBundledLLVM) "--llvm-root=${llvmShared}";
@@ -72,6 +72,8 @@ stdenv.mkDerivation {
   passthru.target = target;
 
   postPatch = ''
+    patchShebangs src/etc
+
     # Fix dynamic linking against llvm
     #${optionalString (!forceBundledLLVM) ''sed -i 's/, kind = \\"static\\"//g' src/etc/mklldeps.py''}
 
@@ -98,19 +100,6 @@ stdenv.mkDerivation {
     # On Hydra: `TcpListener::bind(&addr)`: Address already in use (os error 98)'
     sed '/^ *fn fast_rebind()/i#[ignore]' -i src/libstd/net/tcp.rs
 
-    # Disable some failing gdb tests. Try re-enabling these when gdb
-    # is updated past version 7.12.
-    rm src/test/debuginfo/basic-types-globals.rs
-    rm src/test/debuginfo/basic-types-mut-globals.rs
-    rm src/test/debuginfo/c-style-enum.rs
-    rm src/test/debuginfo/lexical-scopes-in-block-expression.rs
-    rm src/test/debuginfo/limited-debuginfo.rs
-    rm src/test/debuginfo/simple-struct.rs
-    rm src/test/debuginfo/simple-tuple.rs
-    rm src/test/debuginfo/union-smoke.rs
-    rm src/test/debuginfo/vec-slices.rs
-    rm src/test/debuginfo/vec.rs
-
     # Useful debugging parameter
     # export VERBOSE=1
   ''
diff --git a/pkgs/games/xjump/darwin.patch b/pkgs/games/xjump/darwin.patch
new file mode 100644
index 000000000000..8221677658e3
--- /dev/null
+++ b/pkgs/games/xjump/darwin.patch
@@ -0,0 +1,21 @@
+--- xjump/src/main.c	2018-02-20 09:15:15.608807657 +0100
++++ xjump-patched/src/main.c	2018-02-20 09:15:34.148949100 +0100
+@@ -604,18 +604,6 @@
+    * optimistic privilege dropping function. */
+   setgroups(0, NULL);
+ 
+-  if (setresgid(-1, realgid, realgid) != 0) {
+-    perror("Could not drop setgid privileges.  Aborting.");
+-    exit(1);
+-  }
+-
+-  /* Dropping user privileges must come last.
+-   * Otherwise we won't be able to drop group privileges anymore */
+-  if (setresuid(-1, realuid, realuid) != 0) {
+-    perror("Could not drop setuid privileges.  Aborting.");
+-    exit(1);
+-  }
+-
+   /* From now on we run with regular user privileges */
+ 
+   static XtActionsRec a_table[] = {
diff --git a/pkgs/games/xjump/default.nix b/pkgs/games/xjump/default.nix
new file mode 100644
index 000000000000..df9ff30f2101
--- /dev/null
+++ b/pkgs/games/xjump/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, buildPlatform, fetchFromGitHub, autoconf, automake, libX11, libXt, libXpm, libXaw, localStateDir?null }:
+
+stdenv.mkDerivation rec {
+  name = "xjump-${version}";
+  version = "2.9.3";
+  src = fetchFromGitHub {
+    owner = "hugomg";
+    repo = "xjump";
+    rev = "e7f20fb8c2c456bed70abb046c1a966462192b80";
+    sha256 = "0hq4739cvi5a47pxdc0wwkj2lmlqbf1xigq0v85qs5bq3ixmq2f7";
+  };
+  nativeBuildInputs = [ autoconf automake ];
+  buildInputs = [ libX11 libXt libXpm libXaw ];
+  preConfigure = "autoreconf --install";
+  patches = if buildPlatform.isDarwin then [ ./darwin.patch ] else [];
+  configureFlags =
+    if localStateDir != null then
+      ["--localstatedir=${localStateDir}"]
+    else
+      [];
+
+  meta = with stdenv.lib; {
+    description = "The falling tower game";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ pmeunier ];
+  };
+}
diff --git a/pkgs/misc/vim-plugins/default.nix b/pkgs/misc/vim-plugins/default.nix
index 00f0995e32ab..7cf6e6b596ed 100644
--- a/pkgs/misc/vim-plugins/default.nix
+++ b/pkgs/misc/vim-plugins/default.nix
@@ -3138,6 +3138,16 @@ rec {
 
   };
 
+  vim-rooter = buildVimPluginFrom2Nix {
+    name = "vim-rooter-2017-11-20";
+    src = fetchgit {
+      url = "git://github.com/airblade/vim-rooter";
+      rev = "3509dfb80d0076270a04049548738daeedf6dfb9";
+      sha256 = "03j26fw0dcvcc81fn8hx1prdwlgnd3g340pbxrzgbgxxq5kr0bwl";
+    };
+    dependencies = [];
+
+  };
 
   vim-ruby = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-ruby-2017-06-22";
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 58e476dd0682..ec861058266d 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -6513,6 +6513,11 @@ with pkgs;
     inherit (darwin.apple_sdk.frameworks) Foundation;
   });
 
+  mono58 = lowPrio (callPackage ../development/compilers/mono/5.8.nix {
+    inherit (darwin) libobjc;
+    inherit (darwin.apple_sdk.frameworks) Foundation;
+  });
+
   monoDLLFixer = callPackage ../build-support/mono-dll-fixer { };
 
   mozart-binary = callPackage ../development/compilers/mozart/binary.nix { };
@@ -19037,6 +19042,7 @@ with pkgs;
     tk = tk-8_5;
   };
 
+  xjump = callPackage ../games/xjump { };
   # TODO: the corresponding nix file is missing
   # xracer = callPackage ../games/xracer { };