summary refs log tree commit diff
path: root/nixos/modules/services/monitoring
diff options
context:
space:
mode:
authorWilliButz <wbutz@cyberfnord.de>2018-03-19 17:04:39 +0100
committerRobin Gloster <mail@glob.in>2018-03-19 19:59:10 +0100
commitca7b29050fed6283c701148e8135b01d61328379 (patch)
tree32d2c5763d68b246e57db7b70dbf27a8fd055671 /nixos/modules/services/monitoring
parent6f04eec460387a1a1b59e73b748cce379bfd4d5b (diff)
downloadnixlib-ca7b29050fed6283c701148e8135b01d61328379.tar
nixlib-ca7b29050fed6283c701148e8135b01d61328379.tar.gz
nixlib-ca7b29050fed6283c701148e8135b01d61328379.tar.bz2
nixlib-ca7b29050fed6283c701148e8135b01d61328379.tar.lz
nixlib-ca7b29050fed6283c701148e8135b01d61328379.tar.xz
nixlib-ca7b29050fed6283c701148e8135b01d61328379.tar.zst
nixlib-ca7b29050fed6283c701148e8135b01d61328379.zip
grafana: 5.0.2 -> 5.0.3, fix headless phantomjs
Diffstat (limited to 'nixos/modules/services/monitoring')
-rw-r--r--nixos/modules/services/monitoring/grafana.nix14
1 files changed, 13 insertions, 1 deletions
diff --git a/nixos/modules/services/monitoring/grafana.nix b/nixos/modules/services/monitoring/grafana.nix
index 921be23f3681..a5b6dbab1577 100644
--- a/nixos/modules/services/monitoring/grafana.nix
+++ b/nixos/modules/services/monitoring/grafana.nix
@@ -25,6 +25,7 @@ let
     DATABASE_USER = cfg.database.user;
     DATABASE_PASSWORD = cfg.database.password;
     DATABASE_PATH = cfg.database.path;
+    DATABASE_CONN_MAX_LIFETIME = cfg.database.connMaxLifetime;
 
     SECURITY_ADMIN_USER = cfg.security.adminUser;
     SECURITY_ADMIN_PASSWORD = cfg.security.adminPassword;
@@ -143,6 +144,15 @@ in {
         default = "${cfg.dataDir}/data/grafana.db";
         type = types.path;
       };
+
+      connMaxLifetime = mkOption {
+        description = ''
+          Sets the maximum amount of time (in seconds) a connection may be reused.
+          For MySQL this setting should be shorter than the `wait_timeout' variable.
+        '';
+        default = 14400;
+        type = types.int;
+      };
     };
 
     security = {
@@ -241,7 +251,9 @@ in {
       description = "Grafana Service Daemon";
       wantedBy = ["multi-user.target"];
       after = ["networking.target"];
-      environment = mapAttrs' (n: v: nameValuePair "GF_${n}" (toString v)) envOptions;
+      environment = {
+        QT_QPA_PLATFORM = "offscreen";
+      } // mapAttrs' (n: v: nameValuePair "GF_${n}" (toString v)) envOptions;
       serviceConfig = {
         ExecStart = "${cfg.package.bin}/bin/grafana-server -homepath ${cfg.dataDir}";
         WorkingDirectory = cfg.dataDir;