2019-09-20 18:00:48 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.services.do-agent;
|
2020-07-23 11:22:27 +00:00
|
|
|
|
2019-09-20 18:00:48 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options.services.do-agent = {
|
2024-08-29 22:46:56 +00:00
|
|
|
enable = lib.mkEnableOption "do-agent, the DigitalOcean droplet metrics agent";
|
2019-09-20 18:00:48 +00:00
|
|
|
};
|
|
|
|
|
2024-08-29 22:46:56 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
2020-07-23 11:22:27 +00:00
|
|
|
systemd.packages = [ pkgs.do-agent ];
|
2019-09-20 18:00:48 +00:00
|
|
|
|
|
|
|
systemd.services.do-agent = {
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
2020-07-23 11:22:27 +00:00
|
|
|
ExecStart = [ "" "${pkgs.do-agent}/bin/do-agent --syslog" ];
|
|
|
|
DynamicUser = true;
|
2019-09-20 18:00:48 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|