1 { lib, mkYarnPackage, fetchFromGitHub, fetchYarnDeps, nodejs, runtimeShell }:
3 # Notes for the upgrade:
4 # * Download the tarball of the new version to use.
5 # * Replace new `package.json` here.
6 # * Update `version`+`hash` and rebuild.
9 pname = "grafana-image-renderer";
12 src = fetchFromGitHub {
14 repo = "grafana-image-renderer";
16 hash = "sha256-GL9uJV4/j3tcD9DMoBuO/59OsfG+njc2FH1Bt3VP7K8=";
19 offlineCache = fetchYarnDeps {
20 yarnLock = src + "/yarn.lock";
21 hash = "sha256-xgaaIY5Jy8JTSJVGHwPOYgh+fASSPiyoUcmLN516jic=";
24 packageJSON = ./package.json;
44 install_path="$out/libexec/grafana-image-renderer"
45 mkdir -p $install_path
46 cp -R ../../node_modules $install_path
47 cp -R ./!(node_modules) $install_path
51 cat >$out/bin/grafana-image-renderer <<EOF
53 ${nodejs}/bin/node $install_path/build/app.js \$@
55 chmod +x $out/bin/grafana-image-renderer
61 homepage = "https://github.com/grafana/grafana-image-renderer";
62 description = "A Grafana backend plugin that handles rendering of panels & dashboards to PNGs using headless browser (Chromium/Chrome)";
63 mainProgram = "grafana-image-renderer";
64 license = licenses.asl20;
65 maintainers = with maintainers; [ ma27 ];
66 platforms = platforms.all;