2024-05-22 19:43:12 +02:00
|
|
|
{
|
2024-05-27 18:34:24 +02:00
|
|
|
description = "CI, devshell and package definition for learningpulse";
|
2024-05-22 19:43:12 +02:00
|
|
|
inputs = {
|
2024-05-27 18:34:24 +02:00
|
|
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
2024-05-22 19:43:12 +02:00
|
|
|
};
|
2024-05-27 18:34:24 +02:00
|
|
|
outputs = { self, nixpkgs, ... }:
|
2024-05-22 19:43:12 +02:00
|
|
|
let
|
2024-05-27 18:34:24 +02:00
|
|
|
# TODO add more systems
|
|
|
|
system = "x86_64-linux";
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
|
|
|
|
buildPackages = with pkgs; [
|
|
|
|
jdk22
|
|
|
|
makeWrapper
|
2024-05-24 09:37:55 +02:00
|
|
|
];
|
2024-05-27 18:34:24 +02:00
|
|
|
in
|
|
|
|
rec {
|
|
|
|
packages.${system} =
|
|
|
|
{
|
|
|
|
learningpulse-gateway = pkgs.maven.buildMavenPackage rec {
|
|
|
|
pname = "gateway";
|
|
|
|
version = "0.0.1";
|
2024-05-24 09:37:55 +02:00
|
|
|
|
2024-05-27 18:34:24 +02:00
|
|
|
src = ./.;
|
|
|
|
# todo get automatically
|
|
|
|
mvnHash = "sha256-YCK1Qujgx73cZdEx2mRip+y+66px5TxL247fBIMyoy4=";
|
2024-05-22 20:18:04 +02:00
|
|
|
|
2024-05-27 18:34:24 +02:00
|
|
|
nativeBuildInputs = buildPackages;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/share/${pname}
|
2024-05-28 23:42:05 +02:00
|
|
|
install -Dm644 ${pname}/target/${pname}-${version}.jar $out/share/${pname}
|
2024-05-27 18:34:24 +02:00
|
|
|
|
2024-05-28 23:42:05 +02:00
|
|
|
makeWrapper ${pkgs.jre8}/bin/java $out/bin/${pname} \
|
2024-05-27 18:34:24 +02:00
|
|
|
--add-flags "-jar $out/share/${pname}/${pname}-${version}.jar"
|
|
|
|
'';
|
2024-05-25 16:33:17 +02:00
|
|
|
};
|
2024-05-28 23:42:05 +02:00
|
|
|
|
2024-05-27 18:34:24 +02:00
|
|
|
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}
|
2024-05-28 23:42:05 +02:00
|
|
|
install -Dm644 ${pname}/target/${pname}-${version}.jar $out/share/${pname}
|
2024-05-27 18:34:24 +02:00
|
|
|
|
2024-05-28 23:42:05 +02:00
|
|
|
makeWrapper ${pkgs.jre8}/bin/java $out/bin/${pname} \
|
2024-05-27 18:34:24 +02:00
|
|
|
--add-flags "-jar $out/share/${pname}/${pname}-${version}.jar"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-05-27 20:26:32 +02:00
|
|
|
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}
|
2024-05-28 23:42:05 +02:00
|
|
|
install -Dm644 ${pname}/target/${pname}-${version}.jar $out/share/${pname}
|
2024-05-27 20:26:32 +02:00
|
|
|
|
2024-05-28 23:42:05 +02:00
|
|
|
makeWrapper ${pkgs.jre8}/bin/java $out/bin/${pname} \
|
2024-05-27 20:26:32 +02:00
|
|
|
--add-flags "-jar $out/share/${pname}/${pname}-${version}.jar"
|
|
|
|
'';
|
2024-05-28 23:42:05 +02:00
|
|
|
|
2024-05-27 20:26:32 +02:00
|
|
|
};
|
2024-05-27 18:34:24 +02:00
|
|
|
};
|
2024-05-27 20:26:32 +02:00
|
|
|
|
2024-05-28 23:42:05 +02:00
|
|
|
|
2024-05-27 18:34:24 +02:00
|
|
|
hydraJobs = {
|
|
|
|
inherit (self)
|
|
|
|
packages;
|
|
|
|
};
|
|
|
|
|
|
|
|
devShells."${system}".default = pkgs.mkShell {
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
maven
|
|
|
|
jdk22
|
|
|
|
jre8
|
2024-05-30 04:20:39 +02:00
|
|
|
# top run actions locally
|
|
|
|
act
|
2024-05-27 18:34:24 +02:00
|
|
|
];
|
2024-05-22 20:18:04 +02:00
|
|
|
};
|
2024-05-22 19:43:12 +02:00
|
|
|
};
|
2024-05-27 18:34:24 +02:00
|
|
|
|
2024-05-22 19:43:12 +02:00
|
|
|
}
|