diff --git a/modules/factories/mkserver.nix b/modules/factories/mkserver.nix index 47e645a..96993cd 100644 --- a/modules/factories/mkserver.nix +++ b/modules/factories/mkserver.nix @@ -53,59 +53,8 @@ let default = null; }; }; - proxy = locations: { - inherit locations; - forceSSL = true; - enableACME = true; - http2 = true; - }; - proxyReverse = - cfg: - proxy { - "/" = { - proxyPass = "http://${cfg.ip}:${toString cfg.port}/"; - proxyWebsockets = cfg.enableSocket; - }; - }; - proxyReverseFix = - cfg: - let - useLocalhost = cfg.hostName == config.networking.hostName; - localHeaders = '' - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - ''; - in - proxyReverse cfg - // { - extraConfig = '' - ${if useLocalhost then localHeaders else ""} - proxy_set_header X-Forwarded-Host $host; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $http_connection; - proxy_redirect off; - proxy_http_version 1.1; - ''; - }; - proxyReversePrivate = - cfg: - proxyReverse cfg - // { - extraConfig = '' - ssl_verify_client on; - ssl_client_certificate ${cfg.certPath}; - error_page 403 /403.html; - ''; - }; in { - inherit - mkOptions - proxy - proxyReverse - proxyReverseFix - proxyReversePrivate - ; + inherit mkOptions; mkServerOptions = mkOptions; } diff --git a/parts/core.nix b/parts/core.nix index 07e9bac..727b5f2 100644 --- a/parts/core.nix +++ b/parts/core.nix @@ -148,28 +148,6 @@ in if shellType == "bash" then { initExtra = bashContent; } else { initContent = zshContent; }; mergeAliases = baseAliases: extraAliases: baseAliases // extraAliases; importDotfile = path: import path; - mkScriptOptions = lib: { - enable = lib.mkEnableOption "Whether to enable this script"; - install = lib.mkEnableOption "Whether to install the script package"; - service = lib.mkEnableOption "Whether to enable the script service"; - name = lib.mkOption { - type = lib.types.str; - description = "Name of the script."; - }; - timer = lib.mkOption { - type = lib.types.str; - default = "*:0"; - description = "Systemd timer schedule."; - }; - description = lib.mkOption { - type = lib.types.str; - description = "Description of the service."; - }; - package = lib.mkOption { - type = lib.types.package; - description = "Package containing the executable script."; - }; - }; getServicesWithNativeFirewall = config: blacklist: config.my.servers