nixpkgs/pkgs/by-name/sc/scrutiny-collector/package.nix
Alexis Hildebrandt bf995e3641 treewide: Remove ending period from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*".*\.";' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*)\.";/\1";/'
2024-06-09 23:04:51 +02:00

56 lines
1.3 KiB
Nix

{ buildGoModule
, fetchFromGitHub
, makeWrapper
, smartmontools
, nixosTests
, lib
, nix-update-script
}:
let
version = "0.8.1";
in
buildGoModule rec {
inherit version;
pname = "scrutiny-collector";
src = fetchFromGitHub {
owner = "AnalogJ";
repo = "scrutiny";
rev = "refs/tags/v${version}";
hash = "sha256-WoU5rdsIEhZQ+kPoXcestrGXC76rFPvhxa0msXjFsNg=";
};
subPackages = "collector/cmd/collector-metrics";
vendorHash = "sha256-SiQw6pq0Fyy8Ia39S/Vgp9Mlfog2drtVn43g+GXiQuI=";
buildInputs = [ makeWrapper ];
CGO_ENABLED = 0;
ldflags = [ "-extldflags=-static" ];
tags = [ "static" ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp $GOPATH/bin/collector-metrics $out/bin/scrutiny-collector-metrics
wrapProgram $out/bin/scrutiny-collector-metrics \
--prefix PATH : ${lib.makeBinPath [ smartmontools ]}
runHook postInstall
'';
passthru.tests.scrutiny-collector = nixosTests.scrutiny;
passthru.updateScript = nix-update-script { };
meta = {
description = "Hard disk metrics collector for Scrutiny";
homepage = "https://github.com/AnalogJ/scrutiny";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ jnsgruk ];
mainProgram = "scrutiny-collector-metrics";
platforms = lib.platforms.linux;
};
}