mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-16 18:37:04 +03:00
26 lines
494 B
Nix
26 lines
494 B
Nix
{ 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 {
|
|
systemd.packages = [ pkgs.do-agent ];
|
|
|
|
systemd.services.do-agent = {
|
|
wantedBy = [ "multi-user.target" ];
|
|
serviceConfig = {
|
|
ExecStart = [ "" "${pkgs.do-agent}/bin/do-agent --syslog" ];
|
|
DynamicUser = true;
|
|
};
|
|
};
|
|
};
|
|
}
|