This is an automated email from the ASF dual-hosted git repository. jhelou pushed a commit to branch staging in repository https://gitbox.apache.org/repos/asf/james-site.git
commit e8617586f6004f5e495d889fca9c1ba9ee7e4a87 Author: Jean Helou <[email protected]> AuthorDate: Thu Feb 26 08:58:18 2026 +0100 [JAMES-4175] introduce experimental nix env to enable repeatable builds --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..dd9771a81 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1771419570, + "narHash": "sha256-bxAlQgre3pcQcaRUm/8A0v/X8d2nhfraWSFqVmMcBcU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6d41bc27aaf7b6a3ba6b169db3bd5d6159cfaa47", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..fb7d56256 --- /dev/null +++ b/flake.nix @@ -0,0 +1,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 + cacert # ssl certificate management + dive # explore generated docker images + git # version control + jdk # build and run james + jekyll # homepage and blog + 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" + ''; + }; + }); + }; +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
