Skip to content

Commit fe651b0

Browse files
committed
Merge branch 'nix-shell'
2 parents 2543626 + d59426a commit fe651b0

File tree

2 files changed

+181
-0
lines changed

2 files changed

+181
-0
lines changed

flake.lock

Lines changed: 99 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
description = "rust-bitcoinkernel";
3+
4+
inputs = {
5+
nixpkgs.url = "nixpkgs/nixos-25.05";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
fenix = {
8+
url = "github:nix-community/fenix";
9+
inputs.nixpkgs.follows = "nixpkgs";
10+
};
11+
};
12+
13+
outputs = { self, nixpkgs, flake-utils, fenix }:
14+
flake-utils.lib.eachDefaultSystem (system:
15+
let
16+
pkgs = import nixpkgs {
17+
inherit system;
18+
};
19+
20+
rustVersion = "1.71.0";
21+
rustToolchain = fenix.packages.${system}.fromToolchainName {
22+
name = rustVersion;
23+
sha256 = "sha256-ks0nMEGGXKrHnfv4Fku+vhQ7gx76ruv6Ij4fKZR3l78=";
24+
};
25+
rustBuildToolchain = fenix.packages.${system}.combine [
26+
rustToolchain.rustc
27+
rustToolchain.cargo
28+
rustToolchain.rust-src
29+
rustToolchain.rust-std
30+
];
31+
32+
rustBuildToolchainNightly = fenix.packages.${system}.latest.toolchain;
33+
34+
rustPlatformNightly = pkgs.makeRustPlatform {
35+
cargo = rustBuildToolchainNightly;
36+
rustc = rustBuildToolchainNightly;
37+
};
38+
rustfilt = rustPlatformNightly.buildRustPackage rec {
39+
pname = "rustfilt";
40+
version = "0.2.1";
41+
src = pkgs.fetchFromGitHub {
42+
owner = "luser";
43+
repo = "rustfilt";
44+
rev = version;
45+
hash = "sha256-zb1tkeWmeMq7aM8hWssS/UpvGzGbfsaVYCOKBnAKwiQ=";
46+
};
47+
cargoLock.lockFile = "${src}/Cargo.lock";
48+
};
49+
in {
50+
devShells.default = pkgs.mkShell {
51+
packages = [
52+
rustBuildToolchain
53+
54+
pkgs.cmake
55+
pkgs.boost.dev
56+
pkgs.cargo-fuzz
57+
];
58+
59+
LIBCLANG_PATH = "${pkgs.llvmPackages.clang-unwrapped.lib}/lib/";
60+
};
61+
62+
devShells.nightly = pkgs.mkShell {
63+
packages = [
64+
rustBuildToolchainNightly
65+
66+
pkgs.cmake
67+
pkgs.boost.dev
68+
pkgs.cargo-fuzz
69+
70+
pkgs.libllvm
71+
pkgs.cargo-llvm-cov
72+
rustfilt
73+
];
74+
75+
LIBCLANG_PATH = "${pkgs.llvmPackages.clang-unwrapped.lib}/lib/";
76+
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
77+
pkgs.gcc.cc.lib
78+
];
79+
};
80+
}
81+
);
82+
}

0 commit comments

Comments
 (0)