2019-09-20 19:00:48 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.do-agent;
|
2020-07-23 12:22:27 +01:00
|
|
|
|
2019-09-20 19:00:48 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options.services.do-agent = {
|
2022-08-28 20:18:44 +01:00
|
|
|
enable = mkEnableOption (lib.mdDoc "do-agent, the DigitalOcean droplet metrics agent");
|
2019-09-20 19:00:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2020-07-23 12:22:27 +01:00
|
|
|
systemd.packages = [ pkgs.do-agent ];
|
2019-09-20 19:00:48 +01:00
|
|
|
|
|
|
|
systemd.services.do-agent = {
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
2020-07-23 12:22:27 +01:00
|
|
|
ExecStart = [ "" "${pkgs.do-agent}/bin/do-agent --syslog" ];
|
|
|
|
DynamicUser = true;
|
2019-09-20 19:00:48 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|