nix-bitcoin/modules/onionnode.nix

33 lines
722 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.onionnode;
in {
options.services.onionnode = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
If enabled, the onion service will be installed.
'';
};
};
config = mkIf cfg.enable {
services.bitcoin.enable = true;
services.bitcoin.listen = true;
services.tor.enable = true;
services.tor.client.enable = true;
services.bitcoin.proxy = config.services.tor.client.socksListenAddress;
2018-11-19 16:22:16 -08:00
services.bitcoin.port = 8333;
services.tor.hiddenServices.bitcoind = {
map = [{
port = config.services.bitcoin.port;
}];
version = 3;
};
2018-11-19 16:22:16 -08:00
};
}