-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Kinda hard to guess which versions this crate works with, would be great to provide a devenv.nix or nix shell that builds the specific versions that its expecting and use that rather than installing and downloading things separately (I couldn't get it to work on macos).
Once I get this to work, I'm happy to submit that
{ pkgs, lib, config, inputs, ... }:
let
customBitcoind = pkgs.callPackage ./bitcoind.nix {};
in
{
env.DATABASE_URL="postgres";
packages = [
pkgs.git
pkgs.just
pkgs.openssl
pkgs.cargo-nextest
pkgs.hurl
pkgs.sqlx-cli
pkgs.tailwindcss
pkgs.cargo-watch
pkgs.electrs
customBitcoind
] ++ lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk; [
frameworks.CoreFoundation
frameworks.Security
frameworks.SystemConfiguration
]);
enterShell = ''
git --version
cargo --version
alias c="cargo"
bitcoind --version # Check Bitcoin Core version
export BITCOIND_EXE=$(which bitcoind)
echo $BITCOIND_EXE
export ELECTRS_EXEC=$(which electrs)
echo $ELECTRS_EXEC
'';
# https://devenv.sh/pre-commit-hooks/
pre-commit.hooks = {
clippy.enable = true;
cargo-check.enable = true;
rustfmt.enable = true;
};
# https://devenv.sh/languages/
languages.nix.enable = true;
languages.rust = {
enable = true;
channel = "stable";
};
services.postgres = {
enable = true;
# initialDatabases = [{ name = "keel"; }];
};
}{ lib
, stdenv
, fetchurl
, pkg-config
, autoreconfHook
, boost
, libevent
, miniupnpc
, zeromq
, zlib
, db48
, sqlite
, qrencode
, python3
, util-linux
, darwin
}:
stdenv.mkDerivation rec {
pname = "bitcoind";
version = "25.0";
src = fetchurl {
url = "https://bitcoincore.org/bin/bitcoin-core-${version}/bitcoin-${version}.tar.gz";
sha256 = "sha256-XfZ89CyjuaDDjNr+xbu1F9pbWNJR8yyNKkdRH5vh68I=";
};
nativeBuildInputs = [ pkg-config autoreconfHook ];
buildInputs = [
boost
libevent
miniupnpc
zeromq
zlib
db48
sqlite
qrencode
python3
util-linux
] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Foundation ];
configureFlags = [
"--with-boost-libdir=${boost.out}/lib"
"--disable-bench"
"--disable-tests"
"--disable-gui-tests"
"--disable-fuzz-binary"
];
enableParallelBuilding = true;
meta = with lib; {
description = "Bitcoin Core daemon";
longDescription = ''
Bitcoin is a free open source peer-to-peer electronic cash system that is
completely decentralized, without the need for a central server or trusted
parties. Users hold the crypto keys to their own money and transact directly
with each other, with the help of a P2P network to check for double-spending.
'';
homepage = "https://bitcoincore.org/";
maintainers = with maintainers; [ roconnor ];
license = licenses.mit;
platforms = platforms.unix;
};
}Metadata
Metadata
Assignees
Labels
No labels