https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
26 lines
821 B
Nix
26 lines
821 B
Nix
{ lib, stdenv, mkDiscoursePlugin, fetchFromGitHub }:
|
|
|
|
mkDiscoursePlugin {
|
|
bundlerEnvArgs.gemdir = ./.;
|
|
name = "discourse-prometheus";
|
|
src = fetchFromGitHub {
|
|
owner = "discourse";
|
|
repo = "discourse-prometheus";
|
|
rev = "43536e4a4977718972a673dc2475ae07df9a0a45";
|
|
sha256 = "sha256-7sQldPLY7YW/sr4WBHWxJVvhvRK0LwO3+52HAIJFvY4=";
|
|
};
|
|
|
|
patches = [
|
|
# The metrics collector tries to run git to get the commit id but fails
|
|
# because we don't run Discourse from a Git repository.
|
|
./no-git-version.patch
|
|
./spec-import-fix-abi-version.patch
|
|
];
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/discourse/discourse-prometheus";
|
|
maintainers = with maintainers; [ dpausp ];
|
|
license = licenses.mit;
|
|
description = "Official Discourse Plugin for Prometheus Monitoring";
|
|
};
|
|
}
|