lnd: add netns cli script

This commit is contained in:
nixbitcoin 2020-06-18 10:19:04 +00:00
parent c55296433d
commit 4b8ca52647
No known key found for this signature in database
GPG Key ID: DD11F9AD5308B3BA
2 changed files with 6 additions and 1 deletions

View File

@ -107,7 +107,6 @@ in {
description = "The package providing lnd binaries."; description = "The package providing lnd binaries.";
}; };
cli = mkOption { cli = mkOption {
readOnly = true;
default = pkgs.writeScriptBin "lncli" default = pkgs.writeScriptBin "lncli"
# Switch user because lnd makes datadir contents readable by user only # Switch user because lnd makes datadir contents readable by user only
'' ''

View File

@ -207,6 +207,12 @@ in {
"127.0.0.1" "127.0.0.1"
]; ];
bitcoind-host = netns.bitcoind.address; bitcoind-host = netns.bitcoind.address;
cli = pkgs.writeScriptBin "lncli"
# Switch user because lnd makes datadir contents readable by user only
''
netns-exec nb-lnd sudo -u lnd ${config.services.lnd.package}/bin/lncli --tlscertpath ${config.nix-bitcoin.secretsDir}/lnd-cert \
--macaroonpath '${config.services.lnd.dataDir}/chain/bitcoin/mainnet/admin.macaroon' "$@"
'';
}; };
}) })