2022-12-14 11:09:52 +01:00
|
|
|
{ lib, pkgs, stdenv, buildGoModule, fetchFromGitHub, nixosTests
|
2023-05-20 09:38:27 +02:00
|
|
|
, nodejs, debianutils, mkdocs, python3, python3Packages
|
|
|
|
, pkg-config, pixman, cairo, pango }:
|
2022-12-14 11:09:52 +01:00
|
|
|
|
2022-03-30 17:35:26 +02:00
|
|
|
|
2022-09-28 14:55:48 +02:00
|
|
|
let
|
|
|
|
nodeDependencies = (import ./node-composition.nix {
|
|
|
|
inherit pkgs nodejs;
|
|
|
|
inherit (stdenv.hostPlatform) system;
|
2023-05-20 09:38:27 +02:00
|
|
|
}).nodeDependencies.override {
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
buildInputs = [ pixman cairo pango ];
|
|
|
|
};
|
2022-09-28 14:55:48 +02:00
|
|
|
in
|
2022-03-30 17:35:26 +02:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "ntfy-sh";
|
2023-05-20 09:38:27 +02:00
|
|
|
version = "2.5.0";
|
2022-03-30 17:35:26 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "binwiederhier";
|
|
|
|
repo = "ntfy";
|
|
|
|
rev = "v${version}";
|
2023-05-20 09:38:27 +02:00
|
|
|
sha256 = "sha256-C7Ko7JBiQoafos7TbVTqq6pn7NnuLOZo7Dcf6ob2IzI=";
|
2022-03-30 17:35:26 +02:00
|
|
|
};
|
|
|
|
|
2023-05-20 09:38:27 +02:00
|
|
|
vendorSha256 = "sha256-9mhMeGcAdFjzLJdsGnoTArtxVEaUznpN64j5SMBYHv8=";
|
2022-03-30 17:35:26 +02:00
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2022-10-06 20:55:47 +02:00
|
|
|
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
|
|
|
|
|
2022-09-28 14:55:48 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
debianutils
|
|
|
|
mkdocs
|
|
|
|
nodejs
|
|
|
|
python3
|
|
|
|
python3Packages.mkdocs-material
|
|
|
|
python3Packages.mkdocs-minify
|
2023-04-02 20:49:35 +02:00
|
|
|
python3Packages.mkdocs-simple-hooks
|
2022-09-28 14:55:48 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i 's# /bin/echo# echo#' Makefile
|
|
|
|
'';
|
|
|
|
|
2022-03-30 17:35:26 +02:00
|
|
|
preBuild = ''
|
2022-09-28 14:55:48 +02:00
|
|
|
ln -s ${nodeDependencies}/lib/node_modules web/node_modules
|
|
|
|
DISABLE_ESLINT_PLUGIN=true npm_config_offline=true make web-build docs-build
|
2022-03-30 17:35:26 +02:00
|
|
|
'';
|
|
|
|
|
2022-12-14 11:09:52 +01:00
|
|
|
passthru = {
|
|
|
|
updateScript = ./update.sh;
|
|
|
|
tests.ntfy-sh = nixosTests.ntfy-sh;
|
|
|
|
};
|
2022-12-14 10:59:51 +01:00
|
|
|
|
2022-03-30 17:35:26 +02: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 11:09:52 +01:00
|
|
|
maintainers = with maintainers; [ arjan-s fpletz ];
|
2022-03-30 17:35:26 +02:00
|
|
|
};
|
|
|
|
}
|