flake: basic hydra job

doesn't work but who cares am i right?
This commit is contained in:
2005 2024-05-22 20:18:04 +02:00
parent 9bc2af66d1
commit 529e34cba9
3 changed files with 52 additions and 8 deletions

View file

@ -2,16 +2,16 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1716218643,
"narHash": "sha256-i/E7gzQybvcGAYDRGDl39WL6yVk30Je/NXypBz6/nmM=",
"owner": "NixOS",
"lastModified": 1716293225,
"narHash": "sha256-pU9ViBVE3XYb70xZx+jK6SEVphvt7xMTbm6yDIF4xPs=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a8695cbd09a7ecf3376bd62c798b9864d20f86ee",
"rev": "3eaeaeb6b1e08a016380c279f8846e0bd8808916",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}

View file

@ -2,10 +2,15 @@
description = "Learning Pulse";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }:
outputs =
{ self
, nixpkgs
, maven
, makeWrapper
}:
let
javaVersion = 22;
overlays = [
@ -19,8 +24,36 @@
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit overlays system; };
});
in
{
hydraJobs = {
gateway = maven.buildMavenPackage rec {
pname = "learningpulse-gateway";
version = "1.2.1";
src = ./gateway;
mvnHash = "sha256-kLpjMj05uC94/5vGMwMlFzLKNFOKeyNvq/vmB6pHTAo=";
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
mkdir -p $out/bin $out/share/jd-cli
install -Dm644 jd-cli/target/jd-cli.jar $out/share/jd-cli
makeWrapper ${nixpkgs.pkgs.jre8}/bin/java $out/bin/jd-cli \
--add-flags "-jar $out/share/jd-cli/jd-cli.jar"
'';
meta = with lib; {
description = "The api gateway for learningpulse";
homepage = "https://git.4o1x5.dev/learningpulse/server";
license = licenses.gpl3Plus;
};
};
};
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [

11
hydra.md Normal file
View file

@ -0,0 +1,11 @@
# Go to root then hydra
```bash
su
su - hydra
```
# Create an user
hydra-create-user <USER> --full-name '<NAME>' \
--email-address '<EMAIL>' --password-prompt --role admin