1 { config, lib, pkgs, ... }:
6 WorkingDirectory = "/var/lib/tox-bootstrapd";
7 PIDFile = "${WorkingDirectory}/pid";
10 cfg = config.services.toxBootstrapd;
11 cfgFile = builtins.toFile "tox-bootstrapd.conf"
13 port = ${toString cfg.port}
14 keys_file_path = "${WorkingDirectory}/keys"
15 pid_file_path = "${PIDFile}"
21 { services.toxBootstrapd =
27 Whether to enable the Tox DHT bootstrap daemon.
34 description = lib.mdDoc "Listening port (UDP).";
39 default = "${WorkingDirectory}/keys";
40 description = lib.mdDoc "Node key file.";
43 extraConfig = mkOption {
48 Configuration for bootstrap daemon.
49 See <https://github.com/irungentoo/toxcore/blob/master/other/bootstrap_daemon/tox-bootstrapd.conf>
50 and <http://wiki.tox.im/Nodes>.
57 config = mkIf config.services.toxBootstrapd.enable {
59 systemd.services.tox-bootstrapd = {
60 description = "Tox DHT bootstrap daemon";
61 after = [ "network.target" ];
62 wantedBy = [ "multi-user.target" ];
64 { ExecStart = "${pkg}/bin/tox-bootstrapd --config=${cfgFile}";
66 inherit PIDFile WorkingDirectory;
67 AmbientCapabilities = ["CAP_NET_BIND_SERVICE"];
69 StateDirectory = "tox-bootstrapd";