{ config, lib, ... }: let inherit (lib) mkEnableOption mkIf mkOption types ; cfg = homelab.services.${service}; homelab = config.homelab; service = "freshrss"; in { options.homelab.services.${service} = { enable = mkEnableOption "Enable ${service}"; url = mkOption { default = "freshrss.${homelab.domain}"; type = types.str; }; }; config = mkIf cfg.enable { services = { ${service} = { enable = true; baseUrl = "https://${cfg.url}"; passwordFile = config.age.secrets.freshrss-password-file.path; virtualHost = cfg.url; }; nginx.virtualHosts.${cfg.url} = { useACMEHost = homelab.domain; forceSSL = true; }; }; }; }