nixos/local/pkgs/mirism/default.nix
2024-06-06 22:31:49 +08:00

31 lines
749 B
Nix

{
lib, stdenv, requireFile,
boost, nghttp2, brotli, nameof, cppcoro, tgbot-cpp, libbacktrace, fmt, date
}: stdenv.mkDerivation rec
{
name = "mirism";
# nix-store --query --hash $(nix store add-path . --name 'mirism')
src = requireFile
{
inherit name;
sha256 = "0f50pvdafhlmrlbf341mkp9q50v4ld5pbx92d2w1633f18zghbzf";
hashMode = "recursive";
message = "Source file not found.";
};
buildInputs = [ boost nghttp2.dev brotli nameof cppcoro tgbot-cpp libbacktrace fmt date ];
buildPhase =
''
runHook preBuild
make ng01 beta
runHook postBuild
'';
installPhase =
''
runHook preInstall
mkdir -p $out/bin
cp build/{ng01,beta} $out/bin
ln -s ${src} $out/src
runHook postInstall
'';
}