add asmap-data package and bitcoind module option

This commit is contained in:
jurraca 2024-11-20 14:41:56 +00:00
parent c0994bfc7b
commit ade602f995
2 changed files with 31 additions and 0 deletions

View File

@ -254,6 +254,11 @@ let
example = "bech32";
description = "The type of addresses to use";
};
fetchASmap = mkOption {
type = types.nullOr types.bool;
default = null;
description = "Fetch the latest ASmap from the github:asmap/asmap-data repository.";
};
user = mkOption {
type = types.str;
default = "bitcoin";
@ -337,6 +342,9 @@ let
${optionalString (cfg.zmqpubrawblock != null) "zmqpubrawblock=${cfg.zmqpubrawblock}"}
${optionalString (cfg.zmqpubrawtx != null) "zmqpubrawtx=${cfg.zmqpubrawtx}"}
# ASmap option
${optionalString (cfg.fetchASmap != null) "asmap=${pkgs.asmap-data}"}
# Extra options
${cfg.extraConfig}
'';

23
pkgs/asmap-data.nix Normal file
View File

@ -0,0 +1,23 @@
{ stdenv, pkgs, lib, fetchFromGitHub, ... }:
stdenv.mkDerivation rec {
name = "asmap-data";
version = "dcce69e48211facdbd52a461cfce333d5800b7de";
src = pkgs.fetchFromGitHub {
owner = "asmap";
repo = "asmap-data";
rev = version;
sha256 = "sha256-bp93VZX6EF6vwpbA4jqAje/1txfKeqN9BhVRLkdM+94=";
};
installPhase = ''
cp -r $src/latest_asmap.dat $out
'';
meta = {
description = "Contains an asmap file from the ASMap Data Demo Repository";
homepage = "https://github.com/asmap/asmap-data";
license = lib.licenses.mit;
};
}