nixos/packages/hpcstat/default.nix

22 lines
862 B
Nix
Raw Normal View History

2024-05-05 12:58:35 +08:00
{
2024-05-23 13:39:27 +08:00
stdenv, cmake, pkg-config, standalone ? false, version ? null, makeWrapper, lib,
sqlite-orm, nlohmann_json, range-v3, openssh, sqlite, date, httplib, openssl, openxlsx, termcolor, duc, biu
2024-05-05 12:58:35 +08:00
}: stdenv.mkDerivation
{
name = "hpcstat";
src = ./.;
2024-05-05 22:29:06 +08:00
buildInputs =
[ sqlite-orm nlohmann_json range-v3 sqlite date httplib termcolor openssl biu openxlsx ];
2024-05-05 12:58:35 +08:00
nativeBuildInputs = [ cmake pkg-config makeWrapper ];
2024-05-23 13:39:27 +08:00
cmakeFlags = lib.optionals (version != null) [ "-DHPCSTAT_VERSION=${version}" ];
2024-05-05 12:58:35 +08:00
postInstall =
if standalone then "cp ${openssh}/bin/{ssh-add,ssh-keygen} ${duc}/bin/duc $out/bin"
2024-05-05 12:58:35 +08:00
else
''
wrapProgram $out/bin/hpcstat --set HPCSTAT_SHAREDIR $out/share/hpcstat \
--set HPCSTAT_DATADIR /var/lib/hpcstat --set HPCSTAT_SSH_BINDIR ${openssh}/bin \
--set HPCSTAT_DUC_BINDIR ${duc}/bin
2024-05-05 12:58:35 +08:00
'';
doCheck = true;
2024-05-05 12:58:35 +08:00
}