diff --git a/devices/vps6/default.nix b/devices/vps6/default.nix index f0c88d35..bf86ce44 100644 --- a/devices/vps6/default.nix +++ b/devices/vps6/default.nix @@ -46,7 +46,7 @@ inputs: element.instances."element.chn.moe" = {}; synapse-admin.instances."synapse-admin.chn.moe" = {}; catalog.enable = true; - main.enable = true; + main = {}; nekomia.enable = true; blog = {}; sticker = {}; diff --git a/modules/services/nginx/applications/main.nix b/modules/services/nginx/applications/main.nix index 252564be..8b494d1a 100644 --- a/modules/services/nginx/applications/main.nix +++ b/modules/services/nginx/applications/main.nix @@ -1,23 +1,13 @@ inputs: { - options.nixos.services.nginx.applications.main = let inherit (inputs.lib) mkOption types; in + options.nixos.services.nginx.applications.main = let inherit (inputs.lib) mkOption types; in mkOption + { type = types.nullOr (types.submodule {}); default = null; }; + config = let inherit (inputs.config.nixos.services.nginx.applications) main; in inputs.lib.mkIf (main != null) { - 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 = { - 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"; - }; - }; + "/".return.return = "302 https://xn--s8w913fdga.chn.moe/@chn"; + "/.well-known/matrix/server".proxy = { setHeaders.Host = "matrix.chn.moe"; upstream = "https://matrix.chn.moe"; }; }; + }; }