{ description = "CI, devshell and package definition for learningpulse"; inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; }; outputs = { self, nixpkgs, ... }: let # TODO add more systems system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; }; buildPackages = with pkgs; [ jdk22 makeWrapper ]; in rec { packages.${system} = { learningpulse-gateway = pkgs.maven.buildMavenPackage rec { pname = "gateway"; version = "0.0.1"; src = ./.; # todo get automatically mvnHash = "sha256-YCK1Qujgx73cZdEx2mRip+y+66px5TxL247fBIMyoy4="; nativeBuildInputs = buildPackages; installPhase = '' mkdir -p $out/bin $out/share/${pname} install -Dm644 ${pname}/target/${pname}-${version}.jar $out/share/${pname} makeWrapper ${pkgs.jre8}/bin/java $out/bin/${pname} \ --add-flags "-jar $out/share/${pname}/${pname}-${version}.jar" ''; }; learningpulse-eureka = pkgs.maven.buildMavenPackage rec { pname = "eureka"; version = "0.0.1"; src = ./.; # todo get automatically mvnHash = "sha256-YCK1Qujgx73cZdEx2mRip+y+66px5TxL247fBIMyoy4="; nativeBuildInputs = buildPackages; installPhase = '' mkdir -p $out/bin $out/share/${pname} install -Dm644 ${pname}/target/${pname}-${version}.jar $out/share/${pname} makeWrapper ${pkgs.jre8}/bin/java $out/bin/${pname} \ --add-flags "-jar $out/share/${pname}/${pname}-${version}.jar" ''; }; learningpulse-dummy = pkgs.maven.buildMavenPackage rec { pname = "dummy"; version = "0.0.1"; src = ./.; # todo get automatically mvnHash = "sha256-YCK1Qujgx73cZdEx2mRip+y+66px5TxL247fBIMyoy4="; nativeBuildInputs = buildPackages; installPhase = '' mkdir -p $out/bin $out/share/${pname} install -Dm644 ${pname}/target/${pname}-${version}.jar $out/share/${pname} makeWrapper ${pkgs.jre8}/bin/java $out/bin/${pname} \ --add-flags "-jar $out/share/${pname}/${pname}-${version}.jar" ''; }; }; hydraJobs = { inherit (self) packages; }; devShells."${system}".default = pkgs.mkShell { buildInputs = with pkgs; [ maven jdk22 jre8 ]; }; }; }