Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
27 changes: 27 additions & 0 deletions flake.lock
Copy link
Copy Markdown

@janb84 janb84 Jun 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not create a "lot of" churn to include this ? (I get having stable versions is also nice)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd argue flake.lock is essential for devshells. AFAIU, the lock file is used for the cache, so faster builds, and without the lockfile you're likely to unexpectedly pull in new versions of dependencies (without intending to), which you absolutely don't want while developing.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,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";
};
Comment thread
willcl-ark marked this conversation as resolved.
in
{
devShells = forAllSystems (pkgs: {
default = mkDevShell pkgs;
});
formatter = forAllSystems (pkgs: pkgs.nixfmt-tree);
};
}
Loading