{ config, lib, self, ... }: let cfg = config.py.services.scrutiny.collector; apiUrl = "https://marvin.${self.lib.data.tsNet}:${toString self.lib.data.services.scrutiny.port}"; in { options.py.services.scrutiny = { collector = { enable = lib.mkEnableOption "Scrutiny Collector"; extraSettings = lib.mkOption { type = lib.types.attrs; description = "Extra settings to merge to the default scrutiny collector options"; default = { }; }; }; }; config.services.scrutiny.collector = lib.mkIf cfg.enable { enable = true; settings = { host.id = config.networking.hostName; api.endpoint = apiUrl; } // cfg.extraSettings; }; }