summary refs log tree commit diff
path: root/pkgs/tools/system/journalbeat/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/system/journalbeat/default.nix')
-rw-r--r--pkgs/tools/system/journalbeat/default.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/tools/system/journalbeat/default.nix b/pkgs/tools/system/journalbeat/default.nix
new file mode 100644
index 000000000000..5a66fcf52990
--- /dev/null
+++ b/pkgs/tools/system/journalbeat/default.nix
@@ -0,0 +1,34 @@
+{ lib, pkgs, buildGoPackage, fetchFromGitHub, makeWrapper }:
+
+let
+
+  libPath = lib.makeLibraryPath [ pkgs.systemd.lib ];
+
+in buildGoPackage rec {
+
+  name = "journalbeat-${version}";
+  version = "5.1.2";
+
+  goPackagePath = "github.com/mheese/journalbeat";
+
+  buildInputs = [ makeWrapper pkgs.systemd ];
+
+  postInstall = ''
+    wrapProgram $bin/bin/journalbeat \
+      --prefix LD_LIBRARY_PATH : ${libPath}
+  '';
+
+  src = fetchFromGitHub {
+    owner = "mheese";
+    repo = "journalbeat";
+    rev = "v${version}";
+    sha256 = "179jayzvd5k4mwhn73yflbzl5md1fmv7a9hb8vz2ir76lvr33g3l";
+  };
+
+  meta = with lib; {
+    homepage = https://github.com/mheese/journalbeat;
+    description = "Journalbeat is a log shipper from systemd/journald to Logstash/Elasticsearch";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ mbrgm ];
+  };
+}