2024-11-28 21:10:53 +01:00
|
|
|
# Example from my (non public) Software Quality course homework.
|
|
|
|
# That (private) repo might contain a more up to date version.
|
|
|
|
|
2025-01-26 13:24:07 +01:00
|
|
|
{ }:
|
2024-11-28 21:10:53 +01:00
|
|
|
let
|
2025-01-26 13:24:07 +01:00
|
|
|
### Import nixpkgs with Niv ###
|
|
|
|
#
|
|
|
|
sources = import ./nix/sources.nix;
|
|
|
|
# nixpkgs stable
|
|
|
|
pkgs = import sources.nixpkgs {
|
|
|
|
# Required for IntelliJ Ultimate
|
|
|
|
config.allowUnfree = true;
|
|
|
|
};
|
2024-11-28 21:10:53 +01:00
|
|
|
|
2025-01-26 13:24:07 +01:00
|
|
|
# https://github.com/NixOS/nixpkgs/blob/d9e98537533e7d978556bd58739813a47db5d591/pkgs/top-level/all-packages.nix#L14078-L14083
|
|
|
|
jdk = pkgs.jdk23.override {
|
2024-11-28 21:10:53 +01:00
|
|
|
enableJavaFX = true;
|
2025-01-26 13:24:07 +01:00
|
|
|
openjfx_jdk = pkgs.openjfx23.override { withWebKit = true; };
|
2024-11-28 21:10:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# https://github.com/NixOS/nixpkgs/blob/23e89b7da85c3640bbc2173fe04f4bd114342367/pkgs/development/tools/build-managers/gradle/default.nix#L46
|
2025-01-26 13:24:07 +01:00
|
|
|
gradle = pkgs.gradle.override {
|
|
|
|
java = jdk;
|
|
|
|
javaToolchains = [ jdk ];
|
|
|
|
};
|
2024-11-28 21:10:53 +01:00
|
|
|
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
|