2023-11-12 17:29:40 +08:00
|
|
|
inputs:
|
|
|
|
{
|
2024-03-23 00:54:09 +08:00
|
|
|
options.nixos.services.httpua = let inherit (inputs.lib) mkOption types; in mkOption
|
2023-11-12 17:29:40 +08:00
|
|
|
{
|
2024-03-23 00:54:09 +08:00
|
|
|
type = types.nullOr (types.submodule { options =
|
|
|
|
{
|
|
|
|
hostname = mkOption { type = types.nonEmptyStr; default = "ua.chn.moe"; };
|
|
|
|
};});
|
|
|
|
default = null;
|
2023-11-12 17:29:40 +08:00
|
|
|
};
|
2024-03-23 00:54:09 +08:00
|
|
|
config = let inherit (inputs.config.nixos.services) httpua; in inputs.lib.mkIf (httpua != null)
|
|
|
|
{
|
|
|
|
nixos.services =
|
2023-11-12 17:29:40 +08:00
|
|
|
{
|
2024-03-23 00:54:09 +08:00
|
|
|
phpfpm.instances.httpua = {};
|
|
|
|
nginx.http.${httpua.hostname}.php =
|
|
|
|
{ root = "${./.}"; fastcgiPass = inputs.config.nixos.services.phpfpm.instances.httpua.fastcgi; };
|
2023-11-12 17:29:40 +08:00
|
|
|
};
|
2024-03-23 00:54:09 +08:00
|
|
|
};
|
2023-11-12 17:29:40 +08:00
|
|
|
}
|