Skip to content

Commit e334474

Browse files
committed
stealth: initial commit
1 parent 5668668 commit e334474

File tree

5 files changed

+293
-0
lines changed

5 files changed

+293
-0
lines changed

bitcoin-core/flake.lock

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

bitcoin-core/flake.nix

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
description = "Bitcoin development environment";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/24.11";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { nixpkgs, flake-utils, ... }:
10+
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-darwin" ] (system:
11+
let
12+
pkgs = import nixpkgs { inherit system; };
13+
isLinux = pkgs.stdenv.isLinux;
14+
lib = pkgs.lib;
15+
16+
commonNativeBuildInputs = with pkgs; [
17+
byacc
18+
ccache
19+
clang-tools_19
20+
clang_19
21+
cmake
22+
gcc14
23+
gnum4
24+
gnumake
25+
mold-wrapped
26+
ninja
27+
pkg-config
28+
qt6.wrapQtAppsHook
29+
];
30+
31+
linuxNativeBuildInputs = with pkgs; [
32+
libsystemtap
33+
linuxPackages.bcc
34+
linuxPackages.bpftrace
35+
python312Packages.bcc
36+
];
37+
38+
nativeBuildInputs = commonNativeBuildInputs ++ (if isLinux then linuxNativeBuildInputs else [ ]);
39+
40+
pythonEnv = pkgs.python312.withPackages (ps: with ps; [
41+
flake8
42+
lief
43+
mypy
44+
pyzmq
45+
vulture
46+
]);
47+
48+
commonBuildInputs = with pkgs; [
49+
boost
50+
capnproto
51+
codespell
52+
db4
53+
gdb
54+
hexdump
55+
libevent
56+
qrencode
57+
qt6.qtbase
58+
qt6.qttools
59+
sqlite
60+
uv
61+
valgrind
62+
zeromq
63+
pythonEnv
64+
];
65+
66+
linuxBuildInputs = with pkgs; [
67+
python312Packages.bcc
68+
];
69+
70+
buildInputs = commonBuildInputs ++ (if isLinux then linuxBuildInputs else [ ]);
71+
72+
shellHook = ''
73+
# Opinionated defaults
74+
export CC=clang
75+
export CXX=clang++
76+
export CMAKE_GENERATOR=Ninja
77+
export LDFLAGS="-fuse-ld=mold"
78+
'';
79+
in
80+
{
81+
devShells.default = pkgs.mkShell {
82+
LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.gcc14.cc pkgs.capnproto ];
83+
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
84+
QT_PLUGIN_PATH = "${pkgs.qt6.qtbase}/${pkgs.qt6.qtbase.qtPluginPrefix}";
85+
inherit nativeBuildInputs buildInputs shellHook;
86+
};
87+
}
88+
);
89+
}

flake.lock

Lines changed: 61 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: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
description = "devazoa - a collection of development environments";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/24.11";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils, ... }:
10+
let
11+
supportedSystems = [
12+
"x86_64-linux"
13+
"aarch64-darwin"
14+
];
15+
in
16+
flake-utils.lib.eachSystem supportedSystems (system:
17+
let
18+
pkgs = import nixpkgs { inherit system; };
19+
in
20+
{
21+
# Existing outputs
22+
flakes = {
23+
bitcoin-core = import ./bitcoin-core;
24+
rust-bitcoinkernel = import ./rust-bitcoinkernel;
25+
};
26+
27+
devShells.default = pkgs.mkShell {
28+
buildInputs = with pkgs; [
29+
nix
30+
git
31+
];
32+
};
33+
34+
# Add formatter
35+
formatter = pkgs.nixpkgs-fmt;
36+
}
37+
);
38+
}

rust-bitcoinkernel/flake.nix

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
description = "Rust Bitcoin Kernel bindings";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
bitcoin-core-flake.url = "github:bitcoin-dev-tools/nix-dev-shell";
8+
};
9+
10+
outputs = { self, nixpkgs, flake-utils, bitcoin-core-flake }:
11+
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-darwin" ] (system:
12+
let
13+
pkgs = import nixpkgs { inherit system; };
14+
15+
# Import the Bitcoin Core shell
16+
bitcoinDevShell = bitcoin-core-flake.devShells.${system}.default;
17+
in
18+
{
19+
devShells.default = pkgs.mkShell {
20+
# add the needed Rust dependencies to the Bitcoin Core shell
21+
nativeBuildInputs = bitcoinDevShell.nativeBuildInputs ++ (with pkgs; [
22+
rustc
23+
cargo
24+
clippy
25+
rustfmt
26+
llvmPackages_19.libclang
27+
]);
28+
29+
# Reuse Bitcoin Core build inputs
30+
buildInputs = bitcoinDevShell.buildInputs;
31+
32+
# Combine shell hooks
33+
shellHook = ''
34+
# Run the Bitcoin Core shell hook first
35+
${bitcoinDevShell.shellHook}
36+
37+
# Add Rust-specific configuration
38+
export LIBCLANG_PATH="${pkgs.llvmPackages_19.libclang.lib}/lib"
39+
export CXX_STDLIB="stdc++"
40+
'';
41+
};
42+
}
43+
);
44+
}

0 commit comments

Comments
 (0)