summary refs log tree commit diff
path: root/pkgs/tools/misc/ntfy-sh/default.nix
diff options
context:
space:
mode:
authorArjan Schrijver <github@anymore.nl>2022-09-28 14:55:48 +0200
committerWinter <winter@winter.cafe>2022-10-07 21:58:37 -0400
commit0b2e48b4c1bb115a6294b9a0c98f82c3a56c35e4 (patch)
tree6aaea8b781da64d5fd61af2b3a919c9d724aebca /pkgs/tools/misc/ntfy-sh/default.nix
parentd967f5daf51d22cb5581d6a1f861b1dbc72228d4 (diff)
ntfy-sh: build and package web UI and docs
Fixes #188695
Diffstat (limited to 'pkgs/tools/misc/ntfy-sh/default.nix')
-rw-r--r--pkgs/tools/misc/ntfy-sh/default.nix24
1 files changed, 22 insertions, 2 deletions
diff --git a/pkgs/tools/misc/ntfy-sh/default.nix b/pkgs/tools/misc/ntfy-sh/default.nix
index ebb813d44ec04..82e4c52720574 100644
--- a/pkgs/tools/misc/ntfy-sh/default.nix
+++ b/pkgs/tools/misc/ntfy-sh/default.nix
@@ -1,5 +1,11 @@
-{ lib, buildGoModule, fetchFromGitHub }:
+{ 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";
@@ -15,8 +21,22 @@ buildGoModule rec {
 
   doCheck = false;
 
+  nativeBuildInputs = [
+    debianutils
+    mkdocs
+    nodejs
+    python3
+    python3Packages.mkdocs-material
+    python3Packages.mkdocs-minify
+  ];
+
+  postPatch = ''
+    sed -i 's# /bin/echo# echo#' Makefile
+  '';
+
   preBuild = ''
-    make cli-deps-static-sites
+    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; {