Add spark-wallet

This commit is contained in:
Jonas Nick
2018-12-10 16:34:41 +00:00
parent c3cd4657fb
commit 25d52c4d10
8 changed files with 113 additions and 1 deletions

View File

@@ -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
View 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";
};
};
};
}