diff options
Diffstat (limited to 'pkgs/servers/monitoring/grafana/default.nix')
-rw-r--r-- | pkgs/servers/monitoring/grafana/default.nix | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/pkgs/servers/monitoring/grafana/default.nix b/pkgs/servers/monitoring/grafana/default.nix index 927a011ded284..ad285956866a4 100644 --- a/pkgs/servers/monitoring/grafana/default.nix +++ b/pkgs/servers/monitoring/grafana/default.nix @@ -3,26 +3,22 @@ , 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 + # Grafana seems to just set it to the latest version available + # nowadays. + patchGoVersion = '' + substituteInPlace go.{mod,work} pkg/build/wire/go.mod \ + --replace-fail "go 1.22.4" "go 1.22.3" + substituteInPlace Makefile \ + --replace-fail "GO_VERSION = 1.22.4" "GO_VERSION = 1.22.3" ''; in buildGoModule rec { pname = "grafana"; - version = "11.0.0"; + version = "11.1.0"; subPackages = [ "pkg/cmd/grafana" "pkg/cmd/grafana-server" "pkg/cmd/grafana-cli" ]; @@ -30,11 +26,13 @@ buildGoModule rec { owner = "grafana"; repo = "grafana"; rev = "v${version}"; - hash = "sha256-cC1dpgb8IiyPIqlVvn8Qi1l7j6lLtQF+BOOO+DQCp4E="; + hash = "sha256-iTTT10YN8jBT4/ukGXNK1QHcyzXnAqg2LiFtNiwnENw="; }; # 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"; @@ -49,7 +47,7 @@ buildGoModule rec { # @esfx/equatable@npm:1.0.2 fails to build on darwin as it requires `xcbuild` ] ++ lib.optionals stdenv.isDarwin [ xcbuild.xcbuild ]; postPatch = '' - ${patchAwayGrafanaE2E} + ${patchGoVersion} ''; buildPhase = '' runHook preBuild @@ -66,23 +64,24 @@ 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-Ny/SoelFVPvBBn50QpHcLTuVY3ynKbCegM1uQkJzB9Y="; proxyVendor = true; - nativeBuildInputs = [ wire yarn jq moreutils removeReferencesTo python3 ] ++ lib.optionals stdenv.isDarwin [ xcbuild.xcbuild ]; + nativeBuildInputs = [ wire yarn jq moreutils removeReferencesTo python3 faketty ] + ++ lib.optionals stdenv.isDarwin [ xcbuild.xcbuild ]; postPatch = '' - ${patchAwayGrafanaE2E} + ${patchGoVersion} ''; postConfigure = '' @@ -115,7 +114,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 +155,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; }; } |