{ lib, stdenv, callPackage, clojure, jre, build-tools-jar, writeTextDir , writeShellScript, toEDN }: { src, name, group, version, clj-deps, src-paths }: with lib; let pthru = o: builtins.trace o o; build-tools-edn = toEDN { aliases.build = { ns-build = "'build"; replace-deps."'io.github.clojure/tools.build"."local/root" = "${build-tools-jar}"; }; }; build-tools-deps = writeTextDir "deps.edn" (pthru build-tools-edn); classpath = clj-deps.makeClasspaths { }; full-name = "${group}-${name}-${version}-standalone.jar"; target = "$TEMP/target"; build-script = writeShellScript "create-uberjar.sh" '' HOME=$TEMP/home mkdir -p $HOME mkdir -p ${target} clojure \ -Scp .:${build-tools-jar}:${classpath} \ -Sdeps ${builtins.trace build-tools-deps build-tools-deps} \ -X:build \ lib-uberjar \ :project ${group}/${name} \ :version ${version} \ :srcs ${concatStringsSep "," src-paths} \ :target ${target} ''; in stdenv.mkDerivation { name = name; src = src; nativeBuildInputs = [ clojure jre ]; buildInputs = (map (x: x.paths) clj-deps.packages); buildPhase = let script-call = "${build-script}"; in builtins.trace script-call script-call; installPhase = '' mv ${target}/${name}-${version}-standalone.jar $out ''; }