From ef526adf996c4ffc47672f2cac7b95bb12adde21 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Thu, 17 Nov 2016 14:00:39 +0300 Subject: icingaweb2: changed options * renamed: fpmPool -> php-fpm.pool * added: php-fpm.package --- modules/apps/icingaweb2.nix | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'modules/apps') diff --git a/modules/apps/icingaweb2.nix b/modules/apps/icingaweb2.nix index afb7712..d8397ec 100644 --- a/modules/apps/icingaweb2.nix +++ b/modules/apps/icingaweb2.nix @@ -2,15 +2,14 @@ let - inherit (lib) types - mkIf mkOption mkEnableOption mkDefault hasPrefix - concatMapStringsSep filterAttrs recursiveUpdate mapAttrsToList - concatStringsSep isString genAttrs attrNames - optionalString mkOptionType any; - inherit (types) - bool str int lines path either - nullOr attrsOf listOf enum submodule unspecified; - inherit (builtins) toString; + inherit (lib) + any attrNames concatMapStringsSep concatStringsSep filterAttrs + genAttrs hasPrefix isString mapAttrsToList mkDefault + mkEnableOption mkIf mkOption mkOptionType mkOverride optionalString + recursiveUpdate ; + inherit (lib.types) + attrsOf bool either enum int lines listOf nullOr package path + str submodule unspecified ; localIcinga = config.nixsap.apps.icinga2.enable; @@ -272,10 +271,17 @@ in { type = path; default = "/icingaweb2"; }; - fpmPool = mkOption { - description = "Options for the PHP FPM pool"; - type = attrsOf unspecified; - default = {}; + php-fpm = { + package = mkOption { + description = "PHP package to use"; + type = package; + default = pkgs.php; + }; + pool = mkOption { + description = "Options for the PHP FPM pool"; + type = attrsOf unspecified; + default = {}; + }; }; resources = mkOption { @@ -358,8 +364,11 @@ in { config = mkIf cfg.enable { nixsap.deployment.keyrings.root = keys; users.users.icingaweb2.extraGroups = mkIf localIcinga [ config.nixsap.apps.icinga2.commandGroup ]; - nixsap.apps.php-fpm.icingaweb2.pool = - recursiveUpdate defaultPool (cfg.fpmPool // { user = cfg.user ;}); + + nixsap.apps.php-fpm.icingaweb2 = mkOverride 0 { + inherit (cfg.php-fpm) package; + pool = recursiveUpdate defaultPool (cfg.php-fpm.pool // { user = cfg.user ;}); + }; nixsap.apps.nginx.http.servers.icingaweb2 = '' ${cfg.nginxServer} -- cgit v1.2.3