2024-05-05 12:58:35 +08:00
|
|
|
{
|
|
|
|
stdenv, cmake, pkg-config, standalone ? false, makeWrapper,
|
2024-05-05 14:20:53 +08:00
|
|
|
boost, fmt, sqlite-orm, nlohmann_json, zpp-bits, range-v3, nameof, openssh, sqlite
|
2024-05-05 12:58:35 +08:00
|
|
|
}: stdenv.mkDerivation
|
|
|
|
{
|
|
|
|
name = "hpcstat";
|
|
|
|
src = ./.;
|
2024-05-05 14:20:53 +08:00
|
|
|
buildInputs = [ boost fmt sqlite-orm nlohmann_json zpp-bits range-v3 nameof sqlite ];
|
2024-05-05 12:58:35 +08:00
|
|
|
nativeBuildInputs = [ cmake pkg-config makeWrapper ];
|
|
|
|
postInstall =
|
|
|
|
if standalone then "cp ${openssh}/bin/{ssh-add,ssh-keygen} $out/bin"
|
|
|
|
else
|
|
|
|
''
|
|
|
|
wrapProgram $out/bin/hpcstat --set HPCSTAT_SHAREDIR $out/share/hpcstat \
|
|
|
|
--set HPCSTAT_DATADIR /var/lib/hpcstat --set HPCSTAT_SSH_BINDIR ${openssh}/bin
|
|
|
|
'';
|
|
|
|
}
|