forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathflake.nix
More file actions
56 lines (52 loc) · 1.51 KB
/
Copy pathflake.nix
File metadata and controls
56 lines (52 loc) · 1.51 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
{
description = "2140 Bitcoin Core devShell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ nixpkgs, ... }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f (import nixpkgs { inherit system; }));
mkDevShell =
pkgs:
let
inherit (pkgs) lib;
inherit (pkgs.stdenv) isLinux isDarwin;
nativeBuildInputs = [
pkgs.ccache
pkgs.cmakeCurses # cmakeCurses includes the ccmake tool
pkgs.ninja
pkgs.pkg-config
pkgs.python313
]
++ lib.optionals isLinux [
pkgs.libsystemtap
pkgs.linuxPackages.bcc
pkgs.linuxPackages.bpftrace
];
buildInputs = [
pkgs.boost
pkgs.capnproto
];
in
pkgs.mkShell {
inherit nativeBuildInputs buildInputs;
hardeningDisable = lib.optionals isDarwin [ "stackclashprotection" ];
CMAKE_GENERATOR = "Ninja";
CMAKE_EXPORT_COMPILE_COMMANDS = 1;
LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.capnproto ];
LOCALE_ARCHIVE = lib.optionalString isLinux "${pkgs.glibcLocales}/lib/locale/locale-archive";
};
in
{
devShells = forAllSystems (pkgs: {
default = mkDevShell pkgs;
});
formatter = forAllSystems (pkgs: pkgs.nixfmt-tree);
};
}