Merge pull request #93699 from NixOS/f/do
nixos/do-agent: use .service from upstream
This commit is contained in:
commit
e3d45be66f
@ -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";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -18,6 +18,10 @@ buildGoModule rec {
|
|||||||
|
|
||||||
vendorSha256 = null;
|
vendorSha256 = null;
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
install -Dm444 -t $out/lib/systemd/system $src/packaging/etc/systemd/system/do-agent.service
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "DigitalOcean droplet system metrics agent";
|
description = "DigitalOcean droplet system metrics agent";
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
@ -30,4 +34,4 @@ buildGoModule rec {
|
|||||||
maintainers = with maintainers; [ yvt ];
|
maintainers = with maintainers; [ yvt ];
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user