about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/misc/polylith/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/misc/polylith/default.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/misc/polylith/default.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/misc/polylith/default.nix b/nixpkgs/pkgs/development/tools/misc/polylith/default.nix
new file mode 100644
index 000000000000..4397fd11a27b
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/polylith/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchurl, jdk, runtimeShell }:
+
+stdenv.mkDerivation rec {
+  pname = "polylith";
+  version = "0.2.12-alpha";
+
+  src = fetchurl {
+    url = "https://github.com/polyfy/polylith/releases/download/v${version}/poly-${version}.jar";
+    sha256 = "1zsasyrrssj7kmvgfr63fa5hslw9gnlbp9bh05g72bfgzi99n8kg";
+  };
+
+  dontUnpack = true;
+
+  passAsFile = [ "polyWrapper" ];
+  polyWrapper = ''
+    #!${runtimeShell}
+    ARGS=""
+    while [ "$1" != "" ] ; do
+      ARGS="$ARGS $1"
+      shift
+    done
+    exec "${jdk}/bin/java" "-jar" "${src}" $ARGS
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin
+    cp "$polyWrapperPath" $out/bin/poly
+    chmod a+x $out/bin/poly
+
+    runHook postInstall
+  '';
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    runHook preInstallCheck
+
+    $out/bin/poly help | fgrep -q '${version}'
+
+    runHook postInstallCheck
+  '';
+
+  meta = with lib; {
+    description = "A tool used to develop Polylith based architectures in Clojure";
+    homepage = "https://github.com/polyfy/polylith";
+    license = licenses.epl10;
+    maintainers = with maintainers; [ ericdallo jlesquembre ];
+    platforms = jdk.meta.platforms;
+  };
+}