add clightning

This commit is contained in:
Jonas Nick
2018-11-22 18:32:26 +00:00
parent 63e2c6d270
commit aec819db81
4 changed files with 30 additions and 11 deletions

View File

@@ -13,6 +13,8 @@ let
addnode=ecoc5q34tmbq54wl.onion
discover=0
${optionalString (cfg.port != null) "port=${toString cfg.port}"}
rpcuser=foo
rpcpassword=bar
'';
in {
options.services.bitcoin = {
@@ -40,8 +42,6 @@ in {
port = mkOption {
type = types.nullOr types.ints.u16;
default = null;
# type = types.int;
#default = 8333;
description = "Override the default port on which to listen for connections.";
};

View File

@@ -5,6 +5,13 @@ with lib;
let
cfg = config.services.nixbitcoin;
in {
imports =
[
./bitcoind.nix
./tor.nix
./clightning.nix
];
options.services.nixbitcoin = {
enable = mkOption {
type = types.bool;
@@ -16,21 +23,30 @@ in {
};
config = mkIf cfg.enable {
services.bitcoin.enable = true;
services.bitcoin.listen = true;
# Tor
services.tor.enable = true;
services.tor.client.enable = true;
services.bitcoin.proxy = config.services.tor.client.socksListenAddress;
services.bitcoin.port = 8333;
services.tor.hiddenServices.bitcoind = {
map = [{
port = config.services.bitcoin.port;
}];
version = 3;
};
# bitcoin
services.bitcoin.enable = true;
services.bitcoin.listen = true;
services.bitcoin.proxy = config.services.tor.client.socksListenAddress;
services.bitcoin.port = 8333;
# clightning
services.clightning.enable = true;
# nodeinfo
systemd.services.nodeinfo = {
description = "Get node info";
wantedBy = [ "multi-user.target" ];
path = [ pkgs.clightning pkgs.jq pkgs.sudo ];
serviceConfig = {
ExecStart = "${pkgs.bash}/bin/bash -c ${pkgs.nodeinfo}/bin/nodeinfo";
user = "root";