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
This commit is contained in:
IndeedNotJames 2023-04-13 10:43:02 +02:00
parent bde538be9f
commit 845a6e9784
No known key found for this signature in database
GPG key ID: 0AD773CE46FD0F87

View file

@ -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";