assertions: add lnd, clightning exclusivity

This commit is contained in:
nixbitcoin 2020-06-15 10:21:18 +00:00
parent 0ad524ca2d
commit 23cd323ad1
No known key found for this signature in database
GPG Key ID: DD11F9AD5308B3BA
2 changed files with 10 additions and 1 deletions

View File

@ -45,7 +45,7 @@
### LND ### LND
# Disable clightning and uncomment the following line in order to enable lnd, # Disable clightning and uncomment the following line in order to enable lnd,
# a lightning implementation written in Go. # a lightning implementation written in Go.
# services.lnd.enable = assert (!config.services.clightning.enable); true; # services.lnd.enable = true;
## WARNING ## WARNING
# If you use lnd, you should manually backup your wallet mnemonic # If you use lnd, you should manually backup your wallet mnemonic
# seed. This will allow you to recover on-chain funds. You can run the # seed. This will allow you to recover on-chain funds. You can run the

View File

@ -26,6 +26,15 @@
}; };
config = { config = {
assertions = [
# lnd.wantedBy == [] needed for `test/tests.nix` in which both clightning and lnd are enabled
{ assertion = config.services.lnd.enable -> (!config.services.clightning.enable || config.systemd.services.lnd.wantedBy == []);
message = ''
LND and clightning can't be run in parallel because they both bind to lightning port 9735.
'';
}
];
nixpkgs.overlays = [ (self: super: { nixpkgs.overlays = [ (self: super: {
nix-bitcoin = let nix-bitcoin = let
pkgs = import ../pkgs { pkgs = super; }; pkgs = import ../pkgs { pkgs = super; };