diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2021-03-08 13:09:01 -0500 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2021-03-08 13:09:01 -0500 |
commit | 1c99c911408c89b163bc3358e30364fb368fb877 (patch) | |
tree | c98b021eb6d310c0b4ad2fb202c0412b043f9b25 | |
parent | fd4a598fbf2180016199c249b3cd9a3bc8263d06 (diff) |
nftables exporter
-rw-r--r-- | flake.nix | 10 | ||||
-rw-r--r-- | pkgs/nftables-exporter.nix | 29 |
2 files changed, 39 insertions, 0 deletions
@@ -53,6 +53,16 @@ inherit pkgs-module; }; + packages."x86_64-linux" = + let + pkgs = import nixpkgs { + system = "x86_64-linux"; + }; + in + { + nftables-exporter = pkgs.callPackage ./pkgs/nftables-exporter.nix {}; + }; + nixosConfigurations = let mkConfig = { hostName , module ? (./. + "/machines/${hostName}.nix") diff --git a/pkgs/nftables-exporter.nix b/pkgs/nftables-exporter.nix new file mode 100644 index 0000000..956eab5 --- /dev/null +++ b/pkgs/nftables-exporter.nix @@ -0,0 +1,29 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "nftables_exporter"; + version = "0.1.1"; + + goPackagePath = "github.com/Intrinsec/nftables_exporter"; + + src = fetchFromGitHub { + owner = "Intrinsec"; + repo = "nftables_exporter"; + rev = "v${version}"; + sha256 = "ckZxgT4eCJlia9L6omL3EJqgew49erY11dEAnsRECx4="; + }; + + vendorSha256 = null; + + doCheck = true; + + # passthru.tests = { inherit (nixosTests.prometheus-exporters) snmp; }; + + meta = with lib; { + description = "Nftables exporter for Prometheus"; + homepage = "https://github.com/prometheus/snmp_exporter"; + license = licenses.asl20; + maintainers = with maintainers; [ orbekk ]; + platforms = platforms.unix; + }; +} |