Derp by me - put the allow config call elsehwere it should be.

This commit is contained in:
Root User 2026-02-14 16:54:45 +01:00
parent 6bd1d4a231
commit 458e085964
Signed by: root
GPG key ID: 087F0A95E5766D72

View file

@ -13,38 +13,6 @@
fsType = "ext4";
};
};
environment.etc.alloy.config.alloy = {
text = ''
server:
http_listen_port: 28183
grpc_listen_port: 0
logs:
# keep positions persistent on disk (don't use /tmp in production)
positions:
filename: /var/lib/grafana-agent/positions.yaml
configs:
- name: journal
journal:
# keep similar rotation / lookback to your promtail config
max_age: 12h
labels:
job: systemd-journal
host: chrysalis
clients:
- url: http://127.0.0.1:3100/loki/api/v1/push
relabel_configs:
- source_labels: ["__journal__systemd_unit"]
target_label: "unit"
'';
owner = "root";
group = "root";
mode = "0644";
};
in {
options.local = {
hostname = lib.mkOption {
@ -196,7 +164,6 @@ in {
allow_structured_metadata = false;
};
table_manager = {
retention_deletes_enabled = false;
retention_period = "0s";
@ -208,6 +175,38 @@ in {
enable = true;
};
environment.etc.alloy.config.alloy = {
text = ''
server:
http_listen_port: 28183
grpc_listen_port: 0
logs:
# keep positions persistent on disk (don't use /tmp in production)
positions:
filename: /var/lib/grafana-agent/positions.yaml
configs:
- name: journal
journal:
# keep similar rotation / lookback to your promtail config
max_age: 12h
labels:
job: systemd-journal
host: chrysalis
clients:
- url: http://127.0.0.1:3100/loki/api/v1/push
relabel_configs:
- source_labels: ["__journal__systemd_unit"]
target_label: "unit"
'';
owner = "root";
group = "root";
mode = "0644";
};
# Add a simple systemd service to run the Grafana Agent (Alloy)
systemd.services.grafana-agent = {
description = "Grafana Alloy";
@ -216,7 +215,7 @@ in {
serviceConfig = {
# The grafana-agent binary provided by nixpkgs
ExecStart = ''
${pkgs.grafana-alloy}/bin/alloy
${pkgs.grafana-alloy}/bin/alloy run
'';
Restart = "on-failure";