!aRKdLCkUeIFjRPZuJT:nixos.org

NixOS JVM

135 Members
27 Servers

Load older messages


SenderMessageTime
18 Apr 2026
@britter:yatrix.orgBenedikt Ritter (britter)I wrote about Gradle build support a while ago, maybe this helps? https://britter.dev/blog/2025/01/02/gradle-nix/15:41:39
@britter:yatrix.orgBenedikt Ritter (britter)Not exactly sure why. Maybe for AWT / Swing? You can try building with jdk21_headless if you dont need desktop code.15:42:52
@alice:the-apothecary.clubAlicewell, it's not untrue that headless variant is for headless operation, but it is still kinda weird that non-headless version depends on non-jvm desktop code?15:47:35
@ami:the-apothecary.clubAmipretty sure it could've been an optional dependency, but nix doesn't really have such a concept17:14:12
@msgilligan:matrix.orgmsgilliganI think overrides are the Nix way of doing “optional” dependencies17:15:30
@msgilligan:matrix.orgmsgilligan(i.e. build-time rather than run-time)17:22:04
@alice:the-apothecary.clubAlice well, there are 3 -times, no? build-time install-time run-time? or for nix installation(/evaluation?) just runtime? 17:39:12
@samasaur:matrix.orgsamasaur yea if you want no gtk you can do openjdk.override { enableGtk = false }, or use headless which also turns off jdk 17:43:45
@samasaur:matrix.orgsamasaurthere's not really the traditional install-time17:44:46
@alice:the-apothecary.clubAlicewell, making a derivation(?) doesn't mentally fit into either runtime nor build time to us?17:46:00
@samasaur:matrix.orgsamasaurbuilding a derivation ~= traditional build time and install time17:47:45
@samasaur:matrix.orgsamasaurmore or less17:47:50
@alice:the-apothecary.clubAlicehmm, where would that go?18:01:41
@samasaur:matrix.orgsamasaurare you referencing openjdk directly or is it a dependency of something?18:04:19
@alice:the-apothecary.clubAliceit's a gradle build18:04:29
@samasaur:matrix.orgsamasaurso the latter?18:05:16
@samasaur:matrix.orgsamasaur like in your nix config you're not ever referencing openjdk 18:05:28
@alice:the-apothecary.clubAliceyes (well, in the project flake)18:05:55
@samasaur:matrix.orgsamasaurah yeah not necessarily a config, my bad18:06:07
@samasaur:matrix.orgsamasaurin that case you'll want to override the derivation that depends on openjdk to use the overridden one18:06:35
@samasaur:matrix.orgsamasaur

e.g.

hello.override {
  openjdk = openjdk.override {
    enableGtk = false;
  };
}
18:07:01
@samasaur:matrix.orgsamasaurthe alternative to doing this on a case-by-case basis is to add an override to your instantiation of nixpkgs so that gtk is off for openjdk everywhere openjdk is used18:07:49
@samasaur:matrix.orgsamasaurwhich has wider-ranging implications obviously but i think shoujld be fine in this case18:08:08
@alice:the-apothecary.clubAlicewe just, don't want nix to pull in dependencies which are not actually required18:08:23
@samasaur:matrix.orgsamasauris this flake public somewhere18:08:49
@alice:the-apothecary.clubAlice (like, this flake we are making does not require gtk/graphics, but if some other thing on the system does, we don't want nix to pull openjdk and openjdk with disabled gtk 18:09:48
@alice:the-apothecary.clubAlicewell, the flake itself is pretty small, so, here,18:11:29
@samasaur:matrix.orgsamasaurwell that's hard to do because the flake is pure and doesn't depend on the system18:11:28
@alice:the-apothecary.clubAliceDownload flake.nix18:11:29
@samasaur:matrix.orgsamasaurthere's no way for the flake to know whether the system already needs openjdk with GTK18:11:54

Show newer messages


Back to Room ListRoom Version: 6