diff --git a/pkgs/development/java-modules/liquibase_redshift_extension/default.nix b/pkgs/development/java-modules/liquibase_redshift_extension/default.nix new file mode 100644 index 000000000000..ba15086ae0ab --- /dev/null +++ b/pkgs/development/java-modules/liquibase_redshift_extension/default.nix @@ -0,0 +1,27 @@ +{ lib, stdenv, fetchMavenArtifact }: + +stdenv.mkDerivation rec { + pname = "liquibase-redshift-extension"; + version = "4.8.0"; + + src = fetchMavenArtifact { + artifactId = "liquibase-redshift"; + groupId = "org.liquibase.ext"; + sha256 = "sha256-jZdDKAC4Cvmkih8VH84Z3Q8BzsqGO55Uefr8vOlbDAk="; + inherit version; + }; + + installPhase = '' + runHook preInstall + install -m444 -D $src/share/java/liquibase-redshift-${version}.jar $out/share/java/liquibase-redshift.jar + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://github.com/liquibase/liquibase-redshift/"; + description = "Amazon Redshift extension for Liquibase"; + license = licenses.asl20; + platforms = platforms.unix; + maintainers = with maintainers; [ sir4ur0n ]; + }; +} diff --git a/pkgs/development/java-modules/redshift_jdbc/default.nix b/pkgs/development/java-modules/redshift_jdbc/default.nix new file mode 100644 index 000000000000..ab15b136e14c --- /dev/null +++ b/pkgs/development/java-modules/redshift_jdbc/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchMavenArtifact }: + +stdenv.mkDerivation rec { + pname = "redshift-jdbc"; + version = "2.1.0.3"; + + src = fetchMavenArtifact { + artifactId = "redshift-jdbc42"; + groupId = "com.amazon.redshift"; + sha256 = "sha256-TO/JXh/pZ7tUZGfHqkzgZx18gLnISvnPVyGavzFv6vo="; + inherit version; + }; + + installPhase = '' + runHook preInstall + install -m444 -D $src/share/java/redshift-jdbc42-${version}.jar $out/share/java/redshift-jdbc42.jar + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://github.com/aws/amazon-redshift-jdbc-driver/"; + description = + "JDBC 4.2 driver for Amazon Redshift allowing Java programs to connect to a Redshift database"; + license = licenses.asl20; + platforms = platforms.unix; + maintainers = with maintainers; [ sir4ur0n ]; + }; +} diff --git a/pkgs/development/tools/database/liquibase/default.nix b/pkgs/development/tools/database/liquibase/default.nix index 87a66f9bdab7..0d7130f7def3 100644 --- a/pkgs/development/tools/database/liquibase/default.nix +++ b/pkgs/development/tools/database/liquibase/default.nix @@ -1,11 +1,25 @@ -{ lib, stdenv, fetchurl, jre, makeWrapper -, mysqlSupport ? true, mysql_jdbc -, postgresqlSupport ? true, postgresql_jdbc }: +{ lib +, stdenv +, fetchurl +, jre +, makeWrapper +, mysqlSupport ? true +, mysql_jdbc +, postgresqlSupport ? true +, postgresql_jdbc +, redshiftSupport ? true +, redshift_jdbc +, liquibase_redshift_extension +}: let extraJars = lib.optional mysqlSupport mysql_jdbc - ++ lib.optional postgresqlSupport postgresql_jdbc; + ++ lib.optional postgresqlSupport postgresql_jdbc + ++ lib.optionals redshiftSupport [ + redshift_jdbc + liquibase_redshift_extension + ]; in stdenv.mkDerivation rec { @@ -30,7 +44,8 @@ stdenv.mkDerivation rec { CP="\$CP":"\$jar" done ''; - in '' + in + '' mkdir -p $out mv ./{lib,licenses,liquibase.jar} $out/ @@ -54,7 +69,7 @@ stdenv.mkDerivation rec { liquibase.integration.commandline.Main \''${1+"\$@"} EOF chmod +x $out/bin/liquibase - ''; + ''; meta = with lib; { description = "Version Control for your database"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7b1ad255f11c..09f6b642c4c5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22309,6 +22309,10 @@ with pkgs; postgresqlTestHook = callPackage ../build-support/setup-hooks/postgresql-test-hook { }; + redshift_jdbc = callPackage ../development/java-modules/redshift_jdbc { }; + + liquibase_redshift_extension = callPackage ../development/java-modules/liquibase_redshift_extension { }; + prom2json = callPackage ../servers/monitoring/prometheus/prom2json.nix { }; prometheus = callPackage ../servers/monitoring/prometheus { buildGoModule = buildGo118Module; }; prometheus-alertmanager = callPackage ../servers/monitoring/prometheus/alertmanager.nix { };