{ config, lib, ... }: let cfg = config.custom.web-services.glance; in { options.custom.web-services.glance = { enable = lib.mkEnableOption ""; domain = lib.mkOption { type = lib.types.nonEmptyStr; default = ""; }; port = lib.mkOption { type = lib.types.port; default = 63958; }; }; config = lib.mkIf cfg.enable { services.glance = { enable = true; settings = { inherit (cfg) port; #pages }; }; custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port; }; }