about summary refs log tree commit diff
path: root/pkgs/servers/monitoring/grafana
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/monitoring/grafana')
-rw-r--r--pkgs/servers/monitoring/grafana/default.nix45
-rw-r--r--pkgs/servers/monitoring/grafana/plugins/grafana-oncall-app/default.nix5
-rw-r--r--pkgs/servers/monitoring/grafana/plugins/grafana-plugin.nix14
3 files changed, 22 insertions, 42 deletions
diff --git a/pkgs/servers/monitoring/grafana/default.nix b/pkgs/servers/monitoring/grafana/default.nix
index 927a011ded284..a26d3418e075d 100644
--- a/pkgs/servers/monitoring/grafana/default.nix
+++ b/pkgs/servers/monitoring/grafana/default.nix
@@ -3,26 +3,12 @@
 , yarn, nodejs, python3, cacert
 , jq, moreutils
 , nix-update-script, nixosTests, xcbuild
-, util-linux
+, faketty
 }:
 
-let
-  # We need dev dependencies to run webpack, but patch away
-  # `cypress` (and @grafana/e2e which has a direct dependency on cypress).
-  # This attempts to download random blobs from the Internet in
-  # postInstall. Also, it's just a testing framework, so not worth the hassle.
-  patchAwayGrafanaE2E = ''
-    find . -name package.json | while IFS=$'\n' read -r pkg_json; do
-      <"$pkg_json" jq '. + {
-        "devDependencies": .devDependencies | del(."@grafana/e2e") | del(.cypress)
-      }' | sponge "$pkg_json"
-    done
-    rm -r packages/grafana-e2e
-  '';
-in
 buildGoModule rec {
   pname = "grafana";
-  version = "11.0.0";
+  version = "11.1.3";
 
   subPackages = [ "pkg/cmd/grafana" "pkg/cmd/grafana-server" "pkg/cmd/grafana-cli" ];
 
@@ -30,11 +16,13 @@ buildGoModule rec {
     owner = "grafana";
     repo = "grafana";
     rev = "v${version}";
-    hash = "sha256-cC1dpgb8IiyPIqlVvn8Qi1l7j6lLtQF+BOOO+DQCp4E=";
+    hash = "sha256-PfkKBKegMk+VjVJMocGj+GPTuUJipjD8+857skwmoco=";
   };
 
   # borrowed from: https://github.com/NixOS/nixpkgs/blob/d70d9425f49f9aba3c49e2c389fe6d42bac8c5b0/pkgs/development/tools/analysis/snyk/default.nix#L20-L22
-  env = lib.optionalAttrs (stdenv.isDarwin && stdenv.isx86_64) {
+  env = {
+    CYPRESS_INSTALL_BINARY = 0;
+  } // lib.optionalAttrs (stdenv.isDarwin && stdenv.isx86_64) {
     # Fix error: no member named 'aligned_alloc' in the global namespace.
     # Occurs while building @esfx/equatable@npm:1.0.2 on x86_64-darwin
     NIX_CFLAGS_COMPILE = "-D_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION=1";
@@ -48,9 +36,6 @@ buildGoModule rec {
       jq moreutils python3
     # @esfx/equatable@npm:1.0.2 fails to build on darwin as it requires `xcbuild`
     ] ++ lib.optionals stdenv.isDarwin [ xcbuild.xcbuild ];
-    postPatch = ''
-      ${patchAwayGrafanaE2E}
-    '';
     buildPhase = ''
       runHook preBuild
       export HOME="$(mktemp -d)"
@@ -66,24 +51,21 @@ buildGoModule rec {
     dontFixup = true;
     outputHashMode = "recursive";
     outputHash = rec {
-      x86_64-linux = "sha256-+Udq8oQSIAHku55VKnrfgHHevzBels0QiOZwnwuts8k=";
+      x86_64-linux = "sha256-2VnhZBWLdYQhqKCxM63fCAwQXN4Zrh2wCdPBLCCUuvg=";
       aarch64-linux = x86_64-linux;
-      aarch64-darwin = "sha256-m3jtZNz0J2nZwFHXVp3ApgDfnGBOJvFeUpqOPQqv200=";
+      aarch64-darwin = "sha256-MZE3/PHynL6SHOxJgOG41pi2X8XeutruAOyUFY9Lmsc=";
       x86_64-darwin = aarch64-darwin;
     }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
   };
 
   disallowedRequisites = [ offlineCache ];
 
-  vendorHash = "sha256-kcdW6RQghyAOZUDmIo9G6YBC+YaLHdafvj+fCd+dcDE=";
+  vendorHash = "sha256-vd3hb7+lmhQPTZO/Xqi59XSPGj5sd218xQAD1bRbUz8=";
 
   proxyVendor = true;
 
-  nativeBuildInputs = [ wire yarn jq moreutils removeReferencesTo python3 ] ++ lib.optionals stdenv.isDarwin [ xcbuild.xcbuild ];
-
-  postPatch = ''
-    ${patchAwayGrafanaE2E}
-  '';
+  nativeBuildInputs = [ wire yarn jq moreutils removeReferencesTo python3 faketty ]
+    ++ lib.optionals stdenv.isDarwin [ xcbuild.xcbuild ];
 
   postConfigure = ''
     # Generate DI code that's required to compile the package.
@@ -115,7 +97,7 @@ buildGoModule rec {
     # After having built all the Go code, run the JS builders now.
 
     # Workaround for https://github.com/nrwl/nx/issues/22445
-    ${util-linux}/bin/script -c 'yarn run build' /dev/null
+    faketty yarn run build
     yarn run plugins:build-bundled
   '';
 
@@ -156,8 +138,5 @@ buildGoModule rec {
     maintainers = with maintainers; [ offline fpletz willibutz globin ma27 Frostman ];
     platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
     mainProgram = "grafana-server";
-    # requires util-linux to work around https://github.com/nrwl/nx/issues/22445
-    # `script` doesn't seem to be part of util-linux on Darwin though.
-    broken = stdenv.isDarwin;
   };
 }
diff --git a/pkgs/servers/monitoring/grafana/plugins/grafana-oncall-app/default.nix b/pkgs/servers/monitoring/grafana/plugins/grafana-oncall-app/default.nix
index 6f475f49cfa7f..a1d67c5283a51 100644
--- a/pkgs/servers/monitoring/grafana/plugins/grafana-oncall-app/default.nix
+++ b/pkgs/servers/monitoring/grafana/plugins/grafana-oncall-app/default.nix
@@ -2,8 +2,9 @@
 
 grafanaPlugin {
   pname = "grafana-oncall-app";
-  version = "1.5.1";
-  zipHash = "sha256-3mC4TJ9ACM9e3e6UKI5vaDwXuW6RjbsOQFJU5v0wjk8=";
+  versionPrefix = "v";
+  version = "1.8.5";
+  zipHash = "sha256-HuZYHPTWm0EPKQbmapALK2j+PzM+J7gcWM9w8vU2yI0=";
   meta = with lib; {
     description = "Developer-friendly incident response for Grafana";
     license = licenses.agpl3Only;
diff --git a/pkgs/servers/monitoring/grafana/plugins/grafana-plugin.nix b/pkgs/servers/monitoring/grafana/plugins/grafana-plugin.nix
index 57af5d2654527..2351df623a561 100644
--- a/pkgs/servers/monitoring/grafana/plugins/grafana-plugin.nix
+++ b/pkgs/servers/monitoring/grafana/plugins/grafana-plugin.nix
@@ -1,14 +1,14 @@
 { stdenvNoCC, fetchurl, unzip, lib }:
 
-{ pname, version, zipHash, meta ? {}, passthru ? {}, ... }@args:
+{ pname, versionPrefix ? "", version, zipHash, meta ? {}, passthru ? {}, ... }@args:
 let plat = stdenvNoCC.hostPlatform.system; in stdenvNoCC.mkDerivation ({
-  inherit pname version;
+  inherit pname versionPrefix version;
 
   src = if lib.isAttrs zipHash then
     fetchurl {
-      name = "${pname}-${version}-${plat}.zip";
+      name = "${pname}-${versionPrefix}${version}-${plat}.zip";
       hash = zipHash.${plat} or (throw "Unsupported system: ${plat}");
-      url = "https://grafana.com/api/plugins/${pname}/versions/${version}/download" + {
+      url = "https://grafana.com/api/plugins/${pname}/versions/${versionPrefix}${version}/download" + {
         x86_64-linux = "?os=linux&arch=amd64";
         aarch64-linux = "?os=linux&arch=arm64";
         x86_64-darwin = "?os=darwin&arch=amd64";
@@ -17,9 +17,9 @@ let plat = stdenvNoCC.hostPlatform.system; in stdenvNoCC.mkDerivation ({
     }
   else
     fetchurl {
-      name = "${pname}-${version}.zip";
+      name = "${pname}-${versionPrefix}${version}.zip";
       hash = zipHash;
-      url = "https://grafana.com/api/plugins/${pname}/versions/${version}/download";
+      url = "https://grafana.com/api/plugins/${pname}/versions/${versionPrefix}${version}/download";
     }
   ;
 
@@ -38,4 +38,4 @@ let plat = stdenvNoCC.hostPlatform.system; in stdenvNoCC.mkDerivation ({
   meta = {
     homepage = "https://grafana.com/grafana/plugins/${pname}";
   } // meta;
-} // (builtins.removeAttrs args [ "zipHash" "pname" "version" "sha256" "meta" ]))
+} // (builtins.removeAttrs args [ "zipHash" "pname" "versionPrefix" "version" "sha256" "meta" ]))