2024-02-29 20:09:43 +00:00
|
|
|
{ buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, smartmontools
|
|
|
|
, nixosTests
|
|
|
|
, lib
|
2024-04-21 15:54:59 +00:00
|
|
|
, nix-update-script
|
2024-02-29 20:09:43 +00:00
|
|
|
}:
|
|
|
|
let
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.8.1";
|
2024-02-29 20:09:43 +00:00
|
|
|
in
|
|
|
|
buildGoModule rec {
|
|
|
|
inherit version;
|
|
|
|
pname = "scrutiny-collector";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "AnalogJ";
|
|
|
|
repo = "scrutiny";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-WoU5rdsIEhZQ+kPoXcestrGXC76rFPvhxa0msXjFsNg=";
|
2024-02-29 20:09:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
subPackages = "collector/cmd/collector-metrics";
|
|
|
|
|
|
|
|
vendorHash = "sha256-SiQw6pq0Fyy8Ia39S/Vgp9Mlfog2drtVn43g+GXiQuI=";
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
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;
|
2024-04-21 15:54:59 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
meta = {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Hard disk metrics collector for Scrutiny";
|
2024-02-29 20:09:43 +00:00
|
|
|
homepage = "https://github.com/AnalogJ/scrutiny";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ jnsgruk ];
|
|
|
|
mainProgram = "scrutiny-collector-metrics";
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|