Add spark-wallet
This commit is contained in:
@@ -15,6 +15,7 @@ let
|
||||
liquidd
|
||||
lightning-charge.package
|
||||
nanopos.package
|
||||
spark-wallet.package
|
||||
nodejs-8_x
|
||||
nginx
|
||||
];
|
||||
@@ -27,6 +28,7 @@ in {
|
||||
./nanopos.nix
|
||||
./nixbitcoin-webindex.nix
|
||||
./liquid.nix
|
||||
./spark-wallet.nix
|
||||
];
|
||||
|
||||
options.services.nixbitcoin = {
|
||||
@@ -125,6 +127,13 @@ in {
|
||||
services.nanopos.enable = cfg.modules == "all";
|
||||
services.nixbitcoin-webindex.enable = cfg.modules == "all";
|
||||
services.clightning.autolisten = cfg.modules == "all";
|
||||
services.spark-wallet.enable = cfg.modules == "all";
|
||||
services.tor.hiddenServices.spark-wallet = {
|
||||
map = [{
|
||||
port = 80; toPort = 9737;
|
||||
}];
|
||||
version = 3;
|
||||
};
|
||||
environment.systemPackages = if (cfg.modules == "all") then (minimalPackages ++ allPackages) else minimalPackages;
|
||||
};
|
||||
}
|
||||
|
||||
44
modules/spark-wallet.nix
Normal file
44
modules/spark-wallet.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.spark-wallet;
|
||||
in {
|
||||
options.services.spark-wallet = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
If enabled, the spark-wallet service will be installed.
|
||||
'';
|
||||
};
|
||||
ln-path = mkOption {
|
||||
type = types.path;
|
||||
default = "/var/lib/clightning";
|
||||
description = ''
|
||||
"The path of the clightning data directory.";
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.services.spark-wallet =
|
||||
{ description = "Run spark-wallet";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
requires = [ "clightning.service" ];
|
||||
after = [ "clightning.service" ];
|
||||
serviceConfig =
|
||||
{
|
||||
ExecStart = "${pkgs.spark-wallet.package}/bin/spark-wallet --ln-path ${cfg.ln-path} -k -c /secrets/spark-wallet-password";
|
||||
User = "clightning";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "10s";
|
||||
PrivateTmp = "true";
|
||||
ProtectSystem = "full";
|
||||
NoNewPrivileges = "true";
|
||||
PrivateDevices = "true";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user