biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / servers / monitoring / uptime-kuma / default.nix
blobb58579cc1e29e5857910da24bec1f5ed0daea6ce
1 { lib, stdenv, fetchFromGitHub, buildNpmPackage, python3, nodejs, nixosTests }:
3 buildNpmPackage rec {
4   pname = "uptime-kuma";
5   version = "1.23.11";
7   src = fetchFromGitHub {
8     owner = "louislam";
9     repo = "uptime-kuma";
10     rev = version;
11     hash = "sha256-PhIe2aDz6hr8001LL8N5L8jcUyzuamU0yYIVKcwmTlw=";
12   };
14   npmDepsHash = "sha256-Jyp/xY9K3sfqVnR7NQhgly8B54FmvnrStFO2GO2Kszs=";
16   patches = [
17     # Fixes the permissions of the database being not set correctly
18     # See https://github.com/louislam/uptime-kuma/pull/2119
19     ./fix-database-permissions.patch
20   ];
22   nativeBuildInputs = [ python3 ];
24   CYPRESS_INSTALL_BINARY = 0; # Stops Cypress from trying to download binaries
26   postInstall = ''
27     cp -r dist $out/lib/node_modules/uptime-kuma/
29     # remove references to nodejs source
30     rm -r $out/lib/node_modules/uptime-kuma/node_modules/@louislam/sqlite3/build-tmp-napi-v6
31   '';
33   postFixup = ''
34     makeWrapper ${nodejs}/bin/node $out/bin/uptime-kuma-server \
35       --add-flags $out/lib/node_modules/uptime-kuma/server/server.js \
36       --chdir $out/lib/node_modules/uptime-kuma
37   '';
39   passthru.tests.uptime-kuma = nixosTests.uptime-kuma;
41   meta = with lib; {
42     description = "A fancy self-hosted monitoring tool";
43     mainProgram = "uptime-kuma-server";
44     homepage = "https://github.com/louislam/uptime-kuma";
45     changelog = "https://github.com/louislam/uptime-kuma/releases/tag/${version}";
46     license = licenses.mit;
47     maintainers = with maintainers; [ julienmalka ];
48     # FileNotFoundError: [Errno 2] No such file or directory: 'xcrun'
49     broken = stdenv.isDarwin;
50   };