{ description = "Java dev environment"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; outputs = { self, nixpkgs }: let systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f { pkgs = import nixpkgs { inherit system; }; }); in { packages = forAllSystems ({ pkgs }: { default = pkgs.stdenv.mkDerivation { pname = "hello-java"; version = "0.1.0"; src = ./.; nativeBuildInputs = [ pkgs.jdk ]; buildPhase = '' javac hello.java ''; installPhase = '' mkdir -p $out/share/java $out/bin cp hello.class $out/share/java/ cat > $out/bin/hello-java <