{ pkgs, lib, config, ... }: let cfg = config.cos.tandoor; in { options.cos.tandoor = { enable = lib.mkEnableOption "enable Tandoor"; hostname = lib.mkOption { type = lib.types.str; }; port = lib.mkOption { type = lib.types.port; }; }; config = lib.mkIf cfg.enable { services.tandoor-recipes = { enable = true; port = cfg.port; address = "127.0.0.1"; }; services.nginx = { enable = true; virtualHosts.${cfg.hostname} = { enableACME = true; forceSSL = true; locations."/" = { proxyPass = "http://127.0.0.1:${builtins.toString cfg.port}"; }; }; }; }; }