2023-08-04 22:07:22 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, buildNpmPackage
|
|
|
|
, nixosTests, debianutils, mkdocs, python3, python3Packages
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "ntfy-sh";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "2.6.2";
|
2022-04-03 18:54:34 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "binwiederhier";
|
|
|
|
repo = "ntfy";
|
|
|
|
rev = "v${version}";
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-VX5QXJqHvYE8n/TcSBIg8vuLx2OCe6rM87G1PXBiKRI=";
|
2022-04-03 18:54:34 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
vendorHash = "sha256-KcA35MVtF/bHtdiMqofs9gSnjl6oYedgqpKZtnFce20=";
|
|
|
|
|
|
|
|
ui = buildNpmPackage {
|
|
|
|
inherit src version;
|
|
|
|
pname = "ntfy-sh-ui";
|
|
|
|
npmDepsHash = "sha256-JvoTssXiBnl/H4odFqRoGtQz2pGwQL4BGxX8Vp/PBwY=";
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
cd web/
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mv build/index.html build/app.html
|
|
|
|
rm build/config.js
|
|
|
|
mkdir -p $out
|
|
|
|
mv build/ $out/site
|
|
|
|
'';
|
|
|
|
};
|
2022-04-03 18:54:34 +00:00
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
debianutils
|
|
|
|
mkdocs
|
|
|
|
python3
|
|
|
|
python3Packages.mkdocs-material
|
|
|
|
python3Packages.mkdocs-minify
|
2023-04-12 12:48:02 +00:00
|
|
|
python3Packages.mkdocs-simple-hooks
|
2022-10-21 18:38:19 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i 's# /bin/echo# echo#' Makefile
|
|
|
|
'';
|
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
preBuild = ''
|
2023-08-04 22:07:22 +00:00
|
|
|
cp -r ${ui}/site/ server/
|
|
|
|
make docs-build
|
2022-04-03 18:54:34 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = ./update.sh;
|
|
|
|
tests.ntfy-sh = nixosTests.ntfy-sh;
|
|
|
|
};
|
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Send push notifications to your phone or desktop via PUT/POST";
|
|
|
|
homepage = "https://ntfy.sh";
|
|
|
|
license = licenses.asl20;
|
2022-12-17 10:02:37 +00:00
|
|
|
maintainers = with maintainers; [ arjan-s fpletz ];
|
2022-04-03 18:54:34 +00:00
|
|
|
};
|
|
|
|
}
|