Skip to content

Commit 56fb739

Browse files
stariusstringintech
andcommitted
Add Nix dev shell
Also change go version in current CI jobs to match the go version the nix shell would be using Co-Authored-By: stringintech <[email protected]>
1 parent 0e232a7 commit 56fb739

File tree

4 files changed

+96
-4
lines changed

4 files changed

+96
-4
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Go
1616
uses: actions/setup-go@v5
1717
with:
18-
go-version: '1.23.3'
18+
go-version: '1.23.12'
1919

2020
- name: Install Boost library
2121
run: |
@@ -46,7 +46,7 @@ jobs:
4646
- name: Set up Go
4747
uses: actions/setup-go@v5
4848
with:
49-
go-version: '1.23.3'
49+
go-version: '1.23.12'
5050

5151
- name: Install Boost library
5252
run: |
@@ -86,7 +86,7 @@ jobs:
8686
- name: Set up Go
8787
uses: actions/setup-go@v5
8888
with:
89-
go-version: '1.23.3'
89+
go-version: '1.23.12'
9090

9191
- name: Build Kernel
9292
run: make build-kernel

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)