mirror of
https://codeberg.org/privacy1st/nix-git
synced 2024-12-03 23:55:04 +01:00
feat: add shell-intellij-gradle-openjdk.nix
This commit is contained in:
parent
8c9ad1290e
commit
61f22afc5a
@ -29,12 +29,13 @@ in
|
||||
# /run/current-system/sw/bin/python3
|
||||
# This makes it easier to configure it as interpreter in Jetbrain's IDE.
|
||||
python3
|
||||
# Gradle build tool
|
||||
gradle
|
||||
# LTS OpenJDK
|
||||
|
||||
# To use Gradle within InelliJ (or to use a specific OpenJDK version with Gradle), see
|
||||
# shell-intellij-grade-openjd.nix
|
||||
|
||||
# If a more recent OpenJDK version than the bundled JDK is needed
|
||||
#unstable.jdk
|
||||
# Latest OpenJDK
|
||||
unstable.jdk23
|
||||
#unstable.jdk23
|
||||
|
||||
# Markdown preview
|
||||
#pandoc
|
||||
|
35
shell-intellij-gradle-openjdk.nix
Normal file
35
shell-intellij-gradle-openjdk.nix
Normal 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
|
Loading…
Reference in New Issue
Block a user