From 62145b62ef946b8468f82d66b4ca00c37d76bf7b Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sun, 6 Aug 2023 19:38:19 +0200 Subject: [PATCH] confluent-platform: use `finalAttrs` pattern --- pkgs/servers/confluent-platform/default.nix | 43 ++++++++++++++------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/pkgs/servers/confluent-platform/default.nix b/pkgs/servers/confluent-platform/default.nix index c7703f5c0d0..3f77c88b19c 100644 --- a/pkgs/servers/confluent-platform/default.nix +++ b/pkgs/servers/confluent-platform/default.nix @@ -1,19 +1,34 @@ -{ stdenv, lib, fetchurl, fetchFromGitHub -, jre, makeWrapper, bash, gnused }: +{ + bash +, fetchurl +, gnused +, jre +, lib +, makeBinaryWrapper +, stdenv +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "confluent-platform"; version = "7.4.1"; src = fetchurl { - url = "https://packages.confluent.io/archive/${lib.versions.majorMinor version}/confluent-${version}.tar.gz"; - sha256 = "sha256-dJwG+QRplXX7etxG/e1kzcRMJppF6TYofio8FO1p+aI="; + url = "https://packages.confluent.io/archive/${lib.versions.majorMinor finalAttrs.version}/confluent-${finalAttrs.version}.tar.gz"; + hash = "sha256-dJwG+QRplXX7etxG/e1kzcRMJppF6TYofio8FO1p+aI="; }; - nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ jre bash ]; + nativeBuildInputs = [ + makeBinaryWrapper + ]; + + buildInputs = [ + bash + jre + ]; installPhase = '' + runHook preInstall + mkdir -p $out cp -R bin etc share src $out rm -rf $out/bin/windows @@ -33,13 +48,15 @@ stdenv.mkDerivation rec { --set KAFKA_LOG_DIR "/tmp/apache-kafka-logs" \ --prefix PATH : "${jre}/bin:${bash}/bin:${gnused}/bin" done + + runHook postInstall ''; - meta = with lib; { - homepage = "https://www.confluent.io/"; + meta = { description = "Confluent event streaming platform based on Apache Kafka"; - license = licenses.asl20; - maintainers = with maintainers; [ zoedsoupe ]; - platforms = platforms.unix; + homepage = "https://www.confluent.io/"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ zoedsoupe ]; + platforms = lib.platforms.unix; }; -} +})