diff --git a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml index 6f2a7fd8dd56..b9967ffb9827 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml @@ -486,7 +486,7 @@ - + yggdrasil was upgraded to a new major @@ -495,6 +495,14 @@ changelog. + + + icingaweb2 was upgraded to a new release + which requires a manual database upgrade, see + upstream + changelog. + +
diff --git a/nixos/doc/manual/release-notes/rl-2111.section.md b/nixos/doc/manual/release-notes/rl-2111.section.md index 5a1a29c270a2..377dbf598d91 100644 --- a/nixos/doc/manual/release-notes/rl-2111.section.md +++ b/nixos/doc/manual/release-notes/rl-2111.section.md @@ -124,6 +124,8 @@ In addition to numerous new and upgraded packages, this release has the followin - `yggdrasil` was upgraded to a new major release with breaking changes, see [upstream changelog](https://github.com/yggdrasil-network/yggdrasil-go/releases/tag/v0.4.0). +- `icingaweb2` was upgraded to a new release which requires a manual database upgrade, see [upstream changelog](https://github.com/Icinga/icingaweb2/releases/tag/v2.9.0). + ## Other Notable Changes {#sec-release-21.11-notable-changes} - The setting [`services.openssh.logLevel`](options.html#opt-services.openssh.logLevel) `"VERBOSE"` `"INFO"`. This brings NixOS in line with upstream and other Linux distributions, and reduces log spam on servers due to bruteforcing botnets. diff --git a/nixos/modules/services/web-apps/icingaweb2/icingaweb2.nix b/nixos/modules/services/web-apps/icingaweb2/icingaweb2.nix index eea49bda283b..f8f0854f1bcb 100644 --- a/nixos/modules/services/web-apps/icingaweb2/icingaweb2.nix +++ b/nixos/modules/services/web-apps/icingaweb2/icingaweb2.nix @@ -23,6 +23,16 @@ in { ''; }; + libraryPaths = mkOption { + type = attrsOf package; + default = { }; + description = '' + Libraries to add to the Icingaweb2 library path. + The name of the attribute is the name of the library, the value + is the package to add. + ''; + }; + virtualHost = mkOption { type = nullOr str; default = "icingaweb2"; @@ -167,6 +177,9 @@ in { services.phpfpm.pools = mkIf (cfg.pool == "${poolName}") { ${poolName} = { user = "icingaweb2"; + phpEnv = { + ICINGAWEB_LIBDIR = toString (pkgs.linkFarm "icingaweb2-libdir" (mapAttrsToList (name: path: { inherit name path; }) cfg.libraryPaths)); + }; phpPackage = pkgs.php.withExtensions ({ enabled, all }: [ all.imagick ] ++ enabled); phpOptions = '' date.timezone = "${cfg.timezone}" @@ -184,6 +197,11 @@ in { }; }; + services.icingaweb2.libraryPaths = { + ipl = pkgs.icingaweb2-ipl; + thirdparty = pkgs.icingaweb2-thirdparty; + }; + systemd.services."phpfpm-${poolName}".serviceConfig.ReadWritePaths = [ "/etc/icingaweb2" ]; services.nginx = { diff --git a/pkgs/servers/icingaweb2/default.nix b/pkgs/servers/icingaweb2/default.nix index 6e8cdd5dca41..7923674a3b76 100644 --- a/pkgs/servers/icingaweb2/default.nix +++ b/pkgs/servers/icingaweb2/default.nix @@ -1,14 +1,14 @@ -{ stdenv, lib, fetchFromGitHub, makeWrapper, php }: +{ stdenvNoCC, lib, fetchFromGitHub, makeWrapper, php }: -stdenv.mkDerivation rec { +stdenvNoCC.mkDerivation rec { pname = "icingaweb2"; - version = "2.8.3"; + version = "2.9.0"; src = fetchFromGitHub { owner = "Icinga"; repo = "icingaweb2"; rev = "v${version}"; - sha256 = "sha256-wk6rTEYRS0q0HpQRbFAmfeYVrF/xLP/HchEXNqqNpYg="; + sha256 = "1vp2gdvgvw960178yaqql6iza0rg2h8japsnass3kkrwrmb2liq5"; }; nativeBuildInputs = [ makeWrapper ]; @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { Analyse problems and act on them. ''; homepage = "https://www.icinga.com/products/icinga-web-2/"; - license = licenses.gpl2; + license = licenses.gpl2Only; platforms = platforms.all; maintainers = with maintainers; [ das_j ]; }; diff --git a/pkgs/servers/icingaweb2/ipl.nix b/pkgs/servers/icingaweb2/ipl.nix new file mode 100644 index 000000000000..35b9357009c4 --- /dev/null +++ b/pkgs/servers/icingaweb2/ipl.nix @@ -0,0 +1,26 @@ +{ stdenvNoCC, lib, fetchFromGitHub }: + +stdenvNoCC.mkDerivation rec { + pname = "icingaweb2-ipl"; + version = "0.6.0"; + + src = fetchFromGitHub { + owner = "Icinga"; + repo = "icinga-php-library"; + rev = "v${version}"; + sha256 = "0nzvd84r9f1mypfhq4p37hsvkrbd5wzgs1m9qhj45ncvf5rq49f1"; + }; + + installPhase = '' + mkdir -p "$out" + cp -r * "$out" + ''; + + meta = { + description = "PHP library package for Icingaweb 2"; + homepage = "https://github.com/Icinga/icinga-php-library"; + license = lib.licenses.mit; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ das_j ]; + }; +} diff --git a/pkgs/servers/icingaweb2/thirdparty.nix b/pkgs/servers/icingaweb2/thirdparty.nix new file mode 100644 index 000000000000..ae3ce9538c95 --- /dev/null +++ b/pkgs/servers/icingaweb2/thirdparty.nix @@ -0,0 +1,26 @@ +{ stdenvNoCC, lib, fetchFromGitHub }: + +stdenvNoCC.mkDerivation rec { + pname = "icingaweb2-thirdparty"; + version = "0.10.0"; + + src = fetchFromGitHub { + owner = "Icinga"; + repo = "icinga-php-thirdparty"; + rev = "v${version}"; + sha256 = "03zq6p2xyjrln8hdfks70hg8mwa51d3pnkswnzavpbxlbk83vzz5"; + }; + + installPhase = '' + mkdir -p "$out" + cp -r * "$out" + ''; + + meta = { + description = "Third party dependencies for Icingaweb 2"; + homepage = "https://github.com/Icinga/icinga-php-thirdparty"; + license = lib.licenses.mit; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ das_j ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e3e5f4f9edd0..5d0d24b08626 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19526,6 +19526,8 @@ in icecream = callPackage ../servers/icecream { }; + icingaweb2-ipl = callPackage ../servers/icingaweb2/ipl.nix { }; + icingaweb2-thirdparty = callPackage ../servers/icingaweb2/thirdparty.nix { }; icingaweb2 = callPackage ../servers/icingaweb2 { }; icingaweb2Modules = { theme-april = callPackage ../servers/icingaweb2/theme-april { };