From e3c1ecf11155902c59909bc3862536f474d00b1e Mon Sep 17 00:00:00 2001 From: yvt Date: Thu, 3 Oct 2019 01:30:41 +0900 Subject: nixos/do-agent: Use DynamicUser --- nixos/modules/services/monitoring/do-agent.nix | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'nixos/modules/services/monitoring/do-agent.nix') diff --git a/nixos/modules/services/monitoring/do-agent.nix b/nixos/modules/services/monitoring/do-agent.nix index a03c33303481..a9471994e327 100644 --- a/nixos/modules/services/monitoring/do-agent.nix +++ b/nixos/modules/services/monitoring/do-agent.nix @@ -8,18 +8,6 @@ in { options.services.do-agent = { enable = mkEnableOption "do-agent, the DigitalOcean droplet metrics agent"; - - user = mkOption { - type = types.str; - default = "do-agent"; - description = "User account under which do-agent runs."; - }; - - group = mkOption { - type = types.str; - default = "do-agent"; - description = "Group account under which do-agent runs."; - }; }; config = mkIf cfg.enable { @@ -38,16 +26,8 @@ in ProtectSystem = "full"; ProtectHome = "yes"; NoNewPrivileges = "yes"; + DynamicUser = "yes"; }; }; - - users.users = optionalAttrs (cfg.user == "do-agent") (singleton - { name = "do-agent"; - group = cfg.group; - }); - - users.groups = optionalAttrs (cfg.group == "do-agent") (singleton - { name = "do-agent"; - }); }; } -- cgit 1.4.1