{ pkgs, config, lib, ... }: let cfg = config.services.part-db; pkg = cfg.package; inherit (lib) mkEnableOption mkPackageOption mkOption types mkIf ; in { meta.maintainers = with lib.maintainers; [ felbinger ]; options.services.part-db = { enable = mkEnableOption "PartDB"; package = mkPackageOption pkgs "part-db" { }; phpPackage = mkPackageOption pkgs "php" { } // { apply = pkg: pkg.buildEnv { extraConfig = '' memory_limit = 256M; ''; }; }; enableNginx = mkOption { type = types.bool; default = true; description = '' Whether to enable nginx or not. If enabled, an nginx virtual host will be created for access to part-db. If not enabled, then you may use `''${config.services.part-db.package}/public` as your document root in whichever webserver you wish to setup. ''; }; enablePostgresql = mkOption { type = types.bool; default = true; description = '' Whether to configure the postgresql database for part-db. If enabled, a database and user will be created for part-db. ''; }; virtualHost = mkOption { type = types.str; default = "localhost"; description = '' The virtualHost at which you wish part-db to be served. ''; }; poolConfig = lib.mkOption { type = lib.types.attrsOf ( lib.types.oneOf [ lib.types.str lib.types.int lib.types.bool ] ); default = { }; defaultText = '' { "pm" = "dynamic"; "pm.max_children" = 32; "pm.start_servers" = 2; "pm.min_spare_servers" = 2; "pm.max_spare_servers" = 4; "pm.max_requests" = 500; } ''; description = '' Options for the PartDB PHP pool. See the documentation on php-fpm.conf for details on configuration directives. ''; }; settings = lib.mkOption { default = { }; description = '' Options for part-db configuration. Refer to for details on supported values. All