nixpkgs/pkgs/tools/misc/ntfy-sh/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
1.4 KiB
Nix
Raw Normal View History

2023-07-25 18:36:07 +03:00
{ lib, buildGoModule, fetchFromGitHub, buildNpmPackage
2023-07-16 22:47:49 +03:00
, nixosTests, debianutils, mkdocs, python3, python3Packages
2023-07-25 18:36:07 +03:00
}:
2022-12-14 13:09:52 +03:00
2022-03-30 18:35:26 +03:00
buildGoModule rec {
pname = "ntfy-sh";
2023-08-18 10:34:44 +03:00
version = "2.7.0";
2022-03-30 18:35:26 +03:00
src = fetchFromGitHub {
owner = "binwiederhier";
repo = "ntfy";
rev = "v${version}";
2023-08-18 10:34:44 +03:00
hash = "sha256-cL/vvwwFH3ztQUVqjZmO2nPmqCyuFMPCtMcRwNvEfNc=";
2022-03-30 18:35:26 +03:00
};
2023-08-18 10:34:44 +03:00
vendorHash = "sha256-nCzBWANnNAwUw17EPs0G9ezpKJG+Ix1E7IhdvxFe3Xc=";
2023-07-16 22:47:49 +03:00
ui = buildNpmPackage {
inherit src version;
pname = "ntfy-sh-ui";
2023-08-18 10:34:44 +03:00
npmDepsHash = "sha256-qDpCI65r3S9WMEmYQeyY2KRpLnP6oxEL6rrhj0MGeWk=";
2023-07-16 22:47:49 +03:00
prePatch = ''
cd web/
'';
installPhase = ''
mv build/index.html build/app.html
rm build/config.js
mkdir -p $out
mv build/ $out/site
'';
};
2022-03-30 18:35:26 +03:00
doCheck = false;
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
nativeBuildInputs = [
debianutils
mkdocs
python3
python3Packages.mkdocs-material
python3Packages.mkdocs-minify
python3Packages.mkdocs-simple-hooks
];
postPatch = ''
sed -i 's# /bin/echo# echo#' Makefile
'';
2022-03-30 18:35:26 +03:00
preBuild = ''
2023-07-16 22:47:49 +03:00
cp -r ${ui}/site/ server/
make docs-build
2022-03-30 18:35:26 +03:00
'';
2022-12-14 13:09:52 +03:00
passthru = {
updateScript = ./update.sh;
tests.ntfy-sh = nixosTests.ntfy-sh;
};
2022-03-30 18:35:26 +03: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-14 13:09:52 +03:00
maintainers = with maintainers; [ arjan-s fpletz ];
2022-03-30 18:35:26 +03:00
};
}