From cc56dc078d9855e8ba5ba374f75235e9829d5754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 15 Apr 2021 20:34:10 +0200 Subject: [PATCH 1/2] nixos/telegraf: don't run as nogroup --- nixos/modules/services/monitoring/telegraf.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/modules/services/monitoring/telegraf.nix b/nixos/modules/services/monitoring/telegraf.nix index bc30ca3b77cf..176a1635b587 100644 --- a/nixos/modules/services/monitoring/telegraf.nix +++ b/nixos/modules/services/monitoring/telegraf.nix @@ -73,6 +73,7 @@ in { ExecReload="${pkgs.coreutils}/bin/kill -HUP $MAINPID"; RuntimeDirectory = "telegraf"; User = "telegraf"; + Group = "telegraf"; Restart = "on-failure"; # for ping probes AmbientCapabilities = [ "CAP_NET_RAW" ]; @@ -81,7 +82,10 @@ in { users.users.telegraf = { uid = config.ids.uids.telegraf; + group = "telegraf"; description = "telegraf daemon user"; }; + + users.groups.telegraf = {}; }; } From c24fa221abfe606ccfde6d0aa73662385c9d3a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 22 Jun 2021 09:07:35 +0200 Subject: [PATCH 2/2] nixos/telegraf: improve documentation --- nixos/modules/services/monitoring/telegraf.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/monitoring/telegraf.nix b/nixos/modules/services/monitoring/telegraf.nix index 176a1635b587..4046260c1649 100644 --- a/nixos/modules/services/monitoring/telegraf.nix +++ b/nixos/modules/services/monitoring/telegraf.nix @@ -25,10 +25,9 @@ in { default = []; example = "/run/keys/telegraf.env"; description = '' - File to load as environment file. Environment variables - from this file will be interpolated into the config file - using envsubst with this syntax: - $ENVIRONMENT ''${VARIABLE} + File to load as environment file. Environment variables from this file + will be interpolated into the config file using envsubst with this + syntax: $ENVIRONMENT or ''${VARIABLE}. This is useful to avoid putting secrets into the nix store. ''; };