-
Notifications
You must be signed in to change notification settings - Fork 488
Expand file tree
/
Copy pathflake.nix
More file actions
52 lines (48 loc) · 1.63 KB
/
flake.nix
File metadata and controls
52 lines (48 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
description = "James dev env";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
outputs = { self, nixpkgs }:
let
javaVersion = 21; # Change this value to update the whole stack
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; overlays = [ self.overlays.default ]; };
});
in
{
overlays.default =
final: prev:
let
jdk = prev."temurin-bin-${toString javaVersion}";
in
{
inherit jdk;
maven = prev.maven.override { jdk_headless = jdk; };
# gradle = prev.gradle.override { java = jdk; };
};
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
antora # build documentation
bundler # homepage and blog
bundix
cacert # ssl certificate management
dive # explore generated docker images
git # version control
jdk # build and run james
maven # build james
];
MAVEN_OPTS = "-Djna.library.path=" + pkgs.lib.makeLibraryPath [pkgs.udev];
JAVA_HOME = "${pkgs.jdk}";
shellHook =
let
prev = "\${JAVA_TOOL_OPTIONS:+ $JAVA_TOOL_OPTIONS}";
in
''
export JAVA_TOOL_OPTIONS="${prev}"
echo "Experimental JAMES development environment activated"
'';
};
});
};
}