grafana-agent: add passthru.updateScript

`nix-update` has support for `fetchYarnDeps` via the attribute name
`offlineCache`.

Our yarn FOD is called `frontendYarnOfflineCache`, which I find more
descriptive and would like to keep this way.

To work around this requirement, this adds an alias in `passthru`.

The addition of `passthru.updateScript` also allows `nixpkgs-update` to
update this package when the yarn FOD hash needs to be updated.

See the following error from the last `nixpkgs-update` run:
https://r.ryantm.com/log/grafana-agent/2024-02-27.log
This commit is contained in:
emilylange 2024-02-28 18:22:34 +01:00
parent 35da8aa794
commit 6dd5c9ee3f
No known key found for this signature in database
GPG Key ID: 0AD773CE46FD0F87

View File

@ -2,10 +2,11 @@
, buildGoModule
, fetchFromGitHub
, fetchYarnDeps
, prefetch-yarn-deps
, grafana-agent
, nix-update-script
, nixosTests
, nodejs
, prefetch-yarn-deps
, stdenv
, systemd
, testers
@ -89,13 +90,18 @@ buildGoModule rec {
$out/bin/grafana-agent
'';
passthru.tests = {
inherit (nixosTests) grafana-agent;
version = testers.testVersion {
inherit version;
command = "${lib.getExe grafana-agent} --version";
package = grafana-agent;
passthru = {
tests = {
inherit (nixosTests) grafana-agent;
version = testers.testVersion {
inherit version;
command = "${lib.getExe grafana-agent} --version";
package = grafana-agent;
};
};
updateScript = nix-update-script { };
# alias for nix-update to be able to find and update this attribute
offlineCache = frontendYarnOfflineCache;
};
meta = {