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

51 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, pkgs, nodejs, stdenv, buildGoModule, fetchFromGitHub, debianutils, mkdocs, python3, python3Packages }:
let
nodeDependencies = (import ./node-composition.nix {
inherit pkgs nodejs;
inherit (stdenv.hostPlatform) system;
}).nodeDependencies;
in
buildGoModule rec {
pname = "ntfy-sh";
version = "1.28.0";
src = fetchFromGitHub {
owner = "binwiederhier";
repo = "ntfy";
rev = "v${version}";
sha256 = "sha256-pDKeG0Q4cG+UoxpBawHOtO8xVXXxo0Z7nyY2nZSSFvc=";
};
vendorSha256 = "sha256-oMZCjrCsq6aRxcdF6jQK51sZqOjbrdlbofSQvGO/POg=";
doCheck = false;
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
nativeBuildInputs = [
debianutils
mkdocs
nodejs
python3
python3Packages.mkdocs-material
python3Packages.mkdocs-minify
];
postPatch = ''
sed -i 's# /bin/echo# echo#' Makefile
'';
preBuild = ''
ln -s ${nodeDependencies}/lib/node_modules web/node_modules
DISABLE_ESLINT_PLUGIN=true npm_config_offline=true make web-build docs-build
'';
meta = with lib; {
description = "Send push notifications to your phone or desktop via PUT/POST";
homepage = "https://ntfy.sh";
license = licenses.asl20;
maintainers = with maintainers; [ arjan-s ];
};
}