forked from input-output-hk/catalyst-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
34 lines (34 loc) · 1.21 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
utils.url = "github:kreisys/flake-utils";
naersk.url = "github:nmattia/naersk";
naersk.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, utils, naersk }:
utils.lib.simpleFlake rec {
inherit nixpkgs;
systems = [ "x86_64-linux" "aarch64-linux" ];
preOverlays = [ naersk overlay ];
overlay = final: prev: {
catalyst-toolbox = prev.naersk.buildPackage {
inherit ((builtins.fromTOML
(builtins.readFile (./Cargo.toml))).package)
name version;
root = ./.;
nativeBuildInputs = with final; [ pkg-config protobuf rustfmt ];
buildInputs = with final; [ openssl ];
PROTOC = "${final.protobuf}/bin/protoc";
PROTOC_INCLUDE = "${final.protobuf}/include";
};
};
packages = { catalyst-toolbox }@pkgs: pkgs;
devShell =
{ mkShell, rustc, cargo, pkg-config, openssl, protobuf, rustfmt }:
mkShell {
PROTOC = "${protobuf}/bin/protoc";
PROTOC_INCLUDE = "${protobuf}/include";
buildInputs = [ rustc cargo pkg-config openssl protobuf rustfmt ];
};
};
}