-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathflake.nix
More file actions
122 lines (112 loc) · 2.99 KB
/
Copy pathflake.nix
File metadata and controls
122 lines (112 loc) · 2.99 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
{
description = "Alpen Nix";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils = {
url = "github:numtide/flake-utils";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
sp1-nix = {
url = "github:alpenlabs/sp1.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
risc0-nix = {
url = "github:alpenlabs/risc0.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs =
{
nixpkgs,
flake-utils,
rust-overlay,
sp1-nix,
risc0-nix,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
rust-overlay.overlays.default
sp1-nix.overlays.default
risc0-nix.overlays.default
];
};
rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
alpen-cli-toml = builtins.fromTOML (builtins.readFile ./bin/alpen-cli/Cargo.toml);
in
rec {
packages = {
default = packages.alpen-cli;
alpen-cli = pkgs.rustPlatform.buildRustPackage {
pname = alpen-cli-toml.package.name;
version = alpen-cli-toml.package.version;
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
allowBuiltinFetchGit = true;
};
buildType = "release";
doCheck = false;
cargoBuildFlags = [
"--package"
"alpen-cli"
"--bin"
"alpen"
];
nativeBuildInputs = with pkgs; [
pkg-config
rust-toolchain
];
buildInputs = with pkgs; [
openssl
];
meta = {
mainProgram = "alpen";
};
};
};
devShells.default = pkgs.mkShell {
packages = with pkgs; [
bashInteractive
openssl
# rust
rust-toolchain
# zkVMs
cargo-prove
sp1-rust-toolchain
risc0-toolchain
# devtools
git
taplo
codespell
just
cargo-nextest
cargo-audit
cargo-hack
bitcoind
shellcheck
# C/C++ build dependencies for bindgen and native libs
pkg-config
clang
llvmPackages.libclang.lib
llvmPackages.libcxxStdenv.cc.cc.lib
stdenv.cc.cc.lib
uv
];
env = {
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib:${pkgs.llvmPackages.libcxxStdenv.cc.cc.lib}/lib";
};
};
}
);
}