2024-09-19 14:19:46 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchurl,
|
|
|
|
writeText,
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
import ./versions.nix (
|
|
|
|
{ version, hash, ... }:
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "zabbix-web";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-01-15 22:18:51 +00:00
|
|
|
url = "https://cdn.zabbix.com/zabbix/sources/stable/${lib.versions.majorMinor version}/zabbix-${version}.tar.gz";
|
2024-02-29 20:09:43 +00:00
|
|
|
inherit hash;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
phpConfig = writeText "zabbix.conf.php" ''
|
2024-09-19 14:19:46 +00:00
|
|
|
<?php
|
|
|
|
return require(getenv('ZABBIX_CONFIG'));
|
|
|
|
?>
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/zabbix/
|
2021-01-15 22:18:51 +00:00
|
|
|
cp -a ${if lib.versionAtLeast version "5.0.0" then "ui/." else "frontends/php/."} $out/share/zabbix/
|
2020-04-24 23:36:52 +00:00
|
|
|
cp ${phpConfig} $out/share/zabbix/conf/zabbix.conf.php
|
|
|
|
'';
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
meta = {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Enterprise-class open source distributed monitoring solution (web frontend)";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.zabbix.com/";
|
2024-09-19 14:19:46 +00:00
|
|
|
license =
|
|
|
|
if (lib.versions.major version >= "7") then lib.licenses.agpl3Only else lib.licenses.gpl2Plus;
|
|
|
|
maintainers = with lib.maintainers; [ mmahut ];
|
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-09-19 14:19:46 +00:00
|
|
|
}
|
|
|
|
)
|