Skip to content

Commit

Permalink
chore(flake): use naersk to build rust package
Browse files Browse the repository at this point in the history
  • Loading branch information
mpontus committed Aug 25, 2022
1 parent 98f5787 commit ec1e6ff
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
21 changes: 21 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
url = github:nix-community/fenix;
inputs.nixpkgs.follows = "nixpkgs";
};
naersk = {
url = github:nmattia/naersk;
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs :
Expand All @@ -34,7 +38,7 @@
file = ./rust-toolchain.toml;
sha256 = "sha256-CNMj0ouNwwJ4zwgc/gAeTYyDYe0botMoaj/BkeDTy4M=";
};
nightlyRustPlatform = pkgs.makeRustPlatform {
naersk' = pkgs.callPackage inputs.naersk {
cargo = toolchain;
rustc = toolchain;
};
Expand Down Expand Up @@ -77,7 +81,7 @@
&& builtins.all (name: builtins.baseNameOf path != name) ignoreList;
in
rec {
defaultPackage = nightlyRustPlatform.buildRustPackage {
defaultPackage = naersk'.buildPackage {
pname = name;
inherit version;

Expand All @@ -103,6 +107,10 @@
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
PROTOC = "${pkgs.protobuf}/bin/protoc";

# Either this or `singleStep = true` is needed to build.
# See https://github.com/nix-community/naersk/issues/133
copySourcesFrom = ["runtime/development"];

doCheck = false;
};

Expand Down

0 comments on commit ec1e6ff

Please sign in to comment.