nixpkgs/nixos/modules/services/monitoring/do-agent.nix

35 lines
870 B
Nix
Raw Normal View History

2019-09-20 20:00:48 +02:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.do-agent;
in
{
options.services.do-agent = {
enable = mkEnableOption "do-agent, the DigitalOcean droplet metrics agent";
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.do-agent ];
systemd.services.do-agent = {
description = "DigitalOcean Droplet Metrics Agent";
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
2019-09-20 20:00:48 +02:00
serviceConfig = {
ExecStart = "${pkgs.do-agent}/bin/do-agent --syslog";
Restart = "always";
OOMScoreAdjust = -900;
SyslogIdentifier = "DigitalOceanAgent";
PrivateTmp = "yes";
ProtectSystem = "full";
ProtectHome = "yes";
NoNewPrivileges = "yes";
2019-10-02 18:30:41 +02:00
DynamicUser = "yes";
2019-09-20 20:00:48 +02:00
};
};
};
}