-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
79 lines (67 loc) · 1.95 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "utils";
};
};
naersk = {
url = "github:nix-community/naersk";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "utils";
};
};
};
outputs = { self, nixpkgs, naersk, rust-overlay, utils }:
utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
rust = pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
};
naersk-lib = naersk.lib."${system}".override {
cargo = rust;
rustc = rust;
};
in
with pkgs;
{
defaultPackage = naersk-lib.buildPackage {
pname = "gsw";
root = ./.;
};
devShell = mkShell {
nativeBuildInputs = [
clang_13
];
buildInputs = [
rust
openssl
pkg-config
llvmPackages_13.libclang
llvmPackages_13.libcxxClang
git
gdb
cargo-watch
cargo-c
cargo-asm
cargo-outdated
cargo-criterion
ripgrep
jq
];
BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${llvmPackages_13.libclang.lib}/lib/clang/${lib.getVersion clang}/include";
LIBCLANG_PATH = "${llvmPackages_13.libclang.lib}/lib";
# workaround for https://github.com/NixOS/nixpkgs/blob/48dfc9fa97d762bce28cc8372a2dd3805d14c633/doc/languages-frameworks/python.section.md#python-setuppy-bdist_wheel-cannot-create-whl
SOURCE_DATE_EPOCH = 315532800; # 1980
};
});
}