grafana: fix frontend build on aarch64

I think it works on x86_64 because it fallback to the prebuilt version and they only added prebuilt ARM binaries in 2.2.0 062bca4887
- @tgerbet
This commit is contained in:
K900 2024-01-28 15:36:21 +03:00
parent cd86fce709
commit 905bcfabe1

View File

@ -1,6 +1,6 @@
{ lib, stdenv, buildGoModule, fetchFromGitHub, removeReferencesTo
, tzdata, wire
, yarn, nodejs, cacert
, yarn, nodejs, python3, cacert
, jq, moreutils
, nix-update-script, nixosTests
}:
@ -74,7 +74,7 @@ buildGoModule rec {
vendorHash = "sha256-Gf2A22d7/8xU/ld7kveqGonVKGFCArGNansPRGhfyXM=";
nativeBuildInputs = [ wire yarn jq moreutils removeReferencesTo ];
nativeBuildInputs = [ wire yarn jq moreutils removeReferencesTo python3 ];
postPatch = ''
${patchAwayGrafanaE2E}
@ -121,6 +121,14 @@ buildGoModule rec {
# Setup node_modules
export HOME="$(mktemp -d)"
# Help node-gyp find Node.js headers
# (see https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/javascript.section.md#pitfalls-javascript-yarn2nix-pitfalls)
mkdir -p $HOME/.node-gyp/${nodejs.version}
echo 9 > $HOME/.node-gyp/${nodejs.version}/installVersion
ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version}
export npm_config_nodedir=${nodejs}
yarn config set enableTelemetry 0
yarn config set cacheFolder $offlineCache
yarn --immutable-cache