Skip to content
This repository has been archived by the owner on Dec 18, 2020. It is now read-only.

Commit

Permalink
nix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
foldu committed Feb 16, 2020
1 parent 0d789d5 commit 50020d0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eval "$(lorri direnv)"
9 changes: 9 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
let
pkgs = import <nixpkgs> {};
in
pkgs.mkShell {
buildInputs = with pkgs; [
protobuf
];
PROTOC = "${pkgs.protobuf}/bin/protoc";
}
1 change: 0 additions & 1 deletion tgcd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ tonic = "0.1.0"

[build-dependencies]
tonic-build = "0.1.0"
which = "3.1.0"
6 changes: 4 additions & 2 deletions tgcd/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
let protoc = which::which("protoc").map_err(|e| format!("`protoc` not found, please install it: {}", e))?;
std::env::set_var("PROTOC", &protoc);
// force local protoc
// this doesn't work
//let protoc = which::which("protoc").map_err(|e| format!("`protoc` not found, please install it: {}", e))?;
//std::env::set_var("PROTOC", &protoc);
tonic_build::compile_protos("proto/tgcd.proto")?;
Ok(())
}

0 comments on commit 50020d0

Please sign in to comment.