also refactor nixos modules
This commit is contained in:
parent
2471562583
commit
b37c5c0cbd
44 changed files with 10 additions and 2 deletions
|
|
@ -1,64 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
|
||||
cfg = config.sneeuwvlok.services.observability.promtail;
|
||||
in {
|
||||
options.sneeuwvlok.services.observability.promtail = {
|
||||
enable = mkEnableOption "enable Grafana Promtail";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.promtail = {
|
||||
enable = true;
|
||||
|
||||
# Ensures proper permissions
|
||||
extraFlags = [
|
||||
"-config.expand-env=true"
|
||||
];
|
||||
|
||||
configuration = {
|
||||
server = {
|
||||
http_listen_port = 9004;
|
||||
grpc_listen_port = 0;
|
||||
};
|
||||
|
||||
positions = {
|
||||
filename = "filename";
|
||||
};
|
||||
|
||||
clients = [
|
||||
{
|
||||
url = "http://[::1]:9003/loki/api/v1/push";
|
||||
}
|
||||
];
|
||||
|
||||
scrape_configs = [
|
||||
{
|
||||
job_name = "journal";
|
||||
journal = {
|
||||
max_age = "12h";
|
||||
labels = {
|
||||
job = "systemd-journal";
|
||||
host = "ulmo";
|
||||
};
|
||||
};
|
||||
relabel_configs = [
|
||||
{
|
||||
source_labels = ["__journal__systemd_unit"];
|
||||
target_label = "unit";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [9004];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue