mirror of
https://github.com/fort-nix/nix-bitcoin.git
synced 2024-11-22 22:33:46 +03:00
clightning: add consistent address options
Also remove option 'autolisten'. This option has no effect because option 'bind-addr' is always set.
This commit is contained in:
parent
b41a720c28
commit
e78a609687
@ -49,7 +49,7 @@
|
||||
### LND
|
||||
# Uncomment the following line in order to enable lnd, a lightning
|
||||
# implementation written in Go. In order to avoid collisions with clightning
|
||||
# you must disable clightning or change the services.clightning.bindport or
|
||||
# you must disable clightning or change the services.clightning.port or
|
||||
# services.lnd.port to a port other than 9735.
|
||||
# services.lnd.enable = true;
|
||||
# Enable this option to announce our Tor Hidden Service. By default lnd
|
||||
|
@ -13,7 +13,7 @@ let
|
||||
bitcoin-datadir=${config.services.bitcoind.dataDir}
|
||||
${optionalString (cfg.proxy != null) "proxy=${cfg.proxy}"}
|
||||
always-use-proxy=${if cfg.always-use-proxy then "true" else "false"}
|
||||
bind-addr=${cfg.bind-addr}:${toString cfg.bindport}
|
||||
bind-addr=${cfg.address}:${toString cfg.port}
|
||||
bitcoin-rpcconnect=${config.services.bitcoind.rpc.address}
|
||||
bitcoin-rpcport=${toString config.services.bitcoind.rpc.port}
|
||||
bitcoin-rpcuser=${config.services.bitcoind.rpc.users.public.name}
|
||||
@ -29,13 +29,15 @@ in {
|
||||
If enabled, the clightning service will be installed.
|
||||
'';
|
||||
};
|
||||
autolisten = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Bind (and maybe announce) on IPv4 and IPv6 interfaces if no addr,
|
||||
bind-addr or announce-addr options are specified.
|
||||
'';
|
||||
address = mkOption {
|
||||
type = types.str;
|
||||
default = "127.0.0.1";
|
||||
description = "IP address or UNIX domain socket to listen for peer connections.";
|
||||
};
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 9735;
|
||||
description = "Port to listen for peer connections.";
|
||||
};
|
||||
proxy = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
@ -49,16 +51,6 @@ in {
|
||||
Always use the *proxy*, even to connect to normal IP addresses (you can still connect to Unix domain sockets manually). This also disables all DNS lookups, to avoid leaking information.
|
||||
'';
|
||||
};
|
||||
bind-addr = mkOption {
|
||||
type = nbPkgs.lib.ipv4Address;
|
||||
default = "127.0.0.1";
|
||||
description = "Set an IP address or UNIX domain socket to listen to";
|
||||
};
|
||||
bindport = mkOption {
|
||||
type = types.port;
|
||||
default = 9735;
|
||||
description = "Set a Port to listen to locally";
|
||||
};
|
||||
announce-tor = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
|
@ -58,7 +58,7 @@ with lib;
|
||||
|
||||
config = {
|
||||
assertions = [
|
||||
{ assertion = (config.services.lnd.enable -> ( !config.services.clightning.enable || config.services.clightning.bindport != config.services.lnd.port));
|
||||
{ assertion = (config.services.lnd.enable -> ( !config.services.clightning.enable || config.services.clightning.port != config.services.lnd.port));
|
||||
message = ''
|
||||
LND and clightning can't both bind to lightning port 9735. Either
|
||||
disable LND/clightning or change services.clightning.bindPort or
|
||||
|
@ -254,7 +254,7 @@ in {
|
||||
};
|
||||
systemd.services.bitcoind-import-banlist.serviceConfig.NetworkNamespacePath = "/var/run/netns/nb-bitcoind";
|
||||
|
||||
services.clightning.bind-addr = netns.clightning.address;
|
||||
services.clightning.address = netns.clightning.address;
|
||||
|
||||
services.lnd = {
|
||||
address = netns.lnd.address;
|
||||
|
@ -68,8 +68,8 @@ in {
|
||||
services.clightning.enforceTor = true;
|
||||
services.tor.hiddenServices.clightning = mkIf cfg.clightning.enable (mkHiddenService {
|
||||
port = cfg.clightning.onionport;
|
||||
toHost = cfg.clightning.bind-addr;
|
||||
toPort = cfg.clightning.bindport;
|
||||
toHost = cfg.clightning.address;
|
||||
toPort = cfg.clightning.port;
|
||||
});
|
||||
|
||||
# lnd
|
||||
|
Loading…
Reference in New Issue
Block a user