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 =
26 Whether to enable the Tox DHT bootstrap daemon.
33 description = "Listening port (UDP).";
38 default = "${WorkingDirectory}/keys";
39 description = "Node key file.";
42 extraConfig = mkOption {
46 Configuration for bootstrap daemon.
47 See <https://github.com/irungentoo/toxcore/blob/master/other/bootstrap_daemon/tox-bootstrapd.conf>
48 and <https://wiki.tox.chat/users/nodes>.
55 config = mkIf config.services.toxBootstrapd.enable {
57 systemd.services.tox-bootstrapd = {
58 description = "Tox DHT bootstrap daemon";
59 after = [ "network.target" ];
60 wantedBy = [ "multi-user.target" ];
62 { ExecStart = "${pkg}/bin/tox-bootstrapd --config=${cfgFile}";
64 inherit PIDFile WorkingDirectory;
65 AmbientCapabilities = ["CAP_NET_BIND_SERVICE"];
67 StateDirectory = "tox-bootstrapd";