-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
37 lines (31 loc) · 950 Bytes
/
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
35
36
37
{
description = "Crane Test";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/3ea257209da29110bd4c83bd2efc6d89ddc40b46";
crane = {
url = "github:ipetkov/crane";
inputs.flake-utils.follows = "utils";
inputs.nixpkgs.follows = "nixpkgs";
};
utils.url = "github:numtide/flake-utils";
};
outputs = { self, crane, nixpkgs, utils }: utils.lib.eachSystem [ "x86_64-darwin" "x86_64-linux" ] (system:
let
pkgs = import nixpkgs { inherit system; };
craneLib = crane.lib.${system};
common = {
pname = "foo";
src = crane.lib.${system}.cleanCargoSource ./.;
version = "0.1.0";
buildInputs = with pkgs; lib.optionals stdenv.isDarwin [ libiconv ];
doCheck = false;
};
deps = craneLib.buildDepsOnly (common // {
});
in
{
packages.default = craneLib.buildPackage (common // {
cargoArtifacts = deps;
});
});
}