Skip to content

Commit e28dc41

Browse files
stariusstringintech
andcommitted
Add Nix dev shell
Co-Authored-By: stringintech <[email protected]>
1 parent 517c6ce commit e28dc41

File tree

3 files changed

+93
-1
lines changed

3 files changed

+93
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ This command will configure Bitcoin Core's CMake build system and statically com
4444
[macOS](./depend/bitcoin/doc/build-osx.md),
4545
[Windows](./depend/bitcoin/doc/build-windows.md))
4646

47-
**Addtional note for Windows:** MinGW toolchain is required. CGo uses GCC on Windows, so static linking requires the library to be compiled with GCC/MinGW rather than MSVC for ABI compatibility.
47+
**Additional notes:**
48+
- **For Windows:** MinGW toolchain is required. CGo uses GCC on Windows, so static linking requires the library to be compiled with GCC/MinGW rather than MSVC for ABI compatibility.
49+
- **For Nix users:** Run `nix develop` to automatically get all the build and runtime dependencies, then run `make build-kernel` and continue with the remaining steps in the Nix dev shell.
4850

4951
### Step 3: Run Tests
5052

flake.lock

Lines changed: 60 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: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
description = "go-bitcoinkernel";
3+
4+
inputs = {
5+
nixpkgs.url = "nixpkgs/nixos-25.05";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils }:
10+
flake-utils.lib.eachDefaultSystem (system:
11+
let
12+
pkgs = import nixpkgs {
13+
inherit system;
14+
};
15+
nativeDeps = with pkgs; [
16+
cmake
17+
go_1_23
18+
golangci-lint
19+
];
20+
runtimeDeps = with pkgs; [
21+
boost
22+
];
23+
in
24+
{
25+
devShells.default = pkgs.mkShell {
26+
nativeBuildInputs = nativeDeps;
27+
buildInputs = runtimeDeps;
28+
};
29+
});
30+
}

0 commit comments

Comments
 (0)