Browse Source

nixification

main
Dustin Frisch 1 year ago
parent
commit
faeea6cd76
No known key found for this signature in database GPG Key ID: B4C3BF012D9B26BE
  1. 50
      default.nix
  2. 2099
      mvn2nix-lock.json

50
default.nix

@ -0,0 +1,50 @@
{ pkgs
, stdenv
, fetchFromGitHub
, jdk17_headless
, maven
, nix-gitignore
, makeWrapper
, ...
}:
let
mvn2nix = fetchFromGitHub {
owner = "fzakaria";
repo = "mvn2nix";
rev = "master";
hash = "sha256-v/HvYqzkPaGin1ujo+Fi59wXC9vWxW3lYVSwElORRi8=";
};
repository = (pkgs.callPackage "${mvn2nix}/maven.nix" {}).buildMavenRepositoryFromLockFile {
file = ./mvn2nix-lock.json;
};
in stdenv.mkDerivation rec {
name = "ldap-sync";
src = nix-gitignore.gitignoreSource [] ./.;
nativeBuildInputs = [ jdk17_headless maven makeWrapper ];
buildPhase = ''
mvn --offline -Dmaven.repo.local=${repository} package -DskipTests;
'';
testPhase = ''
mvn --offline -Dmaven.repo.local=${repository} verify;
'';
installPhase = ''
ls -l target
install -Dm644 target/${name}-1.0-SNAPSHOT-jar-with-dependencies.jar $out/share/java/${name}.jar
makeWrapper ${jdk17_headless}/bin/java $out/bin/${name} \
--add-flags "-jar $out/share/java/${name}.jar"
'';
passthru = {
inherit repository;
};
}

2099
mvn2nix-lock.json
File diff suppressed because it is too large
View File

Loading…
Cancel
Save