summary refs log tree commit diff
path: root/nixos/tests/telegraf.nix
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2020-09-08 07:59:50 +0200
committerJörg Thalheim <joerg@thalheim.io>2020-11-14 16:33:46 +0100
commit8edc4619abc884d97583c1ec714c9f7c795fbbac (patch)
tree8b8bac0cd77940df58a52c57a1dedb5a7ecc6925 /nixos/tests/telegraf.nix
parent157d7354d6e66153352e5ef2c054ef4398c67187 (diff)
downloadnixpkgs-8edc4619abc884d97583c1ec714c9f7c795fbbac.tar
nixpkgs-8edc4619abc884d97583c1ec714c9f7c795fbbac.tar.gz
nixpkgs-8edc4619abc884d97583c1ec714c9f7c795fbbac.tar.bz2
nixpkgs-8edc4619abc884d97583c1ec714c9f7c795fbbac.tar.lz
nixpkgs-8edc4619abc884d97583c1ec714c9f7c795fbbac.tar.xz
nixpkgs-8edc4619abc884d97583c1ec714c9f7c795fbbac.tar.zst
nixpkgs-8edc4619abc884d97583c1ec714c9f7c795fbbac.zip
nixos/telegraf: switch to setting types
This allows to split up configuration into multiple modules
Diffstat (limited to 'nixos/tests/telegraf.nix')
-rw-r--r--nixos/tests/telegraf.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/tests/telegraf.nix b/nixos/tests/telegraf.nix
index 73f741b1135..483a5ae7e54 100644
--- a/nixos/tests/telegraf.nix
+++ b/nixos/tests/telegraf.nix
@@ -6,12 +6,15 @@ import ./make-test-python.nix ({ pkgs, ...} : {
 
   machine = { ... }: {
     services.telegraf.enable = true;
+    services.telegraf.environmentFile = pkgs.writeText "secrets" ''
+      SECRET=example
+    '';
     services.telegraf.extraConfig = {
       agent.interval = "1s";
       agent.flush_interval = "1s";
       inputs.exec = {
         commands = [
-          "${pkgs.runtimeShell} -c 'echo example,tag=a i=42i'"
+          "${pkgs.runtimeShell} -c 'echo $SECRET,tag=a i=42i'"
         ];
         timeout = "5s";
         data_format = "influx";