2024-02-29 20:09:43 +00:00
|
|
|
{ buildNpmPackage
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, nixosTests
|
|
|
|
, lib
|
2024-04-21 15:54:59 +00:00
|
|
|
, nix-update-script
|
2024-02-29 20:09:43 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
pname = "scrutiny";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.8.1";
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
frontend = buildNpmPackage {
|
|
|
|
inherit version;
|
|
|
|
pname = "${pname}-webapp";
|
|
|
|
src = "${src}/webapp/frontend";
|
|
|
|
|
|
|
|
npmDepsHash = "sha256-M8P41LPg7oJ/C9abDuNM5Mn+OO0zK56CKi2BwLxv8oQ=";
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
mkdir dist
|
|
|
|
npm run build:prod --offline -- --output-path=dist
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir $out
|
|
|
|
cp -r dist/* $out
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
passthru.updatescript = nix-update-script { };
|
2024-02-29 20:09:43 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
buildGoModule rec {
|
|
|
|
inherit pname src version;
|
|
|
|
|
|
|
|
subPackages = "webapp/backend/cmd/scrutiny";
|
|
|
|
|
|
|
|
vendorHash = "sha256-SiQw6pq0Fyy8Ia39S/Vgp9Mlfog2drtVn43g+GXiQuI=";
|
|
|
|
|
|
|
|
CGO_ENABLED = 0;
|
|
|
|
|
|
|
|
ldflags = [ "-extldflags=-static" ];
|
|
|
|
|
|
|
|
tags = [ "static" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/scrutiny
|
|
|
|
cp -r ${frontend}/* $out/share/scrutiny
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.scrutiny = nixosTests.scrutiny;
|
2024-04-21 15:54:59 +00:00
|
|
|
passthru.updatescript = nix-update-script { };
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Hard Drive S.M.A.R.T Monitoring, Historical Trends & Real World Failure Thresholds.";
|
|
|
|
homepage = "https://github.com/AnalogJ/scrutiny";
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://github.com/AnalogJ/scrutiny/releases/tag/v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ jnsgruk ];
|
|
|
|
mainProgram = "scrutiny";
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|