2019-11-27 05:04:23 -08:00
|
|
|
{ config, pkgs, lib, ... }:
|
2019-11-27 05:04:20 -08:00
|
|
|
|
2020-12-21 03:19:15 -08:00
|
|
|
with lib;
|
2020-03-04 09:08:46 -08:00
|
|
|
{
|
2019-11-27 05:04:20 -08:00
|
|
|
imports = [
|
2020-09-28 00:41:17 -07:00
|
|
|
# Core modules
|
|
|
|
./secrets/secrets.nix
|
2020-09-28 04:09:03 -07:00
|
|
|
./operator.nix
|
2020-09-28 00:41:17 -07:00
|
|
|
|
|
|
|
# Main features
|
2019-11-27 05:04:20 -08:00
|
|
|
./bitcoind.nix
|
|
|
|
./clightning.nix
|
2020-11-18 18:01:45 -08:00
|
|
|
./clightning-plugins
|
2019-11-27 05:04:20 -08:00
|
|
|
./spark-wallet.nix
|
|
|
|
./lnd.nix
|
2020-07-07 07:22:17 -07:00
|
|
|
./lightning-loop.nix
|
2020-08-12 07:47:56 -07:00
|
|
|
./btcpayserver.nix
|
2020-09-28 00:41:17 -07:00
|
|
|
./electrs.nix
|
|
|
|
./liquid.nix
|
2020-04-23 09:18:47 -07:00
|
|
|
./joinmarket.nix
|
2020-09-28 00:41:17 -07:00
|
|
|
./hardware-wallets.nix
|
|
|
|
./recurring-donations.nix
|
|
|
|
|
|
|
|
# Support features
|
2020-10-12 04:33:48 -07:00
|
|
|
./versioning.nix
|
2020-09-28 00:41:17 -07:00
|
|
|
./security.nix
|
|
|
|
./netns-isolation.nix
|
|
|
|
./backups.nix
|
|
|
|
./onion-chef.nix
|
2019-11-27 05:04:20 -08:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledModules = [ "services/networking/bitcoind.nix" ];
|
|
|
|
|
2019-11-27 05:04:23 -08:00
|
|
|
options = {
|
2020-12-21 03:19:15 -08:00
|
|
|
nix-bitcoin-services = mkOption {
|
2019-11-27 05:04:23 -08:00
|
|
|
readOnly = true;
|
2020-05-22 06:59:18 -07:00
|
|
|
default = import ./nix-bitcoin-services.nix lib pkgs;
|
2019-11-27 05:04:23 -08:00
|
|
|
};
|
2020-11-09 13:09:09 -08:00
|
|
|
|
2020-12-21 03:19:15 -08:00
|
|
|
nix-bitcoin = {
|
|
|
|
pkgs = mkOption {
|
|
|
|
type = types.attrs;
|
|
|
|
default = (import ../pkgs { inherit pkgs; }).modulesPkgs;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Torify binary that works with custom Tor SOCKS addresses
|
|
|
|
# Related issue: https://github.com/NixOS/nixpkgs/issues/94236
|
|
|
|
torify = mkOption {
|
|
|
|
readOnly = true;
|
|
|
|
default = pkgs.writeScriptBin "torify" ''
|
|
|
|
${pkgs.tor}/bin/torify \
|
|
|
|
--address ${head (splitString ":" config.services.tor.client.socksListenAddress)} \
|
|
|
|
"$@"
|
|
|
|
'';
|
|
|
|
};
|
2020-11-09 13:09:09 -08:00
|
|
|
};
|
2019-11-27 05:04:23 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
2020-06-15 03:21:18 -07:00
|
|
|
assertions = [
|
2020-08-04 00:54:01 -07:00
|
|
|
{ assertion = (config.services.lnd.enable -> ( !config.services.clightning.enable || config.services.clightning.bindport != config.services.lnd.listenPort));
|
2020-06-15 03:21:18 -07:00
|
|
|
message = ''
|
2020-08-04 00:54:01 -07:00
|
|
|
LND and clightning can't both bind to lightning port 9735. Either
|
|
|
|
disable LND/clightning or change services.clightning.bindPort or
|
|
|
|
services.lnd.listenPort to a port other than 9735.
|
2020-06-15 03:21:18 -07:00
|
|
|
'';
|
|
|
|
}
|
|
|
|
];
|
2019-11-27 05:04:23 -08:00
|
|
|
};
|
2019-11-27 05:04:20 -08:00
|
|
|
}
|