-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathflake.nix
63 lines (61 loc) · 1.96 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ]
(system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
elfutils-without-zstd = pkgs.elfutils.overrideAttrs (attrs: {
configureFlags = attrs.configureFlags ++ [ "--without-zstd" ];
});
in
with pkgs;
{
formatter = pkgs.nixpkgs-fmt;
devShells.default = mkShell rec {
# https://discourse.nixos.org/t/how-to-add-pkg-config-file-to-a-nix-package/8264/4
nativeBuildInputs = with pkgs; [
pkg-config
];
buildInputs = [
rust-bin.stable.latest.default
llvmPackages_16.clang
# llvmPackages_16.clang-unwrapped https://github.com/NixOS/nixpkgs/issues/30670
llvmPackages_16.libcxx
llvmPackages_16.libclang
llvmPackages_16.lld
# Debugging
strace
gdb
# Native deps
glibc
glibc.static
elfutils-without-zstd
zlib.static
zlib.dev
openssl
# Other tools
cargo-edit
# snapshot testing plugin binary
cargo-insta
# ocamlPackages.magic-trace
];
LIBCLANG_PATH = lib.makeLibraryPath [ llvmPackages_16.libclang ];
LD_LIBRARY_PATH = lib.makeLibraryPath [ zlib.static elfutils-without-zstd ];
};
}
);
}