nixos/do-agent: use .service from upstream

This commit is contained in:
Peter Hoeg 2020-07-23 19:22:27 +08:00
parent 961cc80742
commit e0589ec65b

View File

@ -4,6 +4,7 @@ with lib;
let let
cfg = config.services.do-agent; cfg = config.services.do-agent;
in in
{ {
options.services.do-agent = { options.services.do-agent = {
@ -11,23 +12,13 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.do-agent ]; systemd.packages = [ pkgs.do-agent ];
systemd.services.do-agent = { systemd.services.do-agent = {
description = "DigitalOcean Droplet Metrics Agent";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.do-agent}/bin/do-agent --syslog"; ExecStart = [ "" "${pkgs.do-agent}/bin/do-agent --syslog" ];
Restart = "always"; DynamicUser = true;
OOMScoreAdjust = -900;
SyslogIdentifier = "DigitalOceanAgent";
PrivateTmp = "yes";
ProtectSystem = "full";
ProtectHome = "yes";
NoNewPrivileges = "yes";
DynamicUser = "yes";
}; };
}; };
}; };