Skip to content

Instantly share code, notes, and snippets.

@jgillich
Created March 20, 2016 12:36
Show Gist options
  • Save jgillich/efa27aa93ab76c6e07cd to your computer and use it in GitHub Desktop.
Save jgillich/efa27aa93ab76c6e07cd to your computer and use it in GitHub Desktop.
diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix
index 79e4366..aa90c23 100644
--- a/pkgs/build-support/rust/default.nix
+++ b/pkgs/build-support/rust/default.nix
@@ -26,6 +26,8 @@ in stdenv.mkDerivation (args // {
configurePhase = args.configurePhase or "true";
+ unpackPhase = args.unpackPhase or "unpackPhase";
+
postUnpack = ''
echo "Using cargo deps from $cargoDeps"
diff --git a/pkgs/development/tools/rust/diesel/default.nix b/pkgs/development/tools/rust/diesel/default.nix
new file mode 100644
index 0000000..84ad976
--- /dev/null
+++ b/pkgs/development/tools/rust/diesel/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, rustPlatform, postgresql, sqlite, pkgconfig }:
+
+with rustPlatform;
+
+buildRustPackage rec {
+ name = "diesel-${version}";
+ version = "0.5.3";
+
+ src = fetchFromGitHub {
+ owner = "sgrif";
+ repo = "diesel";
+ rev = "2de2b1c921e44f1fecbfa96fa6cd33ee3c3b885a";
+ sha256 = "1xdl5vch6bsaza098p6ymrxv6gwrrwpvhwhc3bkx9klpvif7s06j";
+ };
+
+ unpackPhase = "false";
+
+ depsSha256 = "1r2fxirkc0y6g7aas65n3yg1f2lf3kypnjr2v20p5np2lvla6djq";
+
+ buildInputs = [ postgresql sqlite pkgconfig ];
+
+ installPhase = ''
+ mkdir -p $out/bin
+ cp -p target/release/diesel $out/bin/
+ '';
+
+ meta = with stdenv.lib; {
+ description = "CLI tool for the Diesel ORM";
+ homepage = http://diesel.rs/;
+ license = stdenv.lib.licenses.mit;
+ maintainers = with maintainers; [ jgillich ];
+ };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 1a370e8..ba893f8 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -5918,6 +5918,8 @@ let
ddd = callPackage ../development/tools/misc/ddd { };
+ diesel = callPackage ../development/tools/rust/diesel {};
+
distcc = callPackage ../development/tools/misc/distcc { };
# distccWrapper: wrapper that works as gcc or g++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment