27 lines
628 B
Nix
27 lines
628 B
Nix
# Module: roles/logserver
|
|
# Enables the usage of a logserver with traefik, loki, and prometheus
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let cfg = config.logserver;
|
|
in {
|
|
options.logserver = { enable = mkEnableOption "Enables logserver role"; };
|
|
|
|
config = mkIf cfg.enable {
|
|
environment.systemPackages = with pkgs; [ loki prometheus ];
|
|
|
|
# Config is generated using Ansible
|
|
services.loki = {
|
|
enable = true;
|
|
configFile = /etc/loki/loki.yaml;
|
|
};
|
|
|
|
# Config is generated declaratively
|
|
services.prometheus = { };
|
|
enable = true;
|
|
enableReload = true;
|
|
checkConfig = "syntax-only";
|
|
};
|
|
}
|