From 845a6e97845d22be7a20b74b3d39a54e1d719b86 Mon Sep 17 00:00:00 2001 From: IndeedNotJames Date: Thu, 13 Apr 2023 10:43:02 +0200 Subject: [PATCH] nixos/grafana-agent: use `lib.getExe` as binary names changed between updates and `lib.getExe` allows a safe handling and potential backport of this. But for that to work it would require 22.11 to set `pkgs.grafana-agent.meta.mainProgram = "agent"` Relevant upstream release: https://github.com/grafana/agent/releases/tag/v0.31.0 --- nixos/modules/services/monitoring/grafana-agent.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/monitoring/grafana-agent.nix b/nixos/modules/services/monitoring/grafana-agent.nix index 270d888afb78..b7761c34fe51 100644 --- a/nixos/modules/services/monitoring/grafana-agent.nix +++ b/nixos/modules/services/monitoring/grafana-agent.nix @@ -140,7 +140,7 @@ in # We can't use Environment=HOSTNAME=%H, as it doesn't include the domain part. export HOSTNAME=$(< /proc/sys/kernel/hostname) - exec ${cfg.package}/bin/agent -config.expand-env -config.file ${configFile} + exec ${lib.getExe cfg.package} -config.expand-env -config.file ${configFile} ''; serviceConfig = { Restart = "always";