Compare commits
3 commits
599690ede5
...
60dce8e681
Author | SHA1 | Date | |
---|---|---|---|
60dce8e681 | |||
70b61a74ae | |||
84e19cb236 |
7 changed files with 58 additions and 5 deletions
|
@ -33,7 +33,7 @@
|
||||||
"adb"
|
"adb"
|
||||||
"binfmt"
|
"binfmt"
|
||||||
"prometheus-exporters"
|
"prometheus-exporters"
|
||||||
"promtail"
|
"alloy"
|
||||||
"syncthing"
|
"syncthing"
|
||||||
"zerotier"
|
"zerotier"
|
||||||
]
|
]
|
||||||
|
|
|
@ -40,8 +40,8 @@
|
||||||
"mount-sisko"
|
"mount-sisko"
|
||||||
"adb"
|
"adb"
|
||||||
"prometheus-exporters"
|
"prometheus-exporters"
|
||||||
# "promtail"
|
|
||||||
"zerotier"
|
"zerotier"
|
||||||
|
"alloy"
|
||||||
]
|
]
|
||||||
++ [ ./disko.nix ];
|
++ [ ./disko.nix ];
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
"mount-sisko"
|
"mount-sisko"
|
||||||
"adb"
|
"adb"
|
||||||
"prometheus-exporters"
|
"prometheus-exporters"
|
||||||
# "promtail"
|
"alloy"
|
||||||
"zerotier"
|
"zerotier"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
"grafana"
|
"grafana"
|
||||||
"prometheus-exporters"
|
"prometheus-exporters"
|
||||||
"loki"
|
"loki"
|
||||||
|
"alloy"
|
||||||
"restic"
|
"restic"
|
||||||
"atuin"
|
"atuin"
|
||||||
"immich"
|
"immich"
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
"battery"
|
"battery"
|
||||||
"printing"
|
"printing"
|
||||||
"wireguard-client"
|
"wireguard-client"
|
||||||
|
"alloy"
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [
|
boot.initrd.availableKernelModules = [
|
||||||
|
|
|
@ -52,8 +52,6 @@ in
|
||||||
|
|
||||||
networking.defaultGateway = "10.1.1.1";
|
networking.defaultGateway = "10.1.1.1";
|
||||||
|
|
||||||
networking.nameservers = [ "127.0.0.1" ];
|
|
||||||
|
|
||||||
environment.persistence."/persist".directories = [
|
environment.persistence."/persist".directories = [
|
||||||
"/var/lib/AdGuardHome"
|
"/var/lib/AdGuardHome"
|
||||||
];
|
];
|
||||||
|
|
53
modules/alloy/default.nix
Normal file
53
modules/alloy/default.nix
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
services.alloy = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
environment.etc."alloy/config.alloy".text = ''
|
||||||
|
local.file_match "local_files" {
|
||||||
|
path_targets = [{
|
||||||
|
__path__ = "/var/log/*.log",
|
||||||
|
}]
|
||||||
|
sync_period = "5s"
|
||||||
|
}
|
||||||
|
|
||||||
|
loki.source.journal "systemd" {
|
||||||
|
max_age = "24h"
|
||||||
|
forward_to = [loki.write.default.receiver]
|
||||||
|
}
|
||||||
|
|
||||||
|
loki.source.journal "kernel" {
|
||||||
|
max_age = "24h"
|
||||||
|
forward_to = [loki.write.default.receiver]
|
||||||
|
}
|
||||||
|
|
||||||
|
loki.relabel "nixfleet_journal" {
|
||||||
|
forward_to = []
|
||||||
|
rule {
|
||||||
|
source_labels = ["__journal__systemd_unit"]
|
||||||
|
target_label = "systemd_unit"
|
||||||
|
}
|
||||||
|
rule {
|
||||||
|
source_labels = ["__journal_syslog_identifier"]
|
||||||
|
target_label = "syslog_identifier"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loki.source.journal "nixfleet_journal" {
|
||||||
|
forward_to = [loki.write.default.receiver]
|
||||||
|
relabel_rules = loki.relabel.nixfleet_journal.rules
|
||||||
|
format_as_json = true
|
||||||
|
}
|
||||||
|
|
||||||
|
loki.write "default" {
|
||||||
|
endpoint {
|
||||||
|
url = "http://sisko.wg.aciceri.dev:${
|
||||||
|
builtins.toString config.services.loki.configuration.server.http_listen_port or 3100
|
||||||
|
}/loki/api/v1/push"
|
||||||
|
}
|
||||||
|
external_labels = {
|
||||||
|
host = "${config.networking.hostName}",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue