about summary refs log tree commit diff
path: root/modules/nixos/grafana.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/nixos/grafana.nix19
1 files changed, 11 insertions, 8 deletions
diff --git a/modules/nixos/grafana.nix b/modules/nixos/grafana.nix
index 2f32225..233c9e5 100644
--- a/modules/nixos/grafana.nix
+++ b/modules/nixos/grafana.nix
@@ -5,9 +5,11 @@
   libNginx,
   ...
 }:
-with lib; let
+with lib;
+let
   cfg = config.nixfiles.modules.grafana;
-in {
+in
+{
   options.nixfiles.modules.grafana = {
     enable = mkEnableOption "Grafana";
 
@@ -24,11 +26,12 @@ in {
     };
   };
 
-  config = let
-    db = "grafana";
-  in
+  config =
+    let
+      db = "grafana";
+    in
     mkIf cfg.enable {
-      ark.directories = [config.services.grafana.dataDir];
+      ark.directories = [ config.services.grafana.dataDir ];
 
       secrets = {
         grafana-key = {
@@ -51,7 +54,7 @@ in {
       nixfiles.modules = {
         nginx = {
           enable = true;
-          upstreams.grafana.servers."127.0.0.1:${toString cfg.port}" = {};
+          upstreams.grafana.servers."127.0.0.1:${toString cfg.port}" = { };
           virtualHosts.${cfg.domain} = {
             locations."/" = {
               proxyPass = "http://grafana";
@@ -109,7 +112,7 @@ in {
         };
 
         postgresql = {
-          ensureDatabases = [db];
+          ensureDatabases = [ db ];
           ensureUsers = [
             {
               name = db;

Consider giving Nix/NixOS a try! <3