nixpkgs/pkgs/by-name/un/unpoller/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

38 lines
1.1 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, nixosTests
}:
buildGoModule rec {
pname = "unpoller";
version = "2.11.2";
src = fetchFromGitHub {
owner = "unpoller";
repo = "unpoller";
rev = "v${version}";
hash = "sha256-/X2hCtF38X0twHsHSjpf23Mdz9aK43z3jhWbfkUo0kQ=";
};
vendorHash = "sha256-d7kkdiGMT3bN1dfNo8m+zp3VY8kaZM2BWO3B3iAdUQY=";
ldflags = [
"-w" "-s"
"-X github.com/prometheus/common/version.Branch=master"
"-X github.com/prometheus/common/version.BuildDate=unknown"
"-X github.com/prometheus/common/version.Revision=${src.rev}"
"-X github.com/prometheus/common/version.Version=${version}-0"
];
passthru.tests = { inherit (nixosTests.prometheus-exporters) unpoller; };
meta = with lib; {
description = "Collect ALL UniFi Controller, Site, Device & Client Data - Export to InfluxDB or Prometheus";
homepage = "https://github.com/unpoller/unpoller";
changelog = "https://github.com/unpoller/unpoller/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ Frostman ];
};
}