From 63cef72d95a7d7f1ed740388db1426dc5aa8eecb Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sun, 6 Aug 2023 19:40:54 +0200 Subject: [PATCH] questdb: use `finalAttrs` pattern --- pkgs/servers/nosql/questdb/default.nix | 33 +++++++++++++++----------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/pkgs/servers/nosql/questdb/default.nix b/pkgs/servers/nosql/questdb/default.nix index 6a6f9aa3537e..fc21fedc03d1 100644 --- a/pkgs/servers/nosql/questdb/default.nix +++ b/pkgs/servers/nosql/questdb/default.nix @@ -1,18 +1,23 @@ -{ fetchurl, jdk17_headless, lib, makeWrapper, stdenv }: +{ + fetchurl, + jdk17_headless, + lib, + makeBinaryWrapper, + stdenv +}: -let - jre = jdk17_headless; -in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "questdb"; version = "7.3"; src = fetchurl { - url = "https://github.com/questdb/questdb/releases/download/${version}/questdb-${version}-no-jre-bin.tar.gz"; - sha256 = "sha256-teZ9oJ5aUPs0aTUxyK9UmpFRclHZVLEVl0jlWbrbiBs="; + url = "https://github.com/questdb/questdb/releases/download/${finalAttrs.version}/questdb-${finalAttrs.version}-no-jre-bin.tar.gz"; + hash = "sha256-teZ9oJ5aUPs0aTUxyK9UmpFRclHZVLEVl0jlWbrbiBs="; }; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ + makeBinaryWrapper + ]; installPhase = '' runHook preInstall @@ -22,16 +27,16 @@ stdenv.mkDerivation rec { cp questdb.jar $out/share/java ln -s $out/share/java/questdb.jar $out/bin - wrapProgram $out/bin/questdb.sh --set JAVA_HOME "${jre}" + wrapProgram $out/bin/questdb.sh --set JAVA_HOME "${jdk17_headless}" runHook postInstall ''; - meta = with lib; { + meta = { description = "high-performance, open-source SQL database for applications in financial services, IoT, machine learning, DevOps and observability"; homepage = "https://questdb.io/"; - license = licenses.asl20; - maintainers = [ maintainers.jacfal ]; - platforms = platforms.linux; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.jacfal ]; + platforms = lib.platforms.linux; }; -} +})