Remove unused services and support features
Squirtle runs bitcoind, lnd, electrs and mempool. Remove every other service module and its packages (clightning and plugins, joinmarket, btcpayserver/nbxplorer, rtl, liquid, lndconnect, loop, pool, charge-lnd, fulcrum, hardware-wallets, python-packages, bitcoind_29), plus the support features squirtle doesn't use: netns-isolation, i2p support in bitcoind, backups, versioning, obsolete-options and the krops/nixops deployment modules. mempool loses its electrumServer option and always uses electrs. Squirtle's system is unchanged on 26.05 apart from two blank lines in bitcoin.conf, and it now evaluates on 26.11 without the i2pd patch on branch nixos-26.11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,214 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchurl,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
pkg-config,
|
||||
installShellFiles,
|
||||
wrapQtAppsHook ? null,
|
||||
boost,
|
||||
libevent,
|
||||
zeromq,
|
||||
zlib,
|
||||
db48,
|
||||
sqlite,
|
||||
qrencode,
|
||||
libsystemtap,
|
||||
qtbase ? null,
|
||||
qttools ? null,
|
||||
python3,
|
||||
versionCheckHook,
|
||||
nixosTests,
|
||||
withGui ? false,
|
||||
withWallet ? true,
|
||||
enableTracing ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isStatic,
|
||||
gnupg,
|
||||
# Signatures from the following GPG public keys checked during verification of the source code.
|
||||
# The list can be found at https://github.com/bitcoin-core/guix.sigs/tree/main/builder-keys
|
||||
builderKeys ? [
|
||||
"152812300785C96444D3334D17565732E08E5E41" # achow101.gpg
|
||||
"9EDAFF80E080659604F4A76B2EBB056FD847F8A7" # Emzy.gpg
|
||||
"71A3B16735405025D447E8F274810B012346C9A6" # laanwj.gpg
|
||||
"6B002C6EA3F91B1B0DF0C9BC8F617F1200A6D25C" # glozow.gpg
|
||||
"D1DBF2C4B96F2DEBF4C16654410108112E7EA81F" # hebasto.gpg
|
||||
],
|
||||
}:
|
||||
|
||||
let
|
||||
desktop = fetchurl {
|
||||
# c2e5f3e is the last commit when the debian/bitcoin-qt.desktop file was changed
|
||||
url = "https://raw.githubusercontent.com/bitcoin-core/packaging/c2e5f3e20a8093ea02b73cbaf113bc0947b4140e/debian/bitcoin-qt.desktop";
|
||||
sha256 = "0cpna0nxcd1dw3nnzli36nf9zj28d2g9jf5y0zl9j18lvanvniha";
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = if withGui then "bitcoin" else "bitcoind";
|
||||
version = "29.2";
|
||||
|
||||
src = fetchurl {
|
||||
urls = [
|
||||
"https://bitcoincore.org/bin/bitcoin-core-${finalAttrs.version}/bitcoin-${finalAttrs.version}.tar.gz"
|
||||
];
|
||||
# hash retrieved from signed SHA256SUMS
|
||||
sha256 = "sha256-pSnXXQUSMX1jNLuf10y23co7HrNF0unjG2YTZYPswEU=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
pkg-config
|
||||
installShellFiles
|
||||
gnupg
|
||||
]
|
||||
++ lib.optionals withGui [ wrapQtAppsHook ];
|
||||
|
||||
buildInputs = [
|
||||
boost
|
||||
libevent
|
||||
zeromq
|
||||
zlib
|
||||
]
|
||||
++ lib.optionals enableTracing [ libsystemtap ]
|
||||
++ lib.optionals withWallet [ sqlite ]
|
||||
# building with db48 (for legacy descriptor wallet support) is broken on Darwin
|
||||
++ lib.optionals (withWallet && !stdenv.hostPlatform.isDarwin) [ db48 ]
|
||||
++ lib.optionals withGui [
|
||||
qrencode
|
||||
qtbase
|
||||
qttools
|
||||
];
|
||||
|
||||
preUnpack =
|
||||
let
|
||||
publicKeys = fetchFromGitHub {
|
||||
owner = "bitcoin-core";
|
||||
repo = "guix.sigs";
|
||||
rev = "a788388207bd244d5ab07b31ecd6c126f213a6c6";
|
||||
sha256 = "sha256-gbenuEWP6pqY9ywPd/yZy6QfWI7jvSObwto27DRXjGI=";
|
||||
};
|
||||
|
||||
checksums = fetchurl {
|
||||
url = "https://bitcoincore.org/bin/bitcoin-core-${finalAttrs.version}/SHA256SUMS";
|
||||
hash = "sha256-siFBow5riZNg6LsMXpJc3u0txCGKJJCy24Cmm0TbvDM=";
|
||||
};
|
||||
|
||||
signatures = fetchurl {
|
||||
url = "https://bitcoincore.org/bin/bitcoin-core-${finalAttrs.version}/SHA256SUMS.asc";
|
||||
hash = "sha256-pUBsfT9BvsTIqxAA9CSp1Z8K8RQpi1e00ssEa2il8CQ=";
|
||||
};
|
||||
|
||||
verifyBuilderKeys =
|
||||
let
|
||||
script = publicKey: ''
|
||||
echo "Checking if public key ${publicKey} signed the checksum file..."
|
||||
grep "^\[GNUPG:\] VALIDSIG .* ${publicKey}$" verify.log > /dev/null
|
||||
echo "OK"
|
||||
'';
|
||||
in
|
||||
builtins.concatStringsSep "\n" (map script builderKeys);
|
||||
in
|
||||
''
|
||||
pushd $(mktemp -d)
|
||||
export GNUPGHOME=$PWD/gnupg
|
||||
mkdir -m 700 -p $GNUPGHOME
|
||||
gpg --no-autostart --batch --import ${publicKeys}/builder-keys/*
|
||||
ln -s ${checksums} ./SHA256SUMS
|
||||
ln -s ${signatures} ./SHA256SUMS.asc
|
||||
ln -s $src ./bitcoin-${finalAttrs.version}.tar.gz
|
||||
gpg --no-autostart --batch --verify --status-fd 1 SHA256SUMS.asc SHA256SUMS > verify.log
|
||||
${verifyBuilderKeys}
|
||||
echo "Checking ${checksums} for bitcoin-${finalAttrs.version}.tar.gz..."
|
||||
grep bitcoin-${finalAttrs.version}.tar.gz SHA256SUMS > SHA256SUMS.filtered
|
||||
echo "Verifying the checksum of bitcoin-${finalAttrs.version}.tar.gz..."
|
||||
sha256sum -c SHA256SUMS.filtered
|
||||
popd
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
cd ..
|
||||
installShellCompletion --bash contrib/completions/bash/bitcoin-cli.bash
|
||||
installShellCompletion --bash contrib/completions/bash/bitcoind.bash
|
||||
installShellCompletion --bash contrib/completions/bash/bitcoin-tx.bash
|
||||
|
||||
installShellCompletion --fish contrib/completions/fish/bitcoin-cli.fish
|
||||
installShellCompletion --fish contrib/completions/fish/bitcoind.fish
|
||||
installShellCompletion --fish contrib/completions/fish/bitcoin-tx.fish
|
||||
installShellCompletion --fish contrib/completions/fish/bitcoin-util.fish
|
||||
installShellCompletion --fish contrib/completions/fish/bitcoin-wallet.fish
|
||||
''
|
||||
+ lib.optionalString withGui ''
|
||||
installShellCompletion --fish contrib/completions/fish/bitcoin-qt.fish
|
||||
|
||||
install -Dm644 ${desktop} $out/share/applications/bitcoin-qt.desktop
|
||||
substituteInPlace $out/share/applications/bitcoin-qt.desktop --replace "Icon=bitcoin128" "Icon=bitcoin"
|
||||
install -Dm644 share/pixmaps/bitcoin256.png $out/share/pixmaps/bitcoin.png
|
||||
'';
|
||||
|
||||
cmakeFlags = [
|
||||
(lib.cmakeBool "BUILD_BENCH" false)
|
||||
(lib.cmakeBool "WITH_ZMQ" true)
|
||||
# building with db48 (for legacy wallet support) is broken on Darwin
|
||||
(lib.cmakeBool "WITH_BDB" (withWallet && !stdenv.hostPlatform.isDarwin))
|
||||
(lib.cmakeBool "WITH_USDT" enableTracing)
|
||||
]
|
||||
++ lib.optionals (!finalAttrs.doCheck) [
|
||||
(lib.cmakeBool "BUILD_TESTS" false)
|
||||
(lib.cmakeBool "BUILD_FUZZ_BINARY" false)
|
||||
(lib.cmakeBool "BUILD_GUI_TESTS" false)
|
||||
]
|
||||
++ lib.optionals (!withWallet) [
|
||||
(lib.cmakeBool "ENABLE_WALLET" false)
|
||||
]
|
||||
++ lib.optionals withGui [
|
||||
(lib.cmakeBool "BUILD_GUI" true)
|
||||
];
|
||||
|
||||
NIX_LDFLAGS = lib.optionals (
|
||||
stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic
|
||||
) "-levent_core";
|
||||
|
||||
nativeCheckInputs = [ python3 ];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
checkFlags = [
|
||||
"LC_ALL=en_US.UTF-8"
|
||||
]
|
||||
# QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Bitcoin's GUI.
|
||||
# See also https://github.com/NixOS/nixpkgs/issues/24256
|
||||
++ lib.optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
__darwinAllowLocalNetworking = true;
|
||||
|
||||
nativeInstallCheckInputs = [
|
||||
versionCheckHook
|
||||
];
|
||||
versionCheckProgram = "${placeholder "out"}/bin/bitcoin-cli";
|
||||
versionCheckProgramArg = "--version";
|
||||
doInstallCheck = true;
|
||||
|
||||
passthru.tests = {
|
||||
smoke-test = nixosTests.bitcoind;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Peer-to-peer electronic cash system";
|
||||
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://bitcoin.org/en/";
|
||||
downloadPage = "https://bitcoincore.org/bin/bitcoin-core-${finalAttrs.version}/";
|
||||
changelog = "https://bitcoincore.org/en/releases/${finalAttrs.version}/";
|
||||
maintainers = with lib.maintainers; [
|
||||
prusnak
|
||||
roconnor
|
||||
];
|
||||
license = lib.licenses.mit;
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
})
|
||||
@@ -1,76 +0,0 @@
|
||||
pkgs: nbPython3Packages:
|
||||
|
||||
let
|
||||
inherit (pkgs) lib;
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "lightningd";
|
||||
repo = "plugins";
|
||||
rev = "c0ba9dc3273923c427053eec0c343776793a81c0";
|
||||
sha256 = "1hdiikm8m3azd16fpgcbj7fcg1d7f8l4kvj1763vikg85khzlrcv";
|
||||
};
|
||||
|
||||
version = builtins.substring 0 7 src.rev;
|
||||
|
||||
plugins = with nbPython3Packages; {
|
||||
currencyrate = {
|
||||
description = "Currency rate fetcher and converter";
|
||||
extraPkgs = [ requests cachetools ];
|
||||
};
|
||||
feeadjuster = {
|
||||
description = "Dynamically changes channel fees to keep your channels more balanced";
|
||||
};
|
||||
monitor = {
|
||||
description = "Helps you analyze the health of your peers and channels";
|
||||
extraPkgs = [ packaging ];
|
||||
};
|
||||
rebalance = {
|
||||
description = "Keeps your channels balanced";
|
||||
};
|
||||
zmq = {
|
||||
description = "Publishes notifications via ZeroMQ to configured endpoints";
|
||||
scriptName = "cl-zmq";
|
||||
extraPkgs = [ twisted txzmq ];
|
||||
};
|
||||
};
|
||||
|
||||
basePkgs = [ nbPython3Packages.pyln-client ];
|
||||
|
||||
mkPlugin = name: plugin: let
|
||||
python = pkgs.python3.withPackages (_: basePkgs ++ (plugin.extraPkgs or []));
|
||||
script = "${plugin.scriptName or name}.py";
|
||||
drv = pkgs.stdenv.mkDerivation {
|
||||
pname = "clightning-plugin-${name}";
|
||||
inherit version;
|
||||
|
||||
buildInputs = [ python ];
|
||||
|
||||
buildCommand = ''
|
||||
cp --no-preserve=mode -r '${src}/${name}' "$out"
|
||||
cd "$out"
|
||||
${lib.optionalString (plugin ? patchRequirements) ''
|
||||
substituteInPlace requirements.txt ${plugin.patchRequirements}
|
||||
''}
|
||||
|
||||
# Check that requirements are met
|
||||
PYTHONPATH='${toString python}/${python.sitePackages}' \
|
||||
${pkgs.python3Packages.pip}/bin/pip install -r requirements.txt --no-cache --no-index --break-system-packages
|
||||
|
||||
chmod +x '${script}'
|
||||
patchShebangs '${script}'
|
||||
'';
|
||||
|
||||
passthru.path = "${drv}/${script}";
|
||||
|
||||
meta = with lib; {
|
||||
inherit (plugin) description;
|
||||
homepage = "https://github.com/lightningd/plugins";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ nixbitcoin erikarvstedt ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
};
|
||||
in drv;
|
||||
|
||||
in
|
||||
builtins.mapAttrs mkPlugin plugins
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
. "${BASH_SOURCE[0]%/*}/../../helper/run-in-nix-env" "git" "$@"
|
||||
|
||||
archive_hash () {
|
||||
repo=$1
|
||||
rev=$2
|
||||
nix-prefetch-url --unpack "https://github.com/${repo}/archive/${rev}.tar.gz" 2> /dev/null | tail -n 1
|
||||
}
|
||||
|
||||
echo "Fetching latest lightningd/plugins release"
|
||||
latest=$(git ls-remote https://github.com/lightningd/plugins master | cut -f 1)
|
||||
echo "rev = \"${latest}\";"
|
||||
echo "sha256 = \"$(archive_hash lightningd/plugins "$latest")\";"
|
||||
@@ -1,55 +0,0 @@
|
||||
{ lib
|
||||
, stdenvNoCC
|
||||
, nodejs_22
|
||||
, nodejs-slim_22
|
||||
, fetchNodeModules
|
||||
, fetchurl
|
||||
, makeWrapper
|
||||
, rsync
|
||||
}:
|
||||
let self = stdenvNoCC.mkDerivation {
|
||||
pname = "clightning-rest";
|
||||
version = "0.10.7";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/Ride-The-Lightning/c-lightning-REST/archive/refs/tags/v${self.version}.tar.gz";
|
||||
hash = "sha256-m/djMQk+g994GaTW/yysD/eVgWcqY8cap41tot0UElI=";
|
||||
};
|
||||
|
||||
passthru = {
|
||||
nodejs = nodejs_22;
|
||||
nodejsRuntime = nodejs-slim_22;
|
||||
|
||||
nodeModules = fetchNodeModules {
|
||||
inherit (self) src nodejs;
|
||||
hash = "sha256-Dz4/kR4X34idfuPFFQJYE8yGIR3OSseDnkAhqbZ6iEI=";
|
||||
};
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
phases = "unpackPhase patchPhase installPhase";
|
||||
|
||||
installPhase = ''
|
||||
dest=$out/lib/node_modules/clightning-rest
|
||||
mkdir -p $dest
|
||||
${rsync}/bin/rsync -a --inplace * ${self.nodeModules}/lib/node_modules \
|
||||
--exclude=/{screenshots,'*.Dockerfile'} \
|
||||
$dest
|
||||
|
||||
makeWrapper ${self.nodejsRuntime}/bin/node "$out/bin/cl-rest" \
|
||||
--add-flags "$dest/cl-rest.js"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "REST API for C-Lightning";
|
||||
homepage = "https://github.com/Ride-The-Lightning/c-lightning-REST";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ nixbitcoin erikarvstedt ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}; in self
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
. "${BASH_SOURCE[0]%/*}/../../helper/run-in-nix-env" "gnupg wget gnused" "$@"
|
||||
|
||||
version="0.10.7"
|
||||
repo=https://github.com/Ride-The-Lightning/c-lightning-REST
|
||||
|
||||
scriptDir=$(cd "${BASH_SOURCE[0]%/*}" && pwd)
|
||||
|
||||
updateSrc() {
|
||||
TMPDIR=$(mktemp -d /tmp/clightning-rest.XXX)
|
||||
trap 'rm -rf $TMPDIR' EXIT
|
||||
|
||||
# Fetch and verify source tarball
|
||||
export GNUPGHOME=$TMPDIR
|
||||
# Fetch saubyk's key
|
||||
gpg --keyserver hkps://keyserver.ubuntu.com --recv-key 3E9BD4436C288039CA827A9200C9E2BC2E45666F
|
||||
file=v${version}.tar.gz
|
||||
wget -P "$TMPDIR" "${repo}/archive/refs/tags/${file}"
|
||||
wget -P "$TMPDIR" "${repo}/releases/download/v${version}/${file}.asc"
|
||||
gpg --verify "${TMPDIR}/${file}.asc" "${TMPDIR}/${file}"
|
||||
hash=$(nix hash file "${TMPDIR}/${file}")
|
||||
|
||||
sed -i "
|
||||
s|\bversion = .*;|version = \"$version\";|
|
||||
s|\bhash = .*;|hash = \"$hash\";|
|
||||
" default.nix
|
||||
}
|
||||
|
||||
updateNodeModulesHash() {
|
||||
"$scriptDir/../../helper/update-fixed-output-derivation.sh" ./default.nix clightning-rest.nodeModules nodeModules
|
||||
}
|
||||
|
||||
if [[ $# == 0 ]]; then
|
||||
# Each of these can be run separately
|
||||
updateSrc
|
||||
updateNodeModulesHash
|
||||
else
|
||||
"$@"
|
||||
fi
|
||||
@@ -1,50 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
clightning,
|
||||
unzip,
|
||||
protobuf,
|
||||
}:
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "clnrest";
|
||||
version = "0.2.0";
|
||||
|
||||
inherit (clightning) src;
|
||||
|
||||
cargoHash = "sha256-0rpr941QkDeNLQ6Se9+DbbVBCmGyU721a27XNzylpPw=";
|
||||
|
||||
depsExtraArgs = {
|
||||
nativeBuildInputs = [ unzip ];
|
||||
# Don't run `configure` of the main project build
|
||||
dontConfigure = true;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
# For unpacking the src
|
||||
unzip
|
||||
];
|
||||
|
||||
cargoBuildFlags = [ "--package clnrest" ];
|
||||
|
||||
nativeCheckInputs = [
|
||||
# Required by lightning/cln-grpc/build.rs
|
||||
protobuf
|
||||
];
|
||||
|
||||
# `core::lsps2::htlc::tests::polls_until_channel_ready` (in the `cln-lsps`
|
||||
# workspace member) is timing-dependent: it spawns a polling task, sleeps a
|
||||
# real 10 ms, then asserts the loop ran more than once. Under the parallel
|
||||
# test load in CI the spawned task gets starved and the assertion fails.
|
||||
# Skip this single upstream test; the remaining workspace tests still run.
|
||||
checkFlags = [ "--skip=polls_until_channel_ready" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "REST plugin for clightning";
|
||||
homepage = "https://github.com/ElementsProject/lightning/tree/master/plugins/rest-plugin";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [
|
||||
erikarvstedt
|
||||
];
|
||||
mainProgram = "clnrest";
|
||||
};
|
||||
}
|
||||
@@ -15,39 +15,15 @@ in
|
||||
}
|
||||
}:
|
||||
let self = {
|
||||
clightning-rest = pkgs.callPackage ./clightning-rest { inherit (self) fetchNodeModules; };
|
||||
clightning-plugins = pkgs.lib.recurseIntoAttrs (import ./clightning-plugins pkgs self.nbPython3Packages);
|
||||
clnrest = pkgs.callPackage ./clnrest { inherit (self.pinned) clightning; };
|
||||
joinmarket = pkgs.callPackage ./joinmarket { inherit (self) nbPython3PackagesJoinmarket; };
|
||||
lndinit = pkgs.callPackage ./lndinit { };
|
||||
liquid-swap = pkgs.python3Packages.callPackage ./liquid-swap { };
|
||||
nbxplorer = pkgs.callPackage ./nbxplorer { };
|
||||
rtl = pkgs.callPackage ./rtl { inherit (self) fetchNodeModules; };
|
||||
inherit (pkgs.callPackage ./mempool { inherit (self) fetchNodeModules; })
|
||||
mempool-backend
|
||||
mempool-frontend
|
||||
mempool-rust-gbt
|
||||
mempool-nginx-conf;
|
||||
trustedcoin = pkgs.callPackage ./trustedcoin { };
|
||||
|
||||
bitcoind_29 = pkgs.callPackage ./bitcoind_29 {};
|
||||
inherit (self.pyPkgs.nbPython3PackagesWithUnlockedEcdsa) hwi;
|
||||
|
||||
pyPkgs = import ./python-packages self pkgs.python3;
|
||||
inherit (self.pyPkgs)
|
||||
nbPython3Packages
|
||||
nbPython3PackagesJoinmarket;
|
||||
|
||||
fetchNodeModules = pkgs.callPackage ./build-support/fetch-node-modules.nix { };
|
||||
|
||||
# Internal pkgs
|
||||
netns-exec = pkgs.callPackage ./netns-exec { };
|
||||
krops = import ./krops { inherit pkgs; };
|
||||
|
||||
# Deprecated pkgs
|
||||
generate-secrets = import ./generate-secrets-deprecated.nix;
|
||||
nixops19_09 = pkgs.callPackage ./nixops { };
|
||||
|
||||
pinned = import ./pinned.nix pkgs pkgsUnstable pkgs-25_05;
|
||||
|
||||
modulesPkgs = self // self.pinned;
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
throw ''
|
||||
Please update the `shell.nix` of your node configuration.
|
||||
|
||||
To update, do the following:
|
||||
1. Switch to the directory containing your `configuration.nix` and `shell.nix`.
|
||||
2. Run the following Bash expression (Warning: This overwrites your `shell.nix`):
|
||||
|
||||
# Only update nix-bitcoin-release.nix if it contains a release hash
|
||||
if grep -q sha256 nix-bitcoin-release.nix; then
|
||||
${toString ../helper/fetch-release} > nix-bitcoin-release.nix && cp ${toString ../examples/shell.nix} .
|
||||
else
|
||||
cp ${toString ../examples/shell.nix} .
|
||||
fi
|
||||
|
||||
Note to NixOps users:
|
||||
- After updating `shell.nix`, secrets are no longer auto-generated
|
||||
when starting the shell. Please manually run shell command `generate-secrets`
|
||||
before deploying.
|
||||
- NixOps version 19.09 that shipped with nix-bitcoin is deprecated and is no longer
|
||||
available in the shell.
|
||||
Instead, you can add a current NixOps version to your shell PATH via `extraShellInitCmds`
|
||||
or migrate to the krops deployment method.
|
||||
See here for a migration guide:
|
||||
${toString ../docs/nixops-krops-migration.md}
|
||||
''
|
||||
@@ -1,68 +0,0 @@
|
||||
{ stdenv, lib, fetchFromGitHub, nbPython3PackagesJoinmarket }:
|
||||
|
||||
let
|
||||
# Note:
|
||||
# After updating this pkg, also update the following items in ../../modules/joinmarket.nix:
|
||||
# - The `MESSAGING:*` sections in the config value of option `settings`.
|
||||
# Copy the values from `jmclient/configure.py`.
|
||||
version = "0.9.11";
|
||||
src = fetchFromGitHub {
|
||||
owner = "joinmarket-org";
|
||||
repo = "joinmarket-clientserver";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-sYHhhp9BZz8udJuVAfwdt474OQPiye2ae5DOn5v5yEQ=";
|
||||
};
|
||||
|
||||
runtimePackages = with nbPython3PackagesJoinmarket; [
|
||||
joinmarket
|
||||
matplotlib # for ob-watcher
|
||||
];
|
||||
|
||||
pythonEnv = nbPython3PackagesJoinmarket.python.withPackages (_: runtimePackages);
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "joinmarket";
|
||||
inherit version src;
|
||||
|
||||
buildInputs = [ pythonEnv ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p "$out/bin"
|
||||
|
||||
# add-utxo.py -> bin/jm-add-utxo
|
||||
cpBin() {
|
||||
cp "scripts/$1" "$out/bin/jm-''${1%.py}"
|
||||
}
|
||||
|
||||
cp scripts/joinmarketd.py "$out/bin/joinmarketd"
|
||||
cpBin add-utxo.py
|
||||
cpBin receive-payjoin.py
|
||||
cpBin sendpayment.py
|
||||
cpBin sendtomany.py
|
||||
cpBin tumbler.py
|
||||
cpBin wallet-tool.py
|
||||
cpBin yg-privacyenhanced.py
|
||||
cpBin genwallet.py
|
||||
cpBin bond-calculator.py
|
||||
|
||||
chmod +x -R "$out/bin"
|
||||
patchShebangs "$out/bin"
|
||||
|
||||
## ob-watcher
|
||||
obw=$out/libexec/joinmarket-ob-watcher
|
||||
install -D scripts/obwatch/ob-watcher.py "$obw/ob-watcher"
|
||||
patchShebangs "$obw/ob-watcher"
|
||||
ln -s "$obw/ob-watcher" "$out/bin/jm-ob-watcher"
|
||||
|
||||
# These files must be placed in the same dir as ob-watcher
|
||||
cp -r scripts/obwatch/{orderbook.html,sybil_attack_calculations.py,vendor} "$obw"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Bitcoin CoinJoin implementation";
|
||||
homepage = "https://github.com/JoinMarket-Org/joinmarket-clientserver";
|
||||
license = licenses.gpl3Only;
|
||||
maintainers = with maintainers; [ seberm nixbitcoin ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p git gnupg jq
|
||||
|
||||
set -euo pipefail
|
||||
newVersion=$(curl -s "https://api.github.com/repos/joinmarket-org/joinmarket-clientserver/releases" | jq -r '.[0].tag_name')
|
||||
|
||||
# Fetch release and GPG-verify the content hash
|
||||
tmpdir=$(mktemp -d /tmp/joinmarket-verify-gpg.XXX)
|
||||
repo=$tmpdir/repo
|
||||
git clone --depth 1 --branch "${newVersion}" -c advice.detachedHead=false https://github.com/joinmarket-org/joinmarket-clientserver "$repo"
|
||||
export GNUPGHOME=$tmpdir
|
||||
echo "Fetching Adam Gibson's key"
|
||||
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 2B6FC204D9BF332D062B461A141001A1AF77F20B 2> /dev/null
|
||||
echo "Fetch Kristaps Kaupe's key"
|
||||
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 70A1D47DD44F59DF8B22244333E472FE870C7E5D 2> /dev/null
|
||||
echo
|
||||
echo "Verifying commit"
|
||||
git -C "$repo" verify-commit HEAD
|
||||
rm -rf "$repo"/.git
|
||||
newHash=$(nix hash path "$repo")
|
||||
rm -rf "$tmpdir"
|
||||
echo
|
||||
|
||||
echo "tag: $newVersion"
|
||||
echo "hash: $newHash"
|
||||
@@ -1,15 +0,0 @@
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
let
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://cgit.krebsco.de/krops";
|
||||
rev = "1.26.2";
|
||||
sha256 = "0mzn213dh3pklvdzfpwi4nin4lncdap447zvl11j81r809jll76j";
|
||||
};
|
||||
in {
|
||||
lib = import "${src}/lib";
|
||||
pkgs = rec {
|
||||
krops = pkgs.callPackage "${src}/pkgs/krops" { inherit populate; };
|
||||
populate = pkgs.callPackage "${src}/pkgs/populate" {};
|
||||
};
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
. "${BASH_SOURCE[0]%/*}/../../helper/run-in-nix-env" "git" "$@"
|
||||
|
||||
archive_hash () {
|
||||
repo=$1
|
||||
rev=$2
|
||||
nix-prefetch-url --unpack "https://github.com/${repo}/archive/${rev}.tar.gz" 2> /dev/null
|
||||
}
|
||||
|
||||
echo "Fetching latest version"
|
||||
version=$(
|
||||
git ls-remote --tags https://github.com/krebs/krops | cut -f 2 \
|
||||
| sed -E 's|refs/tags/||g; s|((v)?(.*))|\1 \3|g' | sort -k 2 -V | tail -1 | cut -f 1 -d' '
|
||||
)
|
||||
echo "rev: ${version}"
|
||||
echo "sha256: $(archive_hash krebs/krops "$version")"
|
||||
@@ -87,13 +87,6 @@ let self = {
|
||||
# Used for ExecStart*
|
||||
rootScript = name: src: "+${self.script name src}";
|
||||
|
||||
cliExec = mkOption {
|
||||
# Used by netns-isolation to execute the cli in the service's private netns
|
||||
internal = true;
|
||||
type = types.str;
|
||||
default = "exec";
|
||||
};
|
||||
|
||||
mkOnionService = map: {
|
||||
map = [ map ];
|
||||
version = 3;
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
{ lib, buildPythonPackage, fetchurl, click }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "liquid-swap";
|
||||
version = "0.0.2";
|
||||
format = "setuptools";
|
||||
|
||||
propagatedBuildInputs = [ click ];
|
||||
|
||||
src = fetchurl {
|
||||
urls = [ "https://github.com/Blockstream/liquid-swap/archive/release_${version}.tar.gz" ];
|
||||
sha256 = "9fa920ee7d03d1af8252131cd7d5a825bb66b8ad536403b4f5437ff6c91a68b1";
|
||||
};
|
||||
# Not sure if this does anything, but it should
|
||||
installFlags = [ ".[CLI]" ];
|
||||
# The tests unfortunately seem to require the PyQt for the GUI
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Swap issued assets on the Liquid network using confidential transactions";
|
||||
homepage = "https://github.com/Blockstream/liquid-swap";
|
||||
license = licenses.gpl3Only;
|
||||
maintainers = with maintainers; [ nixbitcoin ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
buildDotnetModule,
|
||||
fetchFromGitHub,
|
||||
dotnetCorePackages,
|
||||
}:
|
||||
buildDotnetModule rec {
|
||||
pname = "nbxplorer";
|
||||
version = "2.6.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dgarage";
|
||||
repo = "NBXplorer";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-fA8Gv0Qc/+a8trLchXsawNk/4AdWjJCnzrwd8+rrJbw=";
|
||||
};
|
||||
|
||||
projectFile = "NBXplorer/NBXplorer.csproj";
|
||||
nugetDeps = ./deps.json;
|
||||
|
||||
dotnet-sdk = dotnetCorePackages.sdk_10_0;
|
||||
dotnet-runtime = dotnetCorePackages.aspnetcore_10_0;
|
||||
|
||||
# macOS has a case-insensitive filesystem, so these two can be the same file
|
||||
postFixup = ''
|
||||
mv $out/bin/{NBXplorer,nbxplorer} || :
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Minimalist UTXO tracker for HD Cryptocurrency Wallets";
|
||||
maintainers = with maintainers; [
|
||||
kcalvinalvin
|
||||
erikarvstedt
|
||||
];
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
mainProgram = "nbxplorer";
|
||||
};
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
[
|
||||
{
|
||||
"pname": "Dapper",
|
||||
"version": "2.1.72",
|
||||
"hash": "sha256-9CKyz72/Vp5/GIoxJzl7RAXTj4MvKTgFi/7fGyhRqf4="
|
||||
},
|
||||
{
|
||||
"pname": "Microsoft.AspNetCore.JsonPatch",
|
||||
"version": "10.0.6",
|
||||
"hash": "sha256-yHK65u+3vBf3mxXuRybwuZN2CXhvN7lIdi/uDh7T/Lw="
|
||||
},
|
||||
{
|
||||
"pname": "Microsoft.AspNetCore.Mvc.NewtonsoftJson",
|
||||
"version": "10.0.6",
|
||||
"hash": "sha256-hfL+FsI6CU2d6Z+Q1a1c+6gBgF4iV66fq25k8tEZQvs="
|
||||
},
|
||||
{
|
||||
"pname": "Microsoft.Extensions.Logging.Abstractions",
|
||||
"version": "1.0.0",
|
||||
"hash": "sha256-asIXVFsAK7ELd/f+vLwhxYDdazqRTmf+fGJ4WFtcCeo="
|
||||
},
|
||||
{
|
||||
"pname": "NBitcoin",
|
||||
"version": "10.0.1",
|
||||
"hash": "sha256-LdxZgCZNaVKpc5aZXVoM63LIzNM+zvf+Cg2c0nxjtCE="
|
||||
},
|
||||
{
|
||||
"pname": "NBitcoin",
|
||||
"version": "10.0.3",
|
||||
"hash": "sha256-jX5gKpVucJiIAs42UtbCl8Qt05WN/NVBQFWg85nIa5M="
|
||||
},
|
||||
{
|
||||
"pname": "NBitcoin.Altcoins",
|
||||
"version": "6.0.3",
|
||||
"hash": "sha256-U6xigLzDH9TpA6XkLTJRVBsL2OsaYjTD5evaVJ9NP7g="
|
||||
},
|
||||
{
|
||||
"pname": "NETStandard.Library.Ref",
|
||||
"version": "2.1.0",
|
||||
"hash": "sha256-Ruovy9EKgXaFuFr3zgw5fRKUS9yBIJ4nLeHgXv0zx4o="
|
||||
},
|
||||
{
|
||||
"pname": "Newtonsoft.Json",
|
||||
"version": "12.0.1",
|
||||
"hash": "sha256-4Xf3RZrJomAh3jaZrEAJX3oPmOowGV8yDB9Y3h0Dw4U="
|
||||
},
|
||||
{
|
||||
"pname": "Newtonsoft.Json",
|
||||
"version": "13.0.1",
|
||||
"hash": "sha256-K2tSVW4n4beRPzPu3rlVaBEMdGvWSv/3Q1fxaDh4Mjo="
|
||||
},
|
||||
{
|
||||
"pname": "Newtonsoft.Json",
|
||||
"version": "13.0.3",
|
||||
"hash": "sha256-hy/BieY4qxBWVVsDqqOPaLy1QobiIapkbrESm6v2PHc="
|
||||
},
|
||||
{
|
||||
"pname": "Newtonsoft.Json.Bson",
|
||||
"version": "1.0.2",
|
||||
"hash": "sha256-ZUj6YFSMZp5CZtXiamw49eZmbp1iYBuNsIKNnjxcRzA="
|
||||
},
|
||||
{
|
||||
"pname": "NicolasDorier.CommandLine",
|
||||
"version": "2.0.0",
|
||||
"hash": "sha256-LizYyIMx6I17jZd52duYcGWNgcPs88c/zWxo/ADd3D8="
|
||||
},
|
||||
{
|
||||
"pname": "NicolasDorier.CommandLine.Configuration",
|
||||
"version": "2.0.0",
|
||||
"hash": "sha256-fDpDOVdt7xCDXXqaBnbaFvUOPaE0Sl4cLWjNkU0Cz7I="
|
||||
},
|
||||
{
|
||||
"pname": "NicolasDorier.StandardConfiguration",
|
||||
"version": "2.0.1",
|
||||
"hash": "sha256-PdNopObnA2hOiHomejN/ZYK2CK1aGXMuOnsjHyS2Mco="
|
||||
},
|
||||
{
|
||||
"pname": "Npgsql",
|
||||
"version": "10.0.2",
|
||||
"hash": "sha256-hW03ZWoW7y16vvScwsjZNyqFybGy+s6hQYQXebo78yQ="
|
||||
}
|
||||
]
|
||||
@@ -1,10 +0,0 @@
|
||||
{ stdenv, pkgs }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "netns-exec";
|
||||
buildInputs = [ pkgs.libcap ];
|
||||
src = ./src;
|
||||
installPhase = ''
|
||||
cp main "$out"
|
||||
'';
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
main: main.c
|
||||
gcc -lcap -o main main.c
|
||||
@@ -1,79 +0,0 @@
|
||||
/* This program requires CAP_SYS_ADMIN */
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <sched.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/capability.h>
|
||||
|
||||
static char *allowed_netns[] = {
|
||||
"nb-joinmarket"
|
||||
};
|
||||
|
||||
int is_netns_allowed(char *netns) {
|
||||
int n_allowed_netns = sizeof(allowed_netns) / sizeof(allowed_netns[0]);
|
||||
for (int i = 0; i < n_allowed_netns; i++) {
|
||||
if (strcmp(allowed_netns[i], netns) == 0) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void print_capabilities() {
|
||||
cap_t caps = cap_get_proc();
|
||||
printf("Capabilities: %s\n", cap_to_text(caps, NULL));
|
||||
cap_free(caps);
|
||||
}
|
||||
|
||||
void drop_capabilities() {
|
||||
cap_t caps = cap_get_proc();
|
||||
cap_clear(caps);
|
||||
cap_set_proc(caps);
|
||||
cap_free(caps);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char netns_path[256];
|
||||
|
||||
if (argc < 3) {
|
||||
printf("usage: %s <netns> <command>\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!is_netns_allowed(argv[1])) {
|
||||
printf("%s is not an allowed netns.\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(snprintf(netns_path, sizeof(netns_path), "/var/run/netns/%s", argv[1]) < 0) {
|
||||
printf("Path length exceeded for netns %s.\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int fd = open(netns_path, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
printf("Failed opening netns %s: %d, %s \n", netns_path, errno, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (setns(fd, CLONE_NEWNET) < 0) {
|
||||
printf("Failed setns %d, %s \n", errno, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Drop capabilities */
|
||||
#ifdef DEBUG
|
||||
print_capabilities();
|
||||
#endif
|
||||
drop_capabilities();
|
||||
#ifdef DEBUG
|
||||
print_capabilities();
|
||||
#endif
|
||||
|
||||
execvp(argv[2], &argv[2]);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
# An updated version of nixops that's compatible with machines running NixOS 19.09.
|
||||
# 19.09 demands a suitable base image (defined in nixops-vbox/nix/virtualbox.nix) to
|
||||
# start the virtualbox guest service during system activation.
|
||||
|
||||
{ pkgs, stdenv, runCommand, fetchFromGitHub }:
|
||||
|
||||
let
|
||||
pluginData = {
|
||||
aws = {
|
||||
owner = "nixos";
|
||||
repo = "nixops-aws";
|
||||
rev= "v1.0.0";
|
||||
sha256 = "1if6spscsgd6ckivgvbqza5fvvn5hbafi1n8q0fw98s3xpz2hjfm";
|
||||
};
|
||||
hetzner = {
|
||||
owner = "nixos";
|
||||
repo = "nixops-hetzner";
|
||||
rev = "v1.0.0";
|
||||
sha256 = "0cxfjpk2daczv3m7q5bsgfvd30qgmm1y7dnvz6nd7s7l7l0gsvas";
|
||||
};
|
||||
vbox = {
|
||||
owner = "nix-community";
|
||||
repo = "nixops-vbox";
|
||||
rev = "bff6054ce9e7f5f9aa830617577f1a511a461063";
|
||||
sha256 = "0j0lbi8rqmw17ji367zh94lvlb062iiyavl4l7m851v40wqr8a5i";
|
||||
};
|
||||
};
|
||||
|
||||
origSrc = fetchFromGitHub {
|
||||
owner = "NixOS";
|
||||
repo = "nixops";
|
||||
rev = "2434bf26e0bba49441041ffce36dc324f049bc00";
|
||||
sha256 = "0ag05pjwwqdw8in49hr8m8bdg31xsgqs1cawcqyh6a5lsys7f6zg";
|
||||
};
|
||||
|
||||
src = runCommand "src" {} ''
|
||||
cp --no-preserve=mode -r '${origSrc}' "$out"
|
||||
cd "$out"
|
||||
patch -p1 < ${./release.nix.patch}
|
||||
'';
|
||||
|
||||
nixopsRelease = import "${src}/release.nix" {
|
||||
nixpkgs = pkgs.path;
|
||||
inherit pluginData;
|
||||
p = (p: with p; [ aws hetzner vbox ]);
|
||||
};
|
||||
in
|
||||
nixopsRelease.build.${builtins.currentSystem}
|
||||
@@ -1,67 +0,0 @@
|
||||
--- a/release.nix
|
||||
+++ b/release.nix
|
||||
@@ -1,6 +1,7 @@
|
||||
{ nixopsSrc ? { outPath = ./.; revCount = 0; shortRev = "abcdef"; rev = "HEAD"; }
|
||||
, officialRelease ? false
|
||||
, nixpkgs ? <nixpkgs>
|
||||
+, pluginData
|
||||
, p ? (p: [ ])
|
||||
}:
|
||||
|
||||
@@ -10,11 +11,10 @@ let
|
||||
|
||||
allPlugins = let
|
||||
plugins = let
|
||||
- allPluginVers = import ./data.nix;
|
||||
+ allPluginVers = pluginData;
|
||||
fetch = v:
|
||||
pkgs.fetchFromGitHub {
|
||||
- inherit (v) owner repo sha256;
|
||||
- rev = "v${v.version}";
|
||||
+ inherit (v) owner repo sha256 rev;
|
||||
};
|
||||
srcDrv = v: (fetch v) + "/release.nix";
|
||||
in self: let
|
||||
@@ -83,7 +83,7 @@
|
||||
# Remove annoying debug message that's shown in nix-shell while evaluating this file
|
||||
pysqlite
|
||||
typing
|
||||
pluggy
|
||||
- ] ++ pkgs.lib.traceValFn (x: "Using plugins: " + builtins.toJSON x) (map (d: d.build.${system}) (p allPlugins));
|
||||
+ ] ++ (map (d: d.build.${system}) (p allPlugins));
|
||||
|
||||
|
||||
# For "nix-build --run-env".
|
||||
|
||||
--- a/nixops/backends/__init__.py
|
||||
+++ b/nixops/backends/__init__.py
|
||||
@@ -24,6 +24,7 @@ class MachineDefinition(nixops.resources.ResourceDefinition):
|
||||
opts = {}
|
||||
for (key, xmlType) in (('text', 'string'),
|
||||
('keyFile', 'path'),
|
||||
+ ('keyFile', 'string'),
|
||||
('destDir', 'string'),
|
||||
('user', 'string'),
|
||||
('group', 'string'),
|
||||
--- a/nixops/ssh_util.py
|
||||
+++ b/nixops/ssh_util.py
|
||||
@@ -278,6 +278,7 @@ class SSH(object):
|
||||
|
||||
'timeout' specifies the SSH connection timeout.
|
||||
"""
|
||||
+ flags = shlex.split(os.getenv('NIXOPS_SSH_OPTS', '')) + flags
|
||||
master = self.get_master(flags, timeout, user)
|
||||
flags = flags + self._get_flags()
|
||||
if logged:
|
||||
|
||||
--- a/nixops/deployment.py
|
||||
+++ b/nixops/deployment.py
|
||||
@@ -748,6 +748,6 @@
|
||||
if res == 100 or force_reboot or m.state == m.RESCUE:
|
||||
if not allow_reboot and not force_reboot:
|
||||
raise Exception("the new configuration requires a "
|
||||
- "reboot to take effect (hint: use "
|
||||
+ "reboot of '{}' to take effect (hint: use "
|
||||
"‘--allow-reboot’)".format(m.name))
|
||||
m.reboot_sync()
|
||||
res = 0
|
||||
@@ -1,23 +0,0 @@
|
||||
{ lib, buildPythonPackage, fetchurl, cython, pytest, coverage }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "bencoder.pyx";
|
||||
version = "3.0.1";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/whtsky/bencoder.pyx/archive/9a47768f3ceba9df9e6fbaa7c445f59960889009.tar.gz";
|
||||
sha256 = "1yh565xjbbhn49xjfms80ac8psjbzn66n8dcx0x8mn7zzjv06clz";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cython ];
|
||||
|
||||
checkInputs = [ pytest coverage ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "A fast bencode implementation in Cython";
|
||||
homepage = "https://github.com/whtsky/bencoder.pyx";
|
||||
maintainers = with maintainers; [ seberm nixbitcoin ];
|
||||
license = licenses.bsd3;
|
||||
};
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
{ lib, buildPythonPackage, fetchFromGitHub, colorama, future, six }:
|
||||
buildPythonPackage rec {
|
||||
pname = "chromalog";
|
||||
version = "1.0.5";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "freelan-developers";
|
||||
repo = "chromalog";
|
||||
rev = version;
|
||||
sha256 = "0pj4s52rgwlvwkzrj85y92c5r9c84pz8gga45jl5spysrv41y9p0";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ colorama future six ];
|
||||
|
||||
# enable when https://github.com/freelan-developers/chromalog/issues/6 is resolved
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Enhance Python with colored logging";
|
||||
homepage = "https://github.com/freelan-developers/chromalog";
|
||||
maintainers = with maintainers; [ seberm nixbitcoin ];
|
||||
license = licenses.mit;
|
||||
};
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
nbPkgs: python3:
|
||||
rec {
|
||||
pyPkgsOverrides = self: super: let
|
||||
inherit (self) callPackage;
|
||||
clightningPkg = pkg: callPackage pkg { inherit (nbPkgs.pinned) clightning; };
|
||||
in
|
||||
{
|
||||
txzmq = callPackage ./txzmq {};
|
||||
pyln-client = clightningPkg ./pyln-client;
|
||||
pyln-proto = clightningPkg ./pyln-proto;
|
||||
pyln-bolt7 = clightningPkg ./pyln-bolt7;
|
||||
pylightning = clightningPkg ./pylightning;
|
||||
# TODO: Remove after 2026-05-09
|
||||
clnrest = throw "`nbPython3Packages.clnrest` has been replaced with nix-bitcoin pkg `clnrest` (Rust rewrite)";
|
||||
|
||||
# Packages only used by joinmarket
|
||||
bencoderpyx = callPackage ./bencoderpyx {};
|
||||
chromalog = callPackage ./chromalog {};
|
||||
python-bitcointx = callPackage ./python-bitcointx { inherit (self.pkgs) secp256k1; };
|
||||
runes = callPackage ./runes {};
|
||||
sha256 = callPackage ./sha256 {};
|
||||
|
||||
joinmarket = callPackage ./joinmarket { inherit (nbPkgs.joinmarket) version src; };
|
||||
};
|
||||
|
||||
nbPython3Packages = (python3.override {
|
||||
packageOverrides = pyPkgsOverrides;
|
||||
}).pkgs;
|
||||
|
||||
# joinmarket requires cython 3.0 via pkg bencoder.pyx.
|
||||
# The python pkgs from nixpkgs-25.11 default to cython 3.1.
|
||||
# Downgrading to 3.0 causes mass rebuilds, so we use python pkgs from nixpkgs-25.05 for joinmarket.
|
||||
# The nixpkgs-25.05 dependency will be removed with the next joinmarket update.
|
||||
# https://github.com/JoinMarket-Org/joinmarket-clientserver/issues/1787
|
||||
nbPython3PackagesJoinmarket =
|
||||
(nbPkgs.pinned.pkgs-25_05.python3.override {
|
||||
packageOverrides = self: super:
|
||||
(pyPkgsOverrides self super) // {
|
||||
## Specific versions of packages that already exist in nixpkgs
|
||||
|
||||
# autobahn 20.12.3, required by joinmarketclient
|
||||
autobahn = self.callPackage ./specific-versions/autobahn.nix {};
|
||||
};
|
||||
}).pkgs;
|
||||
|
||||
# Re-enable pkgs `hwi`, `trezor` that are unaffected by `CVE-2024-23342` because
|
||||
# they don't use python pkg `ecdsa` for signing.
|
||||
# These packages no longer evaluate in nixpkgs after `ecdsa` was tagged with this CVE.
|
||||
nbPython3PackagesWithUnlockedEcdsa = let
|
||||
python3PackagesWithUnlockedEcdsa = (python3.override {
|
||||
packageOverrides = self: super: {
|
||||
ecdsa = super.ecdsa.overrideAttrs (old: {
|
||||
meta = old.meta // {
|
||||
knownVulnerabilities = builtins.filter (x: x != "CVE-2024-23342") old.meta.knownVulnerabilities;
|
||||
};
|
||||
});
|
||||
};
|
||||
}).pkgs;
|
||||
in {
|
||||
hwi = with python3PackagesWithUnlockedEcdsa; toPythonApplication hwi;
|
||||
|
||||
# nixpkgs has keyring 25.6.0, but trezor 0.20.0 requires >= 25.7.0.
|
||||
# 25.7.0 only adds KWallet 6 support and removes Python 3.8 cruft,
|
||||
# so 25.6.0 is functionally equivalent for trezor's use.
|
||||
# Relax the constraint until nixpkgs updates keyring.
|
||||
trezor = python3PackagesWithUnlockedEcdsa.trezor.overridePythonAttrs (old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or []) ++ [
|
||||
python3PackagesWithUnlockedEcdsa.pythonRelaxDepsHook
|
||||
];
|
||||
pythonRelaxDeps = [ "keyring" ];
|
||||
});
|
||||
};
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
{ version
|
||||
, src
|
||||
, lib
|
||||
, buildPythonPackage
|
||||
, pythonOlder
|
||||
, pythonAtLeast
|
||||
, pytestCheckHook
|
||||
, setuptools
|
||||
, fetchurl
|
||||
, chromalog
|
||||
, cryptography
|
||||
, service-identity
|
||||
, twisted
|
||||
, txtorcon
|
||||
, python-bitcointx
|
||||
, argon2-cffi
|
||||
, autobahn
|
||||
, bencoderpyx
|
||||
, klein
|
||||
, mnemonic
|
||||
, pyjwt
|
||||
, werkzeug
|
||||
, libnacl
|
||||
, pyopenssl
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "joinmarket";
|
||||
inherit version src;
|
||||
format = "pyproject";
|
||||
|
||||
# Since v0.9.11, Python older than v3.8 is not supported.
|
||||
disabled = pythonOlder "3.8";
|
||||
|
||||
nativeBuildInputs = [
|
||||
setuptools
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
# base jm packages
|
||||
chromalog
|
||||
cryptography
|
||||
service-identity
|
||||
twisted
|
||||
txtorcon
|
||||
|
||||
# jmbitcoin
|
||||
python-bitcointx
|
||||
|
||||
# jmclient
|
||||
argon2-cffi
|
||||
autobahn
|
||||
bencoderpyx
|
||||
klein
|
||||
mnemonic
|
||||
pyjwt
|
||||
werkzeug
|
||||
|
||||
# jmdaemon
|
||||
libnacl
|
||||
pyopenssl
|
||||
];
|
||||
|
||||
# TODO-EXTERNAL:
|
||||
# Remove this when fixed upstream.
|
||||
#
|
||||
# Fix the following error during checkPhase:
|
||||
# File "/nix/store/...-python3.11-pytest-8.1.1/lib/python3.11/site-packages/_pytest/config/argparsing.py", line 133, in _getparser
|
||||
# arggroup.add_argument(*n, **a)
|
||||
# File "/nix/store/...-python3-3.11.9/lib/python3.11/argparse.py", line 1460, in add_argument
|
||||
# raise ValueError('%r is not callable' % (type_func,))
|
||||
# ValueError: 'int' is not callable
|
||||
patches = [ ./fix-conftest-arg-type-error.patch ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace-fail 'twisted==23.10.0' 'twisted==24.11.0' \
|
||||
--replace-fail 'service-identity==21.1.0' 'service-identity==24.2.0' \
|
||||
--replace-fail 'cryptography==41.0.6' 'cryptography==44.0.2' \
|
||||
--replace-fail 'txtorcon==23.11.0' 'txtorcon==24.8.0' \
|
||||
|
||||
# Modify pyproject.toml to include only specific modules. Do not include 'jmqtui'.
|
||||
sed -i '/^\[tool.setuptools.packages.find\]/a include = ["jmbase", "jmbitcoin", "jmclient", "jmdaemon"]' pyproject.toml
|
||||
'';
|
||||
|
||||
nativeCheckInputs = [
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
pytestFlagsArray = [
|
||||
"test/jmbase/"
|
||||
"test/jmbitcoin/"
|
||||
"test/jmdaemon/test_enc_wrapper.py"
|
||||
|
||||
# Other tests require preconfigured bitcoind and miniircd
|
||||
# https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/master/docs/TESTING.md
|
||||
# "test/jmclient/"
|
||||
# "test/jmdaemon/"
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"jmbase"
|
||||
"jmbitcoin"
|
||||
"jmclient"
|
||||
"jmdaemon"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/Joinmarket-Org/joinmarket-clientserver";
|
||||
maintainers = with maintainers; [ seberm nixbitcoin ];
|
||||
license = licenses.gpl3;
|
||||
};
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
diff --git a/conftest.py b/conftest.py
|
||||
index 1cc56d5..54b0a4c 100644
|
||||
--- a/conftest.py
|
||||
+++ b/conftest.py
|
||||
@@ -74,12 +74,6 @@ def pytest_addoption(parser: Any) -> None:
|
||||
action="store",
|
||||
default='bitcoinrpc',
|
||||
help="the RPC username for your test bitcoin instance (default=bitcoinrpc)")
|
||||
- parser.addoption("--nirc",
|
||||
- type="int",
|
||||
- action="store",
|
||||
- default=1,
|
||||
- help="the number of local miniircd instances")
|
||||
-
|
||||
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
def setup_early_if_needed(request) -> None:
|
||||
@@ -1,13 +0,0 @@
|
||||
{ buildPythonPackage, clightning, pyln-client }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pylightning";
|
||||
version = "0.10.1"; # defined in ${src}/contrib/pyln-client/pyln/client/__init__.py
|
||||
|
||||
inherit (clightning) src;
|
||||
|
||||
propagatedBuildInputs = [ pyln-client ];
|
||||
|
||||
postUnpack = "sourceRoot=$sourceRoot/contrib/${pname}";
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
{ buildPythonPackage, hatchling, pytestCheckHook, clightning, pyln-proto }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pyln-bolt7";
|
||||
# The version is defined here:
|
||||
# https://github.com/ElementsProject/lightning/blob/master/contrib/pyln-spec/bolt7/pyproject.toml
|
||||
version = "1.0.4.246";
|
||||
format = "pyproject";
|
||||
|
||||
inherit (clightning) src;
|
||||
|
||||
nativeBuildInputs = [ hatchling ];
|
||||
propagatedBuildInputs = [ pyln-proto ];
|
||||
checkInputs = [ pytestCheckHook ];
|
||||
|
||||
pythonNamespaces = [ "pyln" ];
|
||||
|
||||
postUnpack = "sourceRoot=$sourceRoot/contrib/pyln-spec/bolt7";
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
{ buildPythonPackage, hatchling, pytestCheckHook, clightning, pyln-bolt7, pyln-proto }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pyln-client";
|
||||
version = clightning.version;
|
||||
format = "pyproject";
|
||||
|
||||
inherit (clightning) src;
|
||||
|
||||
nativeBuildInputs = [ hatchling ];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
pyln-bolt7
|
||||
pyln-proto
|
||||
];
|
||||
|
||||
checkInputs = [ pytestCheckHook ];
|
||||
|
||||
pythonNamespaces = [ "pyln" ];
|
||||
|
||||
postUnpack = "sourceRoot=$sourceRoot/contrib/${pname}";
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
{ buildPythonPackage
|
||||
, clightning
|
||||
, hatchling
|
||||
, pytestCheckHook
|
||||
, bitstring
|
||||
, cryptography
|
||||
, coincurve
|
||||
, base58
|
||||
, pysocks
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pyln-proto";
|
||||
version = clightning.version;
|
||||
format = "pyproject";
|
||||
|
||||
inherit (clightning) src;
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace-fail 'coincurve==20.0.0' 'coincurve==21.0.0'
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ hatchling ];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
bitstring
|
||||
cryptography
|
||||
coincurve
|
||||
base58
|
||||
pysocks
|
||||
];
|
||||
|
||||
checkInputs = [ pytestCheckHook ];
|
||||
|
||||
pythonNamespaces = [ "pyln" ];
|
||||
|
||||
postUnpack = "sourceRoot=$sourceRoot/contrib/pyln-proto";
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{ lib, buildPythonPackage, fetchFromGitHub, secp256k1 }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "python-bitcointx";
|
||||
version = "1.1.5";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Simplexum";
|
||||
repo = "python-bitcointx";
|
||||
rev = "python-bitcointx-v${version}";
|
||||
hash = "sha256-KXndYEsJ8JRTiGojrKXmAEeGDlHrNGs5MtYs9XYiqMo=";
|
||||
};
|
||||
|
||||
patchPhase = ''
|
||||
for path in core/secp256k1.py tests/test_load_secp256k1.py; do
|
||||
substituteInPlace "bitcointx/$path" \
|
||||
--replace-fail "ctypes.util.find_library('secp256k1')" "'${secp256k1}/lib/libsecp256k1.so'"
|
||||
done
|
||||
'';
|
||||
|
||||
pythonImportCheck = [
|
||||
"bitcointx"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Interface to Bitcoin transaction data structures";
|
||||
homepage = "https://github.com/Simplexum/python-bitcointx";
|
||||
maintainers = with maintainers; [ seberm nixbitcoin ];
|
||||
license = licenses.gpl3;
|
||||
};
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
. "${BASH_SOURCE[0]%/*}/../../../helper/run-in-nix-env" "git gnupg jq" "$@"
|
||||
|
||||
latest=$(curl -s "https://api.github.com/repos/Simplexum/python-bitcointx/tags" | jq -r '.[0].name')
|
||||
echo "Latest release is $latest"
|
||||
|
||||
tmpdir=$(mktemp -d /tmp/python-bitcointx-verify-gpg.XXX)
|
||||
trap 'rm -rf $tmpdir' EXIT
|
||||
repo=$tmpdir/repo
|
||||
git clone --depth 1 --branch "$latest" -c advice.detachedHead=false https://github.com/Simplexum/python-bitcointx "$repo"
|
||||
|
||||
# GPG verification
|
||||
export GNUPGHOME=$tmpdir
|
||||
echo "Fetching Dimitry Pethukov's Key"
|
||||
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys B17A35BBA187395784E2A6B32301D26BDC15160D 2> /dev/null
|
||||
echo
|
||||
echo "Verifying commit"
|
||||
git -C "$repo" checkout -q "tags/$latest"
|
||||
git -C "$repo" verify-commit HEAD
|
||||
rm -rf "$repo"/.git
|
||||
hash=$(nix hash path "$repo")
|
||||
|
||||
echo
|
||||
echo "tag: $latest"
|
||||
echo "hash: $hash"
|
||||
@@ -1,22 +0,0 @@
|
||||
{ sha256, lib, buildPythonPackage, fetchFromGitHub }:
|
||||
|
||||
buildPythonPackage {
|
||||
pname = "runes";
|
||||
version = "0.4.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
repo = "runes";
|
||||
owner = "rustyrussell";
|
||||
rev = "7e3d7648db844ce2c78cc3e9e4f872f827252251";
|
||||
sha256 = "sha256-e0iGLV/57gCpqA7vrW6JMFM0R6iAq5oFwUpZoGySwfs=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ sha256 ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Runes for authentication (like macaroons only simpler)";
|
||||
homepage = "https://github.com/rustyrussell/runes";
|
||||
maintainers = with maintainers; [ jb55 ];
|
||||
license = licenses.mit;
|
||||
};
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{ lib, buildPythonPackage, fetchFromGitHub, cython }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "sha256";
|
||||
version = builtins.substring 0 8 src.rev;
|
||||
|
||||
# The version from pypi is old/broken
|
||||
src = fetchFromGitHub {
|
||||
repo = "sha256";
|
||||
owner = "cloudtools";
|
||||
rev = "e0645d118f7296dde45397a755261f78d421bdee";
|
||||
sha256 = "sha256-gEctMgF5qZiWelVHVCl3zazRNuaQ7lJP8ExI5xWEBVI=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cython ];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
configurePhase = ''
|
||||
python setup.py sdist
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = ''
|
||||
SHA-256 implementation that allows for setting and getting the mid-state
|
||||
information.
|
||||
'';
|
||||
homepage = "https://github.com/cloudtools/sha256";
|
||||
maintainers = with maintainers; [ jb55 ];
|
||||
license = licenses.mit;
|
||||
};
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
# Like nixpkgs revision 8d668463b0883b2e21ba2e2635cd5f9bbc409b18
|
||||
# but without Python 2 support
|
||||
|
||||
{ lib, buildPythonPackage, fetchPypi,
|
||||
six, txaio, twisted, zope-interface, cffi,
|
||||
mock, pytest, cryptography, pynacl
|
||||
}:
|
||||
buildPythonPackage rec {
|
||||
pname = "autobahn";
|
||||
version = "20.12.3";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "15b8zm7jalwisfwc08szxy3bh2bnn0hd41dbsnswi0lqwbh962j1";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ six txaio twisted zope-interface cffi cryptography pynacl ];
|
||||
|
||||
checkInputs = [ mock pytest ];
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
USE_TWISTED=true py.test "$out"
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
# Tests do no seem to be compatible yet with pytest 5.1
|
||||
# https://github.com/crossbario/autobahn-python/issues/1235
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "WebSocket and WAMP in Python for Twisted and asyncio.";
|
||||
homepage = "https://crossbar.io/autobahn";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ nand0p ];
|
||||
};
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, pyzmq
|
||||
, setuptools
|
||||
, twisted
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "txzmq";
|
||||
version = "0.8.2";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchPypi {
|
||||
pname = "txZMQ";
|
||||
inherit version;
|
||||
sha256 = "07a9a480e58d4d732eef9efd7e264f2348cbf27ee82b338ec818a8504006e1c0";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
pyzmq
|
||||
twisted
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Twisted bindings for ZeroMQ";
|
||||
homepage = https://github.com/smira/txZMQ;
|
||||
license = licenses.gpl2;
|
||||
};
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
{ lib
|
||||
, stdenvNoCC
|
||||
, nodejs_22
|
||||
, nodejs-slim_22
|
||||
, fetchNodeModules
|
||||
, fetchpatch
|
||||
, fetchurl
|
||||
, makeWrapper
|
||||
}:
|
||||
let self = stdenvNoCC.mkDerivation {
|
||||
pname = "rtl";
|
||||
version = "0.15.8";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/Ride-The-Lightning/RTL/archive/refs/tags/v${self.version}.tar.gz";
|
||||
hash = "sha256-8XdGyORxB2dkZRB/Yl7zh+Quqo4L/Y0VmC6Brbr/hqU=";
|
||||
};
|
||||
|
||||
passthru = {
|
||||
nodejs = nodejs_22;
|
||||
nodejsRuntime = nodejs-slim_22;
|
||||
|
||||
nodeModules = fetchNodeModules {
|
||||
inherit (self) src nodejs;
|
||||
# TODO-EXTERNAL: Remove `npmFlags` when no longer required
|
||||
# See: https://github.com/Ride-The-Lightning/RTL/issues/1182
|
||||
npmFlags = "--legacy-peer-deps";
|
||||
hash = "sha256-oMqd6nLzS6iQ9w4z2yzpR2unA5qhOq5YdvfoS8IgYLY=";
|
||||
};
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
phases = "unpackPhase patchPhase installPhase";
|
||||
|
||||
# `src` already contains the precompiled frontend and backend.
|
||||
# Copy all files required for packaging, like in
|
||||
# https://github.com/Ride-The-Lightning/RTL/blob/master/dockerfiles/Dockerfile
|
||||
installPhase = ''
|
||||
dest=$out/lib/node_modules/rtl
|
||||
mkdir -p $dest
|
||||
cp -r \
|
||||
rtl.js \
|
||||
package.json \
|
||||
frontend \
|
||||
backend \
|
||||
${self.nodeModules}/lib/node_modules \
|
||||
$dest
|
||||
|
||||
makeWrapper ${self.nodejsRuntime}/bin/node "$out/bin/rtl" \
|
||||
--add-flags "$dest/rtl.js"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A web interface for LND, c-lightning and Eclair";
|
||||
homepage = "https://github.com/Ride-The-Lightning/RTL";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ nixbitcoin erikarvstedt ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}; in self
|
||||
@@ -1,41 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
. "${BASH_SOURCE[0]%/*}/../../helper/run-in-nix-env" "gnupg wget gnused" "$@"
|
||||
|
||||
version="0.15.8"
|
||||
repo=https://github.com/Ride-The-Lightning/RTL
|
||||
|
||||
scriptDir=$(cd "${BASH_SOURCE[0]%/*}" && pwd)
|
||||
|
||||
updateSrc() {
|
||||
TMPDIR=$(mktemp -d /tmp/rtl.XXX)
|
||||
trap 'rm -rf $TMPDIR' EXIT
|
||||
|
||||
# Fetch and verify source tarball
|
||||
export GNUPGHOME=$TMPDIR
|
||||
|
||||
# Fetch saubyk's key
|
||||
gpg --keyserver hkps://keyserver.ubuntu.com --recv-key 3E9BD4436C288039CA827A9200C9E2BC2E45666F
|
||||
file=v$version.tar.gz
|
||||
wget -P "$TMPDIR" "$repo/archive/refs/tags/$file"
|
||||
wget -P "$TMPDIR" "$repo/releases/download/v$version/$file.asc"
|
||||
gpg --verify "$TMPDIR/$file.asc" "$TMPDIR/$file"
|
||||
hash=$(nix hash file "$TMPDIR/$file")
|
||||
|
||||
sed -i "
|
||||
s|\bversion = .*;|version = \"$version\";|
|
||||
s|\bhash = .*;|hash = \"$hash\";|
|
||||
" default.nix
|
||||
}
|
||||
|
||||
updateNodeModulesHash() {
|
||||
"$scriptDir/../../helper/update-fixed-output-derivation.sh" ./default.nix rtl.nodeModules nodeModules
|
||||
}
|
||||
|
||||
if [[ $# == 0 ]]; then
|
||||
# Each of these can be run separately
|
||||
updateSrc
|
||||
updateNodeModulesHash
|
||||
else
|
||||
"$@"
|
||||
fi
|
||||
@@ -1,28 +0,0 @@
|
||||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "trustedcoin";
|
||||
version = "0.8.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "nbd-wtf";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-b+Icq/9qMF+Zvh7RuG9RxU8/U07Tl8ymZvNKWsZzatw=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-fW+EoNPC0mH8C06Q6GXNwFdzE7oQT+qd+B7hGGml+hc=";
|
||||
|
||||
subPackages = [ "." ];
|
||||
|
||||
preCheck = ''
|
||||
ln -s $TMP/go/bin/trustedcoin .
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Light bitcoin node implementation";
|
||||
homepage = "https://github.com/nbd-wtf/trustedcoin";
|
||||
maintainers = with maintainers; [ seberm fort-nix ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p git gnupg curl jq
|
||||
set -euo pipefail
|
||||
|
||||
|
||||
TMPDIR="$(mktemp -d -p /tmp)"
|
||||
trap 'rm -rf $TMPDIR' EXIT
|
||||
cd "$TMPDIR"
|
||||
|
||||
echo "Fetching latest release"
|
||||
repo='nbd-wtf/trustedcoin'
|
||||
latest=$(curl --location --silent --show-error https://api.github.com/repos/${repo}/releases/latest | jq -r .tag_name)
|
||||
echo "Latest release is $latest"
|
||||
git clone --depth 1 --branch "$latest" "https://github.com/${repo}" 2>/dev/null
|
||||
cd trustedcoin
|
||||
|
||||
echo "tag: $latest"
|
||||
git checkout -q "tags/$latest"
|
||||
rm -rf .git
|
||||
nix --extra-experimental-features nix-command hash path .
|
||||
Reference in New Issue
Block a user