{ inputs, flake, self }:
{ config, pkgs, lib, ... }: let
  system = pkgs.system;
  cfg = config.banned.services.legacy-web;
in {
  options = {
    banned.services.legacy-web = {
      enable = lib.mkEnableOption "enable legacy redirect";
      domain = lib.mkOption {
        type = lib.types.str;
        example = ''
	  example.com
        '';
      };
    };
  };
  config = lib.mkIf cfg.enable {
      services.nginx.virtualHosts = {
        "${cfg.domain}" = {
	  enableACME    = true;
	  forceSSL      = true;
          locations."/" = {
            extraConfig = ''
              root ${flake}/static;
              try_files /redirect.html =404;
            '';
          };
        };
     };
  };
}
