Merge pull request #320795 from NukaDuka/oncall

This commit is contained in:
Sandro 2024-07-04 11:58:38 +02:00 committed by GitHub
commit 21c2debcb8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 9 deletions

View File

@ -2,8 +2,9 @@
grafanaPlugin {
pname = "grafana-oncall-app";
version = "1.5.1";
zipHash = "sha256-3mC4TJ9ACM9e3e6UKI5vaDwXuW6RjbsOQFJU5v0wjk8=";
versionPrefix = "v";
version = "1.7.1";
zipHash = "sha256-G3QZq26fzv6sJ5j7QKdPPXhEj95iounZO+Ak8cXZDLc=";
meta = with lib; {
description = "Developer-friendly incident response for Grafana";
license = licenses.agpl3Only;

View File

@ -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" ]))