{ config, lib, pkgs, ... }:
let
    hasGui = config.services.dbus.implementation == "dbus";
    openjfx_jdk = pkgs.openjfx.override {
        withWebKit = true;
    };
in
{
    config = lib.mkIf hasGui
    {
        programs.java = {
            enable = true;
            package = pkgs.jdk21.override {
                enableJavaFX = true;
                inherit openjfx_jdk;
            };
        };

        environment.systemPackages = with pkgs; [
            gradle
            netbeans
            dejavu_fonts
        ];

        programs.nix-ld = {
            enable = true;
            libraries = (with pkgs; [
                libxrender
                libxi
                libxcursor
                libxtst
                
                alsa-lib
                libjack2
                libpulseaudio
                pipewire

                ## glfw
                libGL
                libx11
                libxcursor
                libxext
                libxrandr
                libxxf86vm
                freetype
                libxft
            ]);
        };
    };
}