lightning-loop: add module

This commit is contained in:
nixbitcoin 2020-07-07 14:22:17 +00:00
parent 8f3588b13f
commit 491d83a658
No known key found for this signature in database
GPG key ID: DD11F9AD5308B3BA
5 changed files with 97 additions and 0 deletions

View file

@ -127,6 +127,10 @@ in {
id = 21;
connections = [];
};
lightning-loop = {
id = 22;
connections = [ "lnd" ];
};
};
systemd.services = {
@ -291,6 +295,14 @@ in {
# nginx: Custom netns configs
services.nix-bitcoin-webindex.host = mkIf config.services.nix-bitcoin-webindex.enable netns.nginx.address;
# loop: Custom netns configs
services.lightning-loop = mkIf config.services.lightning-loop.enable {
cli = pkgs.writeScriptBin "loop"
# Switch user because lnd makes datadir contents readable by user only
''
netns-exec nb-lightning-loop sudo -u lnd ${config.services.lightning-loop.package}/bin/loop "$@"
'';
};
})
# Custom netns config option values if netns-isolation not enabled
(mkIf (!cfg.enable) {