Added loki

This commit is contained in:
2025-07-01 20:13:30 +03:00
parent 1db71da78a
commit f79b8c780e
4 changed files with 57 additions and 5 deletions

View File

@@ -13,6 +13,7 @@
./../nixosModules/wakapi.nix
./../nixosModules/eko.nix
./../nixosModules/grafana.nix
./../nixosModules/loki.nix
];
boot.loader.grub = {

View File

@@ -6,6 +6,7 @@
config = lib.mkIf config.eko.enable {
grafana.enable = true;
loki.enable = true;
users.groups.eko = { };
users.users.eko = {

View File

@@ -10,7 +10,7 @@
config = lib.mkIf config.grafana.enable {
# Open http and https ports to the public
networking.firewall.allowedTCPPorts = [ 443 80 ];
networking.firewall.allowedTCPPorts = [ 443 ];
# Make sure acme module is active for the "kyren.codes" ssl cert
acme.enable = true;
@@ -22,10 +22,6 @@
locations."/".extraConfig = "proxy_set_header Host $host;";
};
sops.secrets.gitea-db-password = {
owner = config.services.gitea.user;
};
services.grafana = {
enable = true;
settings = {

54
nixosModules/loki.nix Normal file
View File

@@ -0,0 +1,54 @@
{ lib, config, ... }: {
imports = [
./acme.nix
];
options = {
loki.enable = lib.mkEnableOption "enables loki";
};
config = lib.mkIf config.loki.enable {
services.loki.enable = true;
services.loki.configuration = {
auth_enabled = false;
server = {
http_listen_port = 3100;
};
common = {
ring = {
instance_addr = "127.0.0.1";
kvstore = {
store = "inmemory";
};
};
replication_factor = 1;
path_prefix = "/var/lib/loki";
};
schema_config = {
configs = [
{
from = "2020-05-15";
store = "tsdb";
object_store = "filesystem";
schema = "v13";
index = {
prefix = "index_";
period = "24h";
};
}
];
};
storage_config = {
filesystem = {
directory = "/var/lib/loki/chunks";
};
};
};
};
}