mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-24 12:18:46 +08:00
24 lines
639 B
Nix
24 lines
639 B
Nix
inputs:
|
|
{
|
|
options.nixos.services.nginx.applications.main = let inherit (inputs.lib) mkOption types; in
|
|
{
|
|
enable = mkOption { type = types.bool; default = false; };
|
|
};
|
|
config =
|
|
let
|
|
inherit (inputs.config.nixos.services.nginx.applications) main;
|
|
inherit (inputs.lib) mkIf;
|
|
in mkIf main.enable
|
|
{
|
|
nixos.services.nginx.https."chn.moe".location =
|
|
{
|
|
"/".return.return = "302 https://xn--s8w913fdga.chn.moe/@chn";
|
|
"/.well-known/matrix/server".proxy =
|
|
{
|
|
setHeaders.Host = "matrix.chn.moe";
|
|
upstream = "https://matrix.chn.moe";
|
|
};
|
|
};
|
|
};
|
|
}
|