mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-24 13:18:45 +08:00
26 lines
680 B
Nix
26 lines
680 B
Nix
|
inputs:
|
||
|
{
|
||
|
options.nixos.services.httpua = let inherit (inputs.lib) mkOption types; in
|
||
|
{
|
||
|
enable = mkOption { type = types.bool; default = false; };
|
||
|
hostname = mkOption { type = types.nonEmptyStr; default = "ua.chn.moe"; };
|
||
|
};
|
||
|
config =
|
||
|
let
|
||
|
inherit (inputs.config.nixos.services) httpua;
|
||
|
inherit (inputs.lib) mkIf;
|
||
|
inherit (builtins) toString;
|
||
|
in mkIf httpua.enable
|
||
|
{
|
||
|
nixos.services =
|
||
|
{
|
||
|
phpfpm.instances.httpua = {};
|
||
|
nginx.http.${httpua.hostname}.php =
|
||
|
{
|
||
|
root = toString ./.;
|
||
|
fastcgiPass = inputs.config.nixos.services.phpfpm.instances.httpua.fastcgi;
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|