-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
75 lines (66 loc) · 1.69 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
{
description = "bluesky indexer in rust";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
fenix,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
fenix.overlays.default
];
};
lib = pkgs.lib;
fenixPkgs = fenix.packages.${system};
rustToolchain = fenixPkgs.combine [
fenixPkgs.complete.toolchain
(fenixPkgs.complete.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
])
];
in
{
name = "indexer-rust";
devShell = pkgs.mkShell {
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
RUST_SRC_PATH = "${rustToolchain}/lib/rustlib/src/rust/library";
LD_LIBRARY_PATH = lib.makeLibraryPath [
pkgs.libgcc.lib
pkgs.openssl
];
buildInputs = [
rustToolchain
pkgs.rust-analyzer-nightly
pkgs.openssl
pkgs.pkg-config
pkgs.clang
];
shellHook = ''
DATABASE_DIR="/tmp/safjlgfdgsfdgsfdgsd"
mkdir -p $DATABASE_DIR
export DATABASE_DIR
echo 'cargo run -- --db "rocksdb://'$DATABASE_DIR'" --mode full -c '$(pwd)'/ISRG_Root_X1.pem'
'';
};
formatter = pkgs.nixfmt-rfc-style;
}
);
}