diff --git a/modules/bitcoind.nix b/modules/bitcoind.nix index 883618a..8571dea 100644 --- a/modules/bitcoind.nix +++ b/modules/bitcoind.nix @@ -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} ''; diff --git a/pkgs/asmap-data.nix b/pkgs/asmap-data.nix new file mode 100644 index 0000000..f605fd7 --- /dev/null +++ b/pkgs/asmap-data.nix @@ -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; + }; +}