about summary refs log tree commit diff
path: root/modules/nixos/promtail.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-04-01 04:39:59 +0300
committerAzat Bahawi <azat@bahawi.net>2023-04-01 04:39:59 +0300
commitf4145939712b0046e5d57906d4b157b8a150614d (patch)
tree3c8d24db6410692e0fa59570ff698d446ae5a96e /modules/nixos/promtail.nix
parent2023-03-23 (diff)
2023-04-01
Diffstat (limited to '')
-rw-r--r--modules/nixos/promtail.nix24
1 files changed, 16 insertions, 8 deletions
diff --git a/modules/nixos/promtail.nix b/modules/nixos/promtail.nix
index a3a6fe9..d52384a 100644
--- a/modules/nixos/promtail.nix
+++ b/modules/nixos/promtail.nix
@@ -10,12 +10,16 @@ in {
   options.nixfiles.modules.promtail = {
     enable = mkEnableOption "Promtail";
 
-    loki = {
-      url = mkOption {
-        description = "Address of a listening Loki service.";
-        type = with types; str;
-        default = "https://${config.nixfiles.modules.loki.domain}";
-      };
+    port = mkOption {
+      description = "Port.";
+      type = with types; port;
+      default = 30181;
+    };
+
+    loki.url = mkOption {
+      description = "Address of a listening Loki service.";
+      type = with types; str;
+      default = "https://${config.nixfiles.modules.loki.domain}";
     };
   };
 
@@ -26,7 +30,7 @@ in {
       configuration = {
         server = rec {
           http_listen_address = this.wireguard.ipv4.address;
-          http_listen_port = 30181;
+          http_listen_port = cfg.port;
 
           grpc_listen_address = this.wireguard.ipv4.address;
           grpc_listen_port = http_listen_port + 1;
@@ -43,7 +47,11 @@ in {
           }
         ];
 
-        positions.filename = "/tmp/positions.yaml";
+        positions = {
+          filename = "/tmp/positions.yaml";
+          sync_period = "15s";
+          ignore_invalid_yaml = true;
+        };
 
         scrape_configs = [
           {

Consider giving Nix/NixOS a try! <3