lightning-charge: remove package and module
This commit is contained in:
parent
58de79d401
commit
79f4723cda
21 changed files with 1 additions and 5479 deletions
|
|
@ -15,7 +15,6 @@ let
|
|||
${optionalString (!cfg.with-bulk-data) "- ${config.services.liquidd.dataDir}/*/chainstate"}
|
||||
${config.services.liquidd.dataDir}
|
||||
${optionalString cfg.with-bulk-data "${config.services.electrs.dataDir}"}
|
||||
${config.services.lightning-charge.dataDir}
|
||||
${config.services.nbxplorer.dataDir}
|
||||
${config.services.btcpayserver.dataDir}
|
||||
${config.services.joinmarket.dataDir}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
clightning = ./clightning.nix;
|
||||
default = ./default.nix;
|
||||
electrs = ./electrs.nix;
|
||||
lightning-charge = ./lightning-charge.nix;
|
||||
liquid = ./liquid.nix;
|
||||
presets.secure-node = ./presets/secure-node.nix;
|
||||
nix-bitcoin-webindex = ./nix-bitcoin-webindex.nix;
|
||||
|
|
|
|||
|
|
@ -1,84 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.lightning-charge;
|
||||
inherit (config) nix-bitcoin-services;
|
||||
user = config.users.users.lightning-charge.name;
|
||||
group = config.users.users.lightning-charge.group;
|
||||
in {
|
||||
options.services.lightning-charge = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
If enabled, the lightning-charge service will be installed.
|
||||
'';
|
||||
};
|
||||
dataDir = mkOption {
|
||||
type = types.path;
|
||||
default = "/var/lib/lightning-charge";
|
||||
description = "The data directory for lightning-charge.";
|
||||
};
|
||||
host = mkOption {
|
||||
type = types.str;
|
||||
default = "127.0.0.1";
|
||||
description = "http server listen address";
|
||||
};
|
||||
extraArgs = mkOption {
|
||||
type = types.separatedString " ";
|
||||
default = "";
|
||||
description = "Extra command line arguments passed to lightning-charge.";
|
||||
};
|
||||
enforceTor = nix-bitcoin-services.enforceTor;
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
warnings = [''
|
||||
The lightning-charge module is deprecated and will be removed soon.
|
||||
''];
|
||||
services.clightning.enable = true;
|
||||
|
||||
users.users.lightning-charge = {
|
||||
description = "lightning-charge User";
|
||||
group = "lightning-charge";
|
||||
extraGroups = [ "clightning" ];
|
||||
};
|
||||
users.groups.lightning-charge = {};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d '${cfg.dataDir}' 0700 ${user} ${group} - -"
|
||||
];
|
||||
|
||||
systemd.services.lightning-charge = {
|
||||
description = "Run lightning-charge";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
requires = [ "clightning.service" ];
|
||||
after = [ "clightning.service" ];
|
||||
preStart = ''
|
||||
# Move existing lightning-charge.db
|
||||
# TODO: Remove eventually
|
||||
if [[ -e ${config.services.clightning.dataDir}/lightning-charge.db ]]; then
|
||||
mv ${config.services.clightning.dataDir}/lightning-charge.db ${cfg.dataDir}/lightning-charge.db
|
||||
chown ${user}: ${cfg.dataDir}/lightning-charge.db
|
||||
chmod 600 ${cfg.dataDir}/lightning-charge.db
|
||||
fi
|
||||
'';
|
||||
serviceConfig = nix-bitcoin-services.defaultHardening // {
|
||||
# Needed to access clightning.dataDir in preStart
|
||||
PermissionsStartOnly = "true";
|
||||
EnvironmentFile = "${config.nix-bitcoin.secretsDir}/lightning-charge-env";
|
||||
ExecStart = "${config.nix-bitcoin.pkgs.lightning-charge}/bin/charged -l ${config.services.clightning.dataDir}/bitcoin -d ${cfg.dataDir}/lightning-charge.db -i ${cfg.host} ${cfg.extraArgs}";
|
||||
User = user;
|
||||
Restart = "on-failure";
|
||||
RestartSec = "10s";
|
||||
ReadWritePaths = "${cfg.dataDir}";
|
||||
} // (if cfg.enforceTor
|
||||
then nix-bitcoin-services.allowTor
|
||||
else nix-bitcoin-services.allowAnyIP)
|
||||
// nix-bitcoin-services.nodejs;
|
||||
};
|
||||
nix-bitcoin.secrets.lightning-charge-env.user = user;
|
||||
};
|
||||
}
|
||||
|
|
@ -11,7 +11,6 @@ with lib;
|
|||
./bitcoind.nix
|
||||
./clightning.nix
|
||||
./clightning-plugins
|
||||
./lightning-charge.nix
|
||||
./spark-wallet.nix
|
||||
./lnd.nix
|
||||
./lightning-loop.nix
|
||||
|
|
|
|||
|
|
@ -217,10 +217,6 @@ in {
|
|||
id = 17;
|
||||
# communicates with clightning over lightning-rpc socket
|
||||
};
|
||||
lightning-charge = {
|
||||
id = 18;
|
||||
# communicates with clightning over lightning-rpc socket
|
||||
};
|
||||
recurring-donations = {
|
||||
id = 20;
|
||||
# communicates with clightning over lightning-rpc socket
|
||||
|
|
@ -282,8 +278,6 @@ in {
|
|||
extraArgs = "--no-tls";
|
||||
};
|
||||
|
||||
services.lightning-charge.host = netns.lightning-charge.address;
|
||||
|
||||
services.lightning-loop.rpcAddress = netns.lightning-loop.address;
|
||||
|
||||
services.nbxplorer.bind = netns.nbxplorer.address;
|
||||
|
|
|
|||
|
|
@ -111,8 +111,6 @@ in {
|
|||
enforceTor = true;
|
||||
};
|
||||
|
||||
services.lightning-charge.enforceTor = true;
|
||||
|
||||
services.recurring-donations.enforceTor = true;
|
||||
|
||||
services.nix-bitcoin-webindex.enforceTor = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue