2024-11-23 18:01:53 +01:00
|
|
|
# Gradle's toolchain support does not work with IntelliJ, thus we have to use buildFHSUserEnv
|
|
|
|
# https://discourse.nixos.org/t/how-to-create-a-development-environment-with-intellij-idea-and-openjdk/10153
|
2025-01-01 14:50:41 +00:00
|
|
|
|
|
|
|
# How to use `config.allowUnfree` in shell.nix
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/166220#issuecomment-1745803058
|
|
|
|
|
2024-11-23 18:01:53 +01:00
|
|
|
{
|
2025-01-01 14:50:41 +00:00
|
|
|
### Import with nix channels ###
|
|
|
|
#
|
2024-12-30 16:09:20 +00:00
|
|
|
# NixOS stable
|
2025-01-01 14:50:41 +00:00
|
|
|
#pkgs ? import <nixpkgs> {
|
|
|
|
# config.allowUnfree = true;
|
|
|
|
#},
|
2024-12-30 16:09:20 +00:00
|
|
|
# NixOS unstable
|
2025-01-01 14:50:41 +00:00
|
|
|
#unstable ? import <unstable> {
|
|
|
|
# config.allowUnfree = true;
|
|
|
|
#}
|
2024-11-23 18:01:53 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2025-01-01 14:50:41 +00:00
|
|
|
### Import with Niv ###
|
|
|
|
#
|
|
|
|
sources = import ./nix/sources.nix;
|
|
|
|
# NixOS stable
|
|
|
|
pkgs = import sources.nixpkgs {
|
|
|
|
config.allowUnfree = true;
|
|
|
|
};
|
|
|
|
# NixOS unstable
|
|
|
|
unstable = import sources.unstable {
|
|
|
|
config.allowUnfree = true;
|
|
|
|
};
|
|
|
|
|
2024-11-23 18:01:53 +01:00
|
|
|
jdk = unstable.jdk23;
|
|
|
|
gradle = unstable.gradle;
|
|
|
|
in
|
|
|
|
|
|
|
|
(
|
|
|
|
pkgs.buildFHSUserEnv
|
|
|
|
{
|
|
|
|
name = "intellij-gradle-jdk23";
|
|
|
|
targetPkgs = pkgs_: [
|
|
|
|
pkgs_.jetbrains.idea-ultimate
|
|
|
|
jdk
|
|
|
|
gradle
|
|
|
|
];
|
|
|
|
}
|
|
|
|
).env
|