Compare commits

...

3 commits

Author SHA1 Message Date
60dce8e681
Use alloy on all the most used devices
All checks were successful
EVAL x86_64-linux.picard
BUILD x86_64-linux.picard
UPLOAD x86_64-linux.picard
DOWNLOAD x86_64-linux.picard
CACHIX x86_64-linux.picard
ATTIC x86_64-linux.picard
/ test (push) Successful in 54s
2025-04-29 12:21:31 +02:00
70b61a74ae
New alloy module 2025-04-29 12:21:20 +02:00
84e19cb236
Fix DNS 2025-04-29 12:21:12 +02:00
7 changed files with 58 additions and 5 deletions

View file

@ -33,7 +33,7 @@
"adb"
"binfmt"
"prometheus-exporters"
"promtail"
"alloy"
"syncthing"
"zerotier"
]

View file

@ -40,8 +40,8 @@
"mount-sisko"
"adb"
"prometheus-exporters"
# "promtail"
"zerotier"
"alloy"
]
++ [ ./disko.nix ];

View file

@ -35,7 +35,7 @@
"mount-sisko"
"adb"
"prometheus-exporters"
# "promtail"
"alloy"
"zerotier"
];

View file

@ -21,6 +21,7 @@
"grafana"
"prometheus-exporters"
"loki"
"alloy"
"restic"
"atuin"
"immich"

View file

@ -24,6 +24,7 @@
"battery"
"printing"
"wireguard-client"
"alloy"
];
boot.initrd.availableKernelModules = [

View file

@ -52,8 +52,6 @@ in
networking.defaultGateway = "10.1.1.1";
networking.nameservers = [ "127.0.0.1" ];
environment.persistence."/persist".directories = [
"/var/lib/AdGuardHome"
];

53
modules/alloy/default.nix Normal file
View 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}",
}
}
'';
}