Merge: grafanaPlugins: fix update script/add some interesting data source plugins (#288642)

This commit is contained in:
Maximilian Bosch
2024-10-16 22:55:54 +02:00
committed by GitHub
23 changed files with 325 additions and 15 deletions
@@ -0,0 +1,13 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "bsull-console-datasource";
version = "1.0.1";
zipHash = "sha256-V6D/VIdwwQvG21nVMXD/xF86Uy8WRecL2RjyDTZr1wQ=";
meta = with lib; {
description = "This is a streaming Grafana data source which can connect to the Tokio console subscriber.";
license = licenses.asl20;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -0,0 +1,13 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "fetzerch-sunandmoon-datasource";
version = "0.3.3";
zipHash = "sha256-IJe1OiPt9MxqqPymuH0K27jToSb92M0P4XGZXvk0paE=";
meta = with lib; {
description = "SunAndMoon is a Datasource Plugin for Grafana that calculates the position of Sun and Moon as well as the Moon illumination using SunCalc.";
license = licenses.mit;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -0,0 +1,13 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "frser-sqlite-datasource";
version = "3.5.0";
zipHash = "sha256-BwAurFpMyyR318HMzVXCnOEQWM8W2vPPisXhhklFLBY=";
meta = with lib; {
description = "This is a Grafana backend plugin to allow using an SQLite database as a data source. The SQLite database needs to be accessible to the filesystem of the device where Grafana itself is running.";
license = licenses.asl20;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -2,12 +2,12 @@
grafanaPlugin rec {
pname = "grafana-clickhouse-datasource";
version = "3.3.0";
version = "4.4.0";
zipHash = {
x86_64-linux = "sha256-FkOX/2vPmLtxe/oOISldlVhayy7AwfFxLeiwJ5TNgYY=";
aarch64-linux = "sha256-4rCj+NaKPZbuVohlKmSf1M6n5ng9HZMrwzBCgLPdiok=";
x86_64-darwin = "sha256-bpey6EwwAqXgxjvjJ6ou4rinidHCpUr+Z89YpAZK7z8=";
aarch64-darwin = "sha256-u/U2lu4szf9JFt/zfhGmWKH2OUqpJDNaSI69EDdi1+w=";
x86_64-linux = "sha256-rh+oTJrW7WxLHG7jSkT1Pog+/tqhE+j/0jdbgaHu1a4=";
aarch64-linux = "sha256-uV+WKh3/jBgOwX2lrwC3Q7TGr3/BH83QZhwmtL4G3qo=";
x86_64-darwin = "sha256-Y6Xp4HCYF+Nkw8CNrfEMOtpNgKunMI/4oVqD8Wq5VEI=";
aarch64-darwin = "sha256-x/Z5BA9N5sZurQ5K1NQCYXQPZ/yF1p/372GPIeVU0ps=";
};
meta = with lib; {
description = "Connects Grafana to ClickHouse";
@@ -2,8 +2,8 @@
grafanaPlugin rec {
pname = "grafana-clock-panel";
version = "2.1.3";
zipHash = "sha256-ZedeV/SQsBu55jAxFyyXQefir4hEl1/TQDmaTJN9bag=";
version = "2.1.8";
zipHash = "sha256-QLvq2CSlJuEaYAazn8MoY3XCiXeRILj4dTp/aqrHL/k=";
meta = with lib; {
description = "Clock panel for Grafana";
license = licenses.mit;
@@ -0,0 +1,13 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "grafana-discourse-datasource";
version = "2.0.2";
zipHash = "sha256-0MTxPe7RJHMA0SwjOcFlbi4VkhlLUFP+5r2DsHAaffc=";
meta = with lib; {
description = "The Discourse data source plugin allows users to search and view topics, posts, users, tags, categories, and reports on a given Discourse forum.";
license = licenses.asl20;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -0,0 +1,18 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "grafana-github-datasource";
version = "1.9.0";
zipHash = {
x86_64-linux = "sha256-DQKb8VKa41bL6D9DN8OpL3sqBIlRCa1zgIjduD6AcQc=";
aarch64-linux = "sha256-RHFURMnBF14QCZhVxZQO3JJ3OP6JXD2Hfef8IyVOgBs=";
x86_64-darwin = "sha256-UBwc8CZRRHsEKpzTgn5PNXjxLzETyWKGsDFtXZnkRW4=";
aarch64-darwin = "sha256-xgQ7s3QP7Sq8ni0n54NE/nYlyALIESfXNKncruAWty0=";
};
meta = with lib; {
description = "The GitHub datasource allows GitHub API data to be visually represented in Grafana dashboards.";
license = licenses.asl20;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -0,0 +1,18 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "grafana-googlesheets-datasource";
version = "1.2.14";
zipHash = {
x86_64-linux = "sha256-N4JZ/aWpvezR9daJKU559GXd+FNGmDA4P9CrlC4RFmQ=";
aarch64-linux = "sha256-HZhyg6NhptFib/3JJ8AnSywF+eaZOwiCij3TlMB0YG8=";
x86_64-darwin = "sha256-EwE6w67ARVp/2GE9pSqaD5TuBnsgwsDLZCrEXPfRfUE=";
aarch64-darwin = "sha256-3UGd/t1k6aZsKsQCplLV9klmjQAga19VaopHx330xUs=";
};
meta = with lib; {
description = "The Grafana JSON Datasource plugin empowers you to seamlessly integrate JSON data into Grafana.";
license = licenses.asl20;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -0,0 +1,18 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "grafana-mqtt-datasource";
version = "1.1.0-beta.2";
zipHash = {
x86_64-linux = "sha256-QYv+6zDLSYiB767A3ODgZ1HzPd7Hpa90elKDV1+dNx8=";
aarch64-linux = "sha256-cquaTD3e40vj7PuQDHvODHOpXeWx3AaN6Mv+Vu+ikbI=";
x86_64-darwin = "sha256-PZmUkghYawU5aKA536u3/LCzsvkIFVJIzl1FVWcrKTI=";
aarch64-darwin = "sha256-9FP7UbNI4q4nqRTzlNKcEPnJ9mdqzOL4E0nuEAdFNJw=";
};
meta = with lib; {
description = "The MQTT data source plugin allows you to visualize streaming MQTT data from within Grafana.";
license = licenses.asl20;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -2,9 +2,8 @@
grafanaPlugin {
pname = "grafana-oncall-app";
versionPrefix = "v";
version = "1.8.5";
zipHash = "sha256-HuZYHPTWm0EPKQbmapALK2j+PzM+J7gcWM9w8vU2yI0=";
version = "1.10.2";
zipHash = "sha256-wRgzdPKSA24O4kSDhaO/09uOG6lIoJGWUGOgX1vdjlU=";
meta = with lib; {
description = "Developer-friendly incident response for Grafana";
license = licenses.agpl3Only;
@@ -0,0 +1,18 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "grafana-opensearch-datasource";
version = "2.19.0";
zipHash = {
x86_64-linux = "sha256-jTeiIbaM2wPBTxFyXPQhBXxxzgRZbaXkqeN9+tHgWPc=";
aarch64-linux = "sha256-8ti5CibWbycAO9o3Wse/CuE07JjwV1Quhy/Vm6BDmyM=";
x86_64-darwin = "sha256-6rqdTsYcqjqcXtM20ekJguT42w5dr4EUHvNuRDIU6k0=";
aarch64-darwin = "sha256-Z4ISwwkFJXXdVcLOspAK8euI4yor4Ii08K7zZffY9tM=";
};
meta = with lib; {
description = "The Grafana JSON Datasource plugin empowers you to seamlessly integrate JSON data into Grafana.";
license = licenses.asl20;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -2,8 +2,8 @@
grafanaPlugin rec {
pname = "grafana-polystat-panel";
version = "2.1.4";
zipHash = "sha256-15mi5NzbbWXJ/69VEwUS058atQ+z2g4C3T9/b+/Exwk=";
version = "2.1.13";
zipHash = "sha256-O8YOSVLhJ1hDNbBHKwkikNBOjQTrGofGklVTalgDH4I=";
meta = with lib; {
description = "Hexagonal multi-stat panel for Grafana";
license = licenses.asl20;
@@ -0,0 +1,13 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "marcusolsson-calendar-panel";
version = "3.7.0";
zipHash = "sha256-O8EvkS+lWq2qaIj1HJzPagRGhrEENvY1YDBusvUejM0=";
meta = with lib; {
description = "Calendar Panel is a Grafana plugin that displays events from various data sources.";
license = licenses.asl20;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -0,0 +1,18 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "marcusolsson-csv-datasource";
version = "0.6.19";
zipHash = {
x86_64-linux = "sha256-HCwh8v9UeO7eeESZ78Hj6uvLext/x7bPfACe1u2BqTM=";
aarch64-linux = "sha256-2Qtwe34fe8KlIye3RuuNLjlWWgXGJvAmwWUnZD8LdWE=";
x86_64-darwin = "sha256-6sGA06INQbiRCd23ykdtUWAR+oA3YFh57KBT7zWUP44=";
aarch64-darwin = "sha256-gzQRcPeRqLvl27SB18hTTtcHx/namT2V0NOgX5J1mbs=";
};
meta = with lib; {
description = "The Grafana CSV Datasource plugin is designed to load CSV data into Grafana, expanding your capabilities to visualize and analyze data stored in CSV (Comma-Separated Values) format.";
license = licenses.asl20;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -0,0 +1,13 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "marcusolsson-json-datasource";
version = "1.3.17";
zipHash = "sha256-L1G5s9fEEuvNs5AWXlT00f+dU2/2Rtjm4R3kpFc4NRg=";
meta = with lib; {
description = "The Grafana JSON Datasource plugin empowers you to seamlessly integrate JSON data into Grafana.";
license = licenses.asl20;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -4,16 +4,33 @@
grafanaPlugin = callPackage ./grafana-plugin.nix { };
bsull-console-datasource = callPackage ./bsull-console-datasource { };
doitintl-bigquery-datasource = callPackage ./doitintl-bigquery-datasource { };
fetzerch-sunandmoon-datasource = callPackage ./fetzerch-sunandmoon-datasource { };
frser-sqlite-datasource = callPackage ./frser-sqlite-datasource { };
grafadruid-druid-datasource = callPackage ./grafadruid-druid-datasource { };
grafana-clickhouse-datasource = callPackage ./grafana-clickhouse-datasource { };
grafana-clock-panel = callPackage ./grafana-clock-panel { };
grafana-discourse-datasource = callPackage ./grafana-discourse-datasource { };
grafana-github-datasource = callPackage ./grafana-github-datasource { };
grafana-googlesheets-datasource = callPackage ./grafana-googlesheets-datasource { };
grafana-mqtt-datasource = callPackage ./grafana-mqtt-datasource { };
grafana-oncall-app = callPackage ./grafana-oncall-app { };
grafana-opensearch-datasource = callPackage ./grafana-opensearch-datasource { };
grafana-piechart-panel = callPackage ./grafana-piechart-panel { };
grafana-polystat-panel = callPackage ./grafana-polystat-panel { };
grafana-worldmap-panel = callPackage ./grafana-worldmap-panel { };
marcusolsson-calendar-panel = callPackage ./marcusolsson-calendar-panel { };
marcusolsson-csv-datasource = callPackage ./marcusolsson-csv-datasource { };
marcusolsson-dynamictext-panel = callPackage ./marcusolsson-dynamictext-panel { };
marcusolsson-json-datasource = callPackage ./marcusolsson-json-datasource { };
redis-app = callPackage ./redis-app { };
redis-datasource = callPackage ./redis-datasource { };
redis-explorer-app = callPackage ./redis-explorer-app { };
ventura-psychrometric-panel = callPackage ./ventura-psychrometric-panel { };
volkovlabs-echarts-panel = callPackage ./volkovlabs-echarts-panel { };
volkovlabs-form-panel = callPackage ./volkovlabs-form-panel { };
volkovlabs-rss-datasource = callPackage ./volkovlabs-rss-datasource { };
volkovlabs-variable-panel = callPackage ./volkovlabs-variable-panel { };
yesoreyeram-infinity-datasource = callPackage ./yesoreyeram-infinity-datasource { };
}
@@ -1,8 +1,46 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts
#!nix-shell -i bash -p nix curl jq common-updater-scripts
set -eu -o pipefail
cd "${0%/*}"/../../../../../
readonly plugin_name="$1"
readonly latest_version="$(curl "https://grafana.com/api/plugins/${plugin_name}" | jq -r .version)"
update-source-version "grafanaPlugins.${plugin_name}" "$latest_version"
readonly api_response="$(curl --silent "https://grafana.com/api/plugins/${plugin_name}")"
readonly latest_version="$(echo "$api_response" | jq -r .version)"
update() {
local system="${2:+--system=$2}"
local pkg="$(echo "$api_response" | jq -e .packages.\""$1"\")"
if echo "$pkg" | jq -er .sha256 > /dev/null; then
local hash="$(echo "$pkg" | jq -er .sha256)"
else
# Some packages only have an md5 hash. Download the file for hash computation.
local urlPath="$(echo "$pkg" | jq -er .downloadUrl)"
local hash="$(nix-prefetch-url --type sha256 --name "$plugin_name" "https://grafana.com$urlPath")"
fi
hash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$hash")"
# Set version number to a random number first to force update to happen.
#
# `update-source-version` will exit early if it considers the version number to be the same.
# However we have already downloaded the file and computed the hash, so it makes sense to set
# the newly computed information unconditionally.
#
# As an example of a workflow that was made more complicated than strictly necessary is my own
# attempts to improve this script where I spent multiple hours investigating why the update
# script would refuse to update a hash that I intentionally malformed (in hopes to test the
# operation of this script.)
update-source-version $system "grafanaPlugins.${plugin_name}" $RANDOM "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
update-source-version $system "grafanaPlugins.${plugin_name}" "$latest_version" "$hash"
}
if echo "$api_response" | jq -e .packages.any > /dev/null; then
# the package contains an "any" package, so there should be only one zipHash.
update "any"
else
update "linux-amd64" "x86_64-linux"
update "linux-arm64" "aarch64-linux"
update "darwin-amd64" "x86_64-darwin"
update "darwin-arm64" "aarch64-darwin"
fi
@@ -0,0 +1,18 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "ventura-psychrometric-panel";
version = "4.5.1";
zipHash = "sha256-Y/Eh3eWZkPS8Q1eha7sEJ3wTMI7QxOr7MEbPc25fnGg=";
meta = with lib; {
description = "Grafana plugin to display air conditions on a psychrometric chart.";
license = licenses.bsd3 // {
spdxId = "BSD-3-Clause-LBNL";
url = "https://spdx.org/licenses/BSD-3-Clause-LBNL.html";
fullName = "Lawrence Berkeley National Labs BSD variant license";
shortName = "lbnl-bsd3";
};
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -0,0 +1,13 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "volkovlabs-echarts-panel";
version = "6.4.1";
zipHash = "sha256-RHOfFKplZs0gbD/esvrpXkkPKPfo5R4zjCUJWPpkDNU=";
meta = with lib; {
description = "The Apache ECharts plugin is a visualization panel for Grafana that allows you to incorporate the popular Apache ECharts library into your Grafana dashboard.";
license = licenses.asl20;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -0,0 +1,13 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "volkovlabs-form-panel";
version = "4.6.0";
zipHash = "sha256-ne2dfCr+PBodeaxGfZL0VrAxHLYEAaeQfuZQf2F3s0s=";
meta = with lib; {
description = "The Data Manipulation Panel is the first plugin that allows inserting and updating application data, as well as modifying configuration directly from your Grafana dashboard.";
license = licenses.asl20;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -0,0 +1,13 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "volkovlabs-rss-datasource";
version = "4.2.0";
zipHash = "sha256-+3tgvpH6xlJORqN4Sx7qwzsiQZoLwdarzhx6kHvtOoY=";
meta = with lib; {
description = "The RSS/Atom data source is a plugin for Grafana that retrieves RSS/Atom feeds and allows visualizing them using Dynamic Text and other panels.";
license = licenses.asl20;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -0,0 +1,13 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "volkovlabs-variable-panel";
version = "3.5.0";
zipHash = "sha256-SqMTCdB+8OUo94zJ3eS5NoCeyjc7sdMCR0CTvVe/L1g=";
meta = with lib; {
description = "The Variable panel allows you to have dashboard filters in a separate panel which you can place anywhere on the dashboard.";
license = licenses.asl20;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}
@@ -0,0 +1,18 @@
{ grafanaPlugin, lib }:
grafanaPlugin rec {
pname = "yesoreyeram-infinity-datasource";
version = "2.11.0";
zipHash = {
x86_64-linux = "sha256-p5qLRImAuV8pqbwn+egbGMiPW6xdy8yQoRWdoiE4+B8=";
aarch64-linux = "sha256-gmmFe2TrhPqTQz4aExx/kAgzqCcEvu2Az7SHmpJaMv8=";
x86_64-darwin = "sha256-BuOMpZK+NoJx32f3pqcDI5szIW4bQl3+yFZI9zjzYE8=";
aarch64-darwin = "sha256-ss/HxouKDZYZvF42KWJgMbOh9kSviH5oz6f/mrlcXk8=";
};
meta = with lib; {
description = "Visualize data from JSON, CSV, XML, GraphQL and HTML endpoints in Grafana.";
license = licenses.asl20;
maintainers = with maintainers; [ nagisa ];
platforms = platforms.unix;
};
}