12 cfg = config.services.ostinato;
13 configFile = pkgs.writeText "drone.ini" ''
15 RateAccuracy=${cfg.rateAccuracy}
18 Address=${cfg.rpcServer.address}
21 Include=${concatStringsSep "," cfg.portList.include}
22 Exclude=${concatStringsSep "," cfg.portList.exclude}
34 enable = mkEnableOption "Ostinato agent-controller (Drone)";
44 rateAccuracy = mkOption {
51 To ensure that the actual transmit rate is as close as possible to
52 the configured transmit rate, Drone runs a busy-wait loop.
53 While this provides the maximum accuracy possible, the CPU
54 utilization is 100% while the transmit is on. You can however,
55 sacrifice the accuracy to reduce the CPU load.
64 By default, the Drone RPC server will listen on all interfaces and
65 local IPv4 addresses for incoming connections from clients. Specify
66 a single IPv4 or IPv6 address if you want to restrict that.
67 To listen on any IPv6 address, use ::
74 type = types.listOf types.str;
81 For a port to pass the filter and appear on the port list managed
82 by drone, it be allowed by this include list.
86 type = types.listOf types.str;
93 A list of ports does not appear on the port list managed by drone.
102 ###### implementation
104 config = mkIf cfg.enable {
106 environment.systemPackages = [ pkg ];
108 systemd.services.drone = {
109 description = "Ostinato agent-controller";
110 wantedBy = [ "multi-user.target" ];
112 ${pkg}/bin/drone ${toString cfg.port} ${configFile}