2023-02-26 19:04:20 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, buildNpmPackage, python3, nodejs, nixosTests }:
|
2023-02-10 19:33:01 +01:00
|
|
|
|
|
|
|
buildNpmPackage rec {
|
2022-09-23 06:30:54 +02:00
|
|
|
pname = "uptime-kuma";
|
2023-05-10 20:37:25 +02:00
|
|
|
version = "1.21.3";
|
2022-09-23 06:30:54 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "louislam";
|
|
|
|
repo = "uptime-kuma";
|
2023-02-10 19:33:01 +01:00
|
|
|
rev = version;
|
2023-05-10 20:37:25 +02:00
|
|
|
sha256 = "sha256-hNtD8R8nDwO+uJ5WD8TxaCyYD7ESvBPmcv7iT7NAu6s=";
|
2022-09-23 06:30:54 +02:00
|
|
|
};
|
|
|
|
|
2023-05-10 20:37:25 +02:00
|
|
|
npmDepsHash = "sha256-yPUVLtqfowSuvrzp4Edcsussaxao5Ti1/sLsd9lmiSM=";
|
2022-09-23 06:30:54 +02:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Fixes the permissions of the database being not set correctly
|
|
|
|
# See https://github.com/louislam/uptime-kuma/pull/2119
|
|
|
|
./fix-database-permissions.patch
|
|
|
|
];
|
|
|
|
|
2023-02-10 19:33:01 +01:00
|
|
|
nativeBuildInputs = [ python3 ];
|
|
|
|
|
|
|
|
CYPRESS_INSTALL_BINARY = 0; # Stops Cypress from trying to download binaries
|
2022-09-23 06:30:54 +02:00
|
|
|
|
2023-02-10 19:33:01 +01:00
|
|
|
postInstall = ''
|
|
|
|
cp -r dist $out/lib/node_modules/uptime-kuma/
|
2022-09-23 06:30:54 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2022-12-08 23:26:13 +01:00
|
|
|
makeWrapper ${nodejs}/bin/node $out/bin/uptime-kuma-server \
|
2023-02-10 19:33:01 +01:00
|
|
|
--add-flags $out/lib/node_modules/uptime-kuma/server/server.js \
|
|
|
|
--chdir $out/lib/node_modules/uptime-kuma
|
2022-09-23 06:30:54 +02:00
|
|
|
'';
|
|
|
|
|
2023-02-10 19:33:01 +01:00
|
|
|
passthru.tests.uptime-kuma = nixosTests.uptime-kuma;
|
2022-09-23 06:30:54 +02:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A fancy self-hosted monitoring tool";
|
|
|
|
homepage = "https://github.com/louislam/uptime-kuma";
|
2023-02-26 19:04:20 +01:00
|
|
|
changelog = "https://github.com/louislam/uptime-kuma/releases/tag/${version}";
|
2022-09-23 06:30:54 +02:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ julienmalka ];
|
2023-02-26 19:04:20 +01:00
|
|
|
# FileNotFoundError: [Errno 2] No such file or directory: 'xcrun'
|
|
|
|
broken = stdenv.isDarwin;
|
2022-09-23 06:30:54 +02:00
|
|
|
};
|
2023-02-10 19:33:01 +01:00
|
|
|
}
|