diff --git a/packages/jellyfin-exporter/default.nix b/packages/jellyfin-exporter/default.nix new file mode 100644 index 00000000..50b0b878 --- /dev/null +++ b/packages/jellyfin-exporter/default.nix @@ -0,0 +1,34 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + ... +}: +buildGoModule (finalAttrs: { + pname = "jellyfin-exporter"; + version = "1.3.5"; + + src = fetchFromGitHub { + owner = "rebelcore"; + repo = "jellyfin_exporter"; + tag = "v${finalAttrs.version}"; + hash = "sha256-TKKP0zBdQiAgWQJ8BKcPOR6I+ZKKwjDBq0r36E0BAVs="; + }; + + # We need to patch the tests since we don't move the binary to `$GOPATH/bin`, but to `$out/bin` instead. + postPatch = '' + substituteInPlace jellyfin_exporter_test.go \ + --replace-fail "GOPATH" "out" + ''; + + vendorHash = "sha256-/VCE2C8EismFg1puajWmBK8qf3hLYXzywA1R/qqAMr0="; + + meta = { + changelog = "https://github.com/rebelcore/jellyfin_exporter/blob/v${finalAttrs.version}/CHANGELOG.md"; + description = "Jellyfin Media System metrics exporter for prometheus"; + homepage = "https://github.com/rebelcore/jellyfin_exporter"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ pyrox0 ]; + mainProgram = "jellyfin_exporter"; + }; +})