diff --git a/pkgs/games/ultrastardx/default.nix b/pkgs/games/ultrastardx/default.nix
index 2e9b3cf8d8ca..f3eec52098d0 100644
--- a/pkgs/games/ultrastardx/default.nix
+++ b/pkgs/games/ultrastardx/default.nix
@@ -23,9 +23,10 @@ in stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig autoreconfHook ];
   buildInputs = [ fpc libpng ] ++ sharedLibs;
 
+  # https://github.com/UltraStar-Deluxe/USDX/issues/462
   postPatch = ''
-    # autoconf substitutes strange things otherwise
     substituteInPlace src/config.inc.in \
+      --subst-var-by lua_LIB_NAME liblua.so \
       --subst-var-by libpcre_LIBNAME libpcre.so.1
   '';