about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorWilliButz <wbutz@cyberfnord.de>2019-08-02 15:34:19 +0200
committerWilliButz <wbutz@cyberfnord.de>2019-08-02 18:50:01 +0200
commit29d765e250760b14b1d3ceb70e949947ea5b91cb (patch)
tree051a8e92c3c53ef1e5bce8167a9fbb81433abeab /nixos
parentafd0dc17d6bbb9d5ee88e3bec56ec02e9a94c6f8 (diff)
downloadnixlib-29d765e250760b14b1d3ceb70e949947ea5b91cb.tar
nixlib-29d765e250760b14b1d3ceb70e949947ea5b91cb.tar.gz
nixlib-29d765e250760b14b1d3ceb70e949947ea5b91cb.tar.bz2
nixlib-29d765e250760b14b1d3ceb70e949947ea5b91cb.tar.lz
nixlib-29d765e250760b14b1d3ceb70e949947ea5b91cb.tar.xz
nixlib-29d765e250760b14b1d3ceb70e949947ea5b91cb.tar.zst
nixlib-29d765e250760b14b1d3ceb70e949947ea5b91cb.zip
nixos/prometheus-wireguard-exporter: use ExecStart instead of script
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/monitoring/prometheus/exporters/wireguard.nix15
1 files changed, 7 insertions, 8 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/exporters/wireguard.nix b/nixos/modules/services/monitoring/prometheus/exporters/wireguard.nix
index 2e6ff3e746e5..aee7cba26384 100644
--- a/nixos/modules/services/monitoring/prometheus/exporters/wireguard.nix
+++ b/nixos/modules/services/monitoring/prometheus/exporters/wireguard.nix
@@ -36,18 +36,17 @@ in {
     };
   };
   serviceOpts = {
-    script = ''
-      ${pkgs.prometheus-wireguard-exporter}/bin/prometheus_wireguard_exporter \
-        -p ${toString cfg.port} \
-        ${optionalString cfg.verbose "-v"} \
-        ${optionalString cfg.singleSubnetPerField "-s"} \
-        ${optionalString (cfg.wireguardConfig != null) "-n ${cfg.wireguardConfig}"}
-    '';
-
     path = [ pkgs.wireguard-tools ];
 
     serviceConfig = {
       AmbientCapabilities = [ "CAP_NET_ADMIN" ];
+      ExecStart = ''
+        ${pkgs.prometheus-wireguard-exporter}/bin/prometheus_wireguard_exporter \
+          -p ${toString cfg.port} \
+          ${optionalString cfg.verbose "-v"} \
+          ${optionalString cfg.singleSubnetPerField "-s"} \
+          ${optionalString (cfg.wireguardConfig != null) "-n ${cfg.wireguardConfig}"}
+      '';
     };
   };
 }