summaryrefslogtreecommitdiff
path: root/os/srv/loki.nix
diff options
context:
space:
mode:
authoradikro <adikro@disroot.org>2026-06-17 00:28:00 +0200
committeradikro <adikro@disroot.org>2026-06-17 00:28:00 +0200
commit630da5d0639cada53e26a03f579df0a7bac3b17a (patch)
tree73edd6ea30331d807413d548f9559d89acc38a82 /os/srv/loki.nix
parentce7fb7ddd3267291a8d692cc6381dad606288aa5 (diff)
librewolf manual compilation issue
Diffstat (limited to 'os/srv/loki.nix')
-rw-r--r--os/srv/loki.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/os/srv/loki.nix b/os/srv/loki.nix
new file mode 100644
index 0000000..2388432
--- /dev/null
+++ b/os/srv/loki.nix
@@ -0,0 +1,57 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+let
+ cfg = config.os.srv.loki;
+in
+{
+ options.os.srv.loki.enable = lib.mkEnableOption "enables loki";
+ config = lib.mkIf cfg.enable {
+ services.loki = {
+ enable = true;
+ configFile = pkgs.writeText "loki-config.yaml" (
+ builtins.toJSON {
+ auth_enabled = false;
+ server = {
+ http_listen_port = 3100;
+ };
+ common = {
+ ring = {
+ kvstore = {
+ store = "inmemory";
+ };
+ };
+ instance_interface_names = [ "lo" ];
+ };
+ ingester = {
+ lifecycler = {
+ address = "127.0.0.1";
+ };
+ };
+ storage_config = {
+ filesystem = {
+ directory = "/var/lib/loki/chunks";
+ };
+ };
+ schema_config = {
+ configs = [
+ {
+ from = "2020-10-24";
+ store = "tsdb";
+ object_store = "filesystem";
+ schema = "v13";
+ index = {
+ prefix = "index_";
+ period = "24h";
+ };
+ }
+ ];
+ };
+ }
+ );
+ };
+ };
+}