diff --git a/modules/lnd.nix b/modules/lnd.nix index e4b591a..fcadc5c 100644 --- a/modules/lnd.nix +++ b/modules/lnd.nix @@ -157,6 +157,16 @@ in { { assertion = bitcoind.prune == 0; message = "lnd does not support bitcoind pruning."; } + { assertion = + !(config.services ? clightning) + || !config.services.clightning.enable + || config.services.clightning.port != cfg.port; + message = '' + LND and clightning can't both bind to lightning port 9735. Either + disable LND/clightning or change services.clightning.port or + services.lnd.port to a port other than 9735. + ''; + } ]; services.bitcoind = { diff --git a/modules/nix-bitcoin.nix b/modules/nix-bitcoin.nix index fc8696b..48cb7c4 100644 --- a/modules/nix-bitcoin.nix +++ b/modules/nix-bitcoin.nix @@ -41,16 +41,4 @@ with lib; }; }; }; - - config = { - assertions = [ - { 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 - services.lnd.port to a port other than 9735. - ''; - } - ]; - }; }