571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
52 lines
1.6 KiB
Nix
52 lines
1.6 KiB
Nix
{ lib, stdenv, fetchFromGitHub, buildNpmPackage, python3, nodejs, nixosTests }:
|
|
|
|
buildNpmPackage rec {
|
|
pname = "uptime-kuma";
|
|
version = "1.23.15";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "louislam";
|
|
repo = "uptime-kuma";
|
|
rev = version;
|
|
hash = "sha256-/UAou+l7ppXU3t54YYdDZcXUNvEw7VGcn/OVPXdFdj0=";
|
|
};
|
|
|
|
npmDepsHash = "sha256-KaOnlqvfGatrdEqtw2Y0SudLuyzU6yC78DWn3+EZcec=";
|
|
|
|
patches = [
|
|
# Fixes the permissions of the database being not set correctly
|
|
# See https://github.com/louislam/uptime-kuma/pull/2119
|
|
./fix-database-permissions.patch
|
|
];
|
|
|
|
nativeBuildInputs = [ python3 ];
|
|
|
|
CYPRESS_INSTALL_BINARY = 0; # Stops Cypress from trying to download binaries
|
|
|
|
postInstall = ''
|
|
cp -r dist $out/lib/node_modules/uptime-kuma/
|
|
|
|
# remove references to nodejs source
|
|
rm -r $out/lib/node_modules/uptime-kuma/node_modules/@louislam/sqlite3/build-tmp-napi-v6
|
|
'';
|
|
|
|
postFixup = ''
|
|
makeWrapper ${nodejs}/bin/node $out/bin/uptime-kuma-server \
|
|
--add-flags $out/lib/node_modules/uptime-kuma/server/server.js \
|
|
--chdir $out/lib/node_modules/uptime-kuma
|
|
'';
|
|
|
|
passthru.tests.uptime-kuma = nixosTests.uptime-kuma;
|
|
|
|
meta = with lib; {
|
|
description = "Fancy self-hosted monitoring tool";
|
|
mainProgram = "uptime-kuma-server";
|
|
homepage = "https://github.com/louislam/uptime-kuma";
|
|
changelog = "https://github.com/louislam/uptime-kuma/releases/tag/${version}";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ julienmalka ];
|
|
# FileNotFoundError: [Errno 2] No such file or directory: 'xcrun'
|
|
broken = stdenv.hostPlatform.isDarwin;
|
|
};
|
|
}
|