class NixpkgsMetaAnalyzer extends AbstractMetaAnalyzer {
    private static final Logger LOGGER = Logger.getLogger(NixpkgsMetaAnalyzer.class);
    private static final String DEFAULT_CHANNEL_URL = "https://channels.nixos.org/nixpkgs-unstable/packages.json.br";
    private static final Cache<String, Map<String, String>> CACHE = Caffeine.newBuilder()
            .expireAfterWrite(60, TimeUnit.MINUTES)
            .maximumSize(1)
            .build();

    NixpkgsMetaAnalyzer() {
        this.baseUrl = DEFAULT_CHANNEL_URL;
    }

    /**
     * {@inheritDoc}
     */
    public MetaModel analyze(Component component) {<FILL_FUNCTION_BODY>}


    private CloseableHttpResponse processHttpRequest5(CloseableHttpClient client) throws IOException {
        try {
            URIBuilder uriBuilder = new URIBuilder(baseUrl);
            final HttpGet request = new HttpGet(uriBuilder.build().toString());
            request.addHeader("accept", "application/json");

            return client.execute(request);

        } catch (URISyntaxException ex) {
            handleRequestException(LOGGER, ex);
            return null;
        }
    }

    /**
     * {@inheritDoc}
     */
    public RepositoryType supportedRepositoryType() {
        return RepositoryType.NIXPKGS;
    }

    /**
     * {@inheritDoc}
     */
    public boolean isApplicable(Component component) {
        final var purl = component.getPurl();
        return purl != null && "nixpkgs".equals(purl.getType());
    }
}

        Map<String, String> latestVersions = CACHE.get("nixpkgs", cacheKey -> {
            final var versions = new HashMap<String, String>();
            try (final CloseableHttpClient client = HttpClients.createDefault()) {
                try (final CloseableHttpResponse packagesResponse = processHttpRequest5(client)) {
                    if (packagesResponse != null && packagesResponse.getCode() == HttpStatus.SC_OK) {
                        var reader = new BufferedReader(new InputStreamReader(packagesResponse.getEntity().getContent()));
                        var packages = new JSONObject(new JSONTokener(reader)).getJSONObject("packages").toMap().values();
                        packages.forEach(pkg -> {
                            // FUTUREWORK(mangoiv): there are potentially packages with the same pname
                            if (pkg instanceof HashMap jsonPkg) {
                                final var pname = jsonPkg.get("pname");
                                final var version = jsonPkg.get("version");
                                versions.putIfAbsent((String) pname, (String) version);
                            }
                        });


                    }
                }
            } catch (IOException ex) {
                LOGGER.debug(ex.toString());
                handleRequestException(LOGGER, ex);
            } catch (Exception ex) {
                LOGGER.debug(ex.toString());
                throw new MetaAnalyzerException(ex);
            }
            return versions;
        });
        final var meta = new MetaModel(component);
        final var purl = component.getPurl();
        if (purl != null) {
            final var newerVersion = latestVersions.get(purl.getName());
            if (newerVersion != null) {
                meta.setLatestVersion(newerVersion);
            }
        }
        return meta;
    
<methods>public non-sealed void <init>() ,public void setRepositoryBaseUrl(java.lang.String) ,public void setRepositoryUsernameAndPassword(java.lang.String, java.lang.String) <variables>protected java.lang.String baseUrl,protected java.lang.String password,protected java.lang.String username