mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 15:13:46 +00:00
23 lines
490 B
Nix
23 lines
490 B
Nix
{ config, lib, pkgs, ... }:
|
|
let
|
|
cfg = config.services.do-agent;
|
|
|
|
in
|
|
{
|
|
options.services.do-agent = {
|
|
enable = lib.mkEnableOption "do-agent, the DigitalOcean droplet metrics agent";
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
systemd.packages = [ pkgs.do-agent ];
|
|
|
|
systemd.services.do-agent = {
|
|
wantedBy = [ "multi-user.target" ];
|
|
serviceConfig = {
|
|
ExecStart = [ "" "${pkgs.do-agent}/bin/do-agent --syslog" ];
|
|
DynamicUser = true;
|
|
};
|
|
};
|
|
};
|
|
}
|