From 100a0fa0af68b1146bda1c94e7ff0c9ef577488b Mon Sep 17 00:00:00 2001 From: Guillaume Desforges Date: Thu, 31 Oct 2024 13:49:45 +0100 Subject: [PATCH] dbeaver: allow custom java -Xmx value DBeaver has its Java heap size setting written in dbeaver.ini, which is copied on install to $out/opt/dbeaver. This means that, to increase the java heap size, it needs to happen in Nix build. This change proposes to allow passing this setting to the function so that one can override it. --- pkgs/by-name/db/dbeaver-bin/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/db/dbeaver-bin/package.nix b/pkgs/by-name/db/dbeaver-bin/package.nix index 8e62a026ba00..ece1216d445c 100644 --- a/pkgs/by-name/db/dbeaver-bin/package.nix +++ b/pkgs/by-name/db/dbeaver-bin/package.nix @@ -12,6 +12,7 @@ glib, webkitgtk_4_0, glib-networking, + override_xmx ? "1024m", }: stdenvNoCC.mkDerivation (finalAttrs: { @@ -54,6 +55,11 @@ stdenvNoCC.mkDerivation (finalAttrs: { dontConfigure = true; dontBuild = true; + prePatch = '' + substituteInPlace dbeaver.ini \ + --replace-fail '-Xmx1024m' '-Xmx${override_xmx}' + ''; + installPhase = if !stdenvNoCC.hostPlatform.isDarwin then ''