From 21012c1c2b75c69278ee0363e52513ca90d8b9a8 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Tue, 19 Nov 2024 19:17:15 +0100 Subject: [PATCH] WIP: shell.nix --- shell (Copy).nix | 19 +++++++++++++++++++ shell.nix | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 shell (Copy).nix create mode 100644 shell.nix diff --git a/shell (Copy).nix b/shell (Copy).nix new file mode 100644 index 0000000..64f3dd9 --- /dev/null +++ b/shell (Copy).nix @@ -0,0 +1,19 @@ +{ pkgs ? import { } }: + +let + unstable = import (fetchTarball https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz) { }; + jdk = unstable.jdk23; +in + +# Open issue: gradle's toolchain support does not work with IntelliJ +# Solution from 2022 did no longer work: https://github.com/NixOS/nixpkgs/issues/207153#issue-1506967648 +# Instead we found this: https://discourse.nixos.org/t/overriding-the-jdk-for-gradle-in-a-nix-flake/36541/2 + +pkgs.mkShell { + buildInputs = with pkgs; [ + jdk + (callPackage gradle-packages.gradle_8 { + java = jdk; + }) + ]; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..b58c056 --- /dev/null +++ b/shell.nix @@ -0,0 +1,18 @@ +{ pkgs ? import { } }: + +let + unstable = import (fetchTarball https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz) { }; + toolchains = [ unstable.jdk23 ]; +in + +pkgs.mkShell { + nativeBuildInputs = [ + (unstable.gradle.overrideAttrs (curr: old: { + fixupPhase = '' + cat > $out/lib/gradle/gradle.properties <