Unverified Commit 6dd5c9ee authored by emilylange's avatar emilylange
Browse files

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
parent 35da8aa7
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -2,10 +2,11 @@
, buildGoModule
, fetchFromGitHub
, fetchYarnDeps
, prefetch-yarn-deps
, grafana-agent
, nix-update-script
, nixosTests
, nodejs
, prefetch-yarn-deps
, stdenv
, systemd
, testers
@@ -89,7 +90,8 @@ buildGoModule rec {
      $out/bin/grafana-agent
  '';

  passthru.tests = {
  passthru = {
    tests = {
      inherit (nixosTests) grafana-agent;
      version = testers.testVersion {
        inherit version;
@@ -97,6 +99,10 @@ buildGoModule rec {
        package = grafana-agent;
      };
    };
    updateScript = nix-update-script { };
    # alias for nix-update to be able to find and update this attribute
    offlineCache = frontendYarnOfflineCache;
  };

  meta = {
    description = "A lightweight subset of Prometheus and more, optimized for Grafana Cloud";