Fix the Grafana Alloy

This commit is contained in:
Root User 2026-02-14 16:48:24 +01:00
parent 9363dc3b36
commit 21bf4848bb
Signed by: root
GPG key ID: 087F0A95E5766D72

View file

@ -210,19 +210,13 @@ in {
# Add a simple systemd service to run the Grafana Agent (Alloy)
systemd.services.grafana-agent = {
description = "Grafana Alloy - journal -> loki";
description = "Grafana Alloy";
wantedBy = ["multi-user.target"];
serviceConfig = {
# Ensure persistent dir for positions exists
ExecStartPre = ''
mkdir -p /var/lib/grafana-agent
chown root:root /var/lib/grafana-agent
'';
# The grafana-agent binary provided by nixpkgs
ExecStart = ''
${pkgs.grafana-alloy}/bin/grafana-alloy --config.file /etc/alloy/config.alloy
${pkgs.grafana-alloy}/bin/alloy --config.file /etc/alloy/config.alloy
'';
Restart = "on-failure";