modules: move assertion to lnd.nix

nix-bitcoin.nix is now no longer dependent on clightning.nix and lnd.nix.
Due to condition '!(config.services ? clightning)' lnd.nix still
doesn't depend on clightning.nix.

Also fix the assertion message by renaming clightning.bindPort to clightning.port.
This commit is contained in:
Erik Arvstedt 2021-08-15 11:28:46 +02:00
parent cce9a3f6b2
commit 9f7d048769
No known key found for this signature in database
GPG Key ID: 33312B944DD97846
2 changed files with 10 additions and 12 deletions

View File

@ -157,6 +157,16 @@ in {
{ assertion = bitcoind.prune == 0; { assertion = bitcoind.prune == 0;
message = "lnd does not support bitcoind pruning."; 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 = { services.bitcoind = {

View File

@ -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.
'';
}
];
};
} }