This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
server/flake.nix
2005 6e3904b153
Some checks failed
build and publish docker image / deploy / build (push) Failing after 20s
act to build and publish images, test
2024-05-30 04:20:39 +02:00

96 lines
2.7 KiB
Nix

{
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
# top run actions locally
act
];
};
};
}