about summary refs log tree commit diff
path: root/modules/nixos/grafana.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2024-03-31 21:29:27 +0300
committerAzat Bahawi <azat@bahawi.net>2024-03-31 21:29:27 +0300
commit9a5427e3a0c0ccf2a82dc503149a26b23fbd6004 (patch)
treef28beec29deeea36038615a8fb98a810891940b5 /modules/nixos/grafana.nix
parent2024-03-19 (diff)
2024-03-31
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