feat: add shell-intellij-gradle-openjdk.nix

This commit is contained in:
Daniel Langbein 2024-11-28 21:10:53 +01:00
parent 8c9ad1290e
commit 61f22afc5a
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002
2 changed files with 41 additions and 5 deletions

View File

@ -29,12 +29,13 @@ in
# /run/current-system/sw/bin/python3 # /run/current-system/sw/bin/python3
# This makes it easier to configure it as interpreter in Jetbrain's IDE. # This makes it easier to configure it as interpreter in Jetbrain's IDE.
python3 python3
# Gradle build tool
gradle # To use Gradle within InelliJ (or to use a specific OpenJDK version with Gradle), see
# LTS OpenJDK # shell-intellij-grade-openjd.nix
# If a more recent OpenJDK version than the bundled JDK is needed
#unstable.jdk #unstable.jdk
# Latest OpenJDK #unstable.jdk23
unstable.jdk23
# Markdown preview # Markdown preview
#pandoc #pandoc

View File

@ -0,0 +1,35 @@
# Example from my (non public) Software Quality course homework.
# That (private) repo might contain a more up to date version.
{
pkgs ? import <nixpkgs> {
# https://github.com/NixOS/nixpkgs/issues/166220#issuecomment-1745803058
config.allowUnfree = true;
}
}:
let
unstable = import (fetchTarball https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz) { };
# https://github.com/NixOS/nixpkgs/blob/4b218e54ae22c8b3ad642ff0dec842363c3abd0f/pkgs/top-level/all-packages.nix#L14583-L14588
jdk = unstable.jdk23.override {
enableJavaFX = true;
openjfx_jdk = unstable.openjfx23.override { withWebKit = true; };
};
# https://github.com/NixOS/nixpkgs/blob/23e89b7da85c3640bbc2173fe04f4bd114342367/pkgs/development/tools/build-managers/gradle/default.nix#L46
gradle = unstable.gradle.override { java = jdk; };
in
(
# Gradle's toolchain support does not work with IntelliJ, thus we have to use buildFHSUserEnv
pkgs.buildFHSUserEnv
{
name = "intellij-gradle-jdk23";
targetPkgs = pkgs_: [
pkgs_.jetbrains.idea-ultimate
jdk
gradle
];
}
).env