nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 bash,
6 nixosTests,
7}:
8
9buildGoModule rec {
10 pname = "rtl_433-exporter";
11 version = "0.1";
12
13 src = fetchFromGitHub {
14 owner = "mhansen";
15 repo = "rtl_433_prometheus";
16 rev = "v${version}";
17 hash = "sha256-ggtGi1gnpTLGvZnfAW9vyYyU7ELbTRNhXyCMotx+KKU=";
18 };
19
20 postPatch = "substituteInPlace rtl_433_prometheus.go --replace /bin/bash ${bash}/bin/bash";
21
22 vendorHash = "sha256-BsNB0OTwBUu9kK+lSN7EF8ZQH3kFx8P9h4QgcfCvtg4=";
23
24 passthru.tests = { inherit (nixosTests.prometheus-exporters) rtl_433; };
25
26 meta = {
27 description = "Prometheus time-series DB exporter for rtl_433 433MHz radio packet decoder";
28 mainProgram = "rtl_433_prometheus";
29 homepage = "https://github.com/mhansen/rtl_433_prometheus";
30 license = lib.licenses.mit;
31 maintainers = with lib.maintainers; [ zopieux ];
32 };
33}