From 0fdd7963a1473f02f1b253bb194adb12d4cf3b4e Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Mon, 4 Mar 2019 11:20:34 +1000 Subject: [PATCH] Add cardano-http-bridge to environment of stack --nix Relates to #5 --- default.nix | 2 ++ nix/cardano-http-bridge.nix | 23 +++++++++++++++++++++++ nix/stack-shell.nix | 1 + 3 files changed, 26 insertions(+) create mode 100644 nix/cardano-http-bridge.nix diff --git a/default.nix b/default.nix index b4e7193e615..a0f25b378e0 100644 --- a/default.nix +++ b/default.nix @@ -15,4 +15,6 @@ { inherit pkgs; + + cardano-http-bridge = import ./nix/cardano-http-bridge.nix { inherit pkgs; }; } diff --git a/nix/cardano-http-bridge.nix b/nix/cardano-http-bridge.nix new file mode 100644 index 00000000000..84ef685c950 --- /dev/null +++ b/nix/cardano-http-bridge.nix @@ -0,0 +1,23 @@ +{ nixpkgs ? fetchTarball channel:nixos-19.03 +, pkgs ? import nixpkgs {} +}: + +with pkgs; + +rustPlatform.buildRustPackage { + name = "cardano-http-bridge"; + + src = fetchFromGitHub { + owner = "input-output-hk"; + repo = "cardano-http-bridge"; + fetchSubmodules = true; + rev = "b81c805e0fe62e6b8eacdc11fee573fa5668cbc8"; + sha256 = "0vkg1hgcg9xqwzi9a1rap12sgyvc7ppnf89rqlf8pgsz3akzr4qd"; + }; + + buildInputs = [ sqlite protobuf rustfmt ]; + + PROTOC = "${protobuf}/bin/protoc"; + + cargoSha256 = "19g5fy8af65vd9rl66058c67nlrz7r6mjd0cy83865d7q81hdl8r"; +} diff --git a/nix/stack-shell.nix b/nix/stack-shell.nix index a6487855cca..4be65875d45 100644 --- a/nix/stack-shell.nix +++ b/nix/stack-shell.nix @@ -13,6 +13,7 @@ haskell.lib.buildStackProject { buildInputs = [ zlib gmp ncurses lzma openssl git + walletPackages.cardano-http-bridge ] ++ (lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Cocoa CoreServices libcxx libiconv ])); phases = ["nobuildPhase"];