Compare commits
6 commits
d03b910044
...
18982bc69f
Author | SHA1 | Date | |
---|---|---|---|
2005 | 18982bc69f | ||
2005 | 3534dee0f4 | ||
2005 | 977a943504 | ||
2005 | 9b23cd16c2 | ||
2005 | d811c86345 | ||
2005 | fbfa29a867 |
13
flake.lock
13
flake.lock
|
@ -2,18 +2,17 @@
|
|||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1716293225,
|
||||
"narHash": "sha256-pU9ViBVE3XYb70xZx+jK6SEVphvt7xMTbm6yDIF4xPs=",
|
||||
"owner": "nixos",
|
||||
"lastModified": 1716509168,
|
||||
"narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "3eaeaeb6b1e08a016380c279f8846e0bd8808916",
|
||||
"rev": "bfb7a882678e518398ce9a31a881538679f6f092",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
|
|
97
flake.nix
97
flake.nix
|
@ -1,48 +1,73 @@
|
|||
{
|
||||
description = "Learning Pulse";
|
||||
|
||||
description = "CI, devshell and package definition for learningpulse";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self
|
||||
, nixpkgs
|
||||
, maven
|
||||
, makeWrapper
|
||||
}:
|
||||
outputs = { self, nixpkgs, ... }:
|
||||
let
|
||||
javaVersion = 22;
|
||||
overlays = [
|
||||
(final: prev: rec {
|
||||
jdk = prev."jdk${toString javaVersion}";
|
||||
gradle = prev.gradle.override { java = jdk; };
|
||||
maven = prev.maven.override { inherit jdk; };
|
||||
})
|
||||
];
|
||||
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
||||
pkgs = import nixpkgs { inherit overlays system; };
|
||||
});
|
||||
|
||||
# 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}-${version}
|
||||
|
||||
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}-${version}
|
||||
|
||||
makeWrapper ${pkgs.jre8}/bin/java $out/bin/${pname}- \
|
||||
--add-flags "-jar $out/share/${pname}/${pname}-${version}.jar"
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
hydraJobs = {
|
||||
gateway = maven.buildMavenPackage rec {
|
||||
pname = "learningpulse-gateway";
|
||||
version = "1.2.1";
|
||||
#
|
||||
# hello i wrote something here to test pulling
|
||||
inherit (self)
|
||||
packages;
|
||||
};
|
||||
|
||||
devShells."${system}".default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
maven
|
||||
jdk22
|
||||
jre8
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
devShells = forEachSupportedSystem ({ pkgs }: {
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
jdk
|
||||
maven
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
<groupId>com.learningpulse</groupId>
|
||||
<artifactId>server</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<artifactId>gateway</artifactId>
|
||||
<version>0.0.1</version>
|
||||
|
|
Reference in a new issue