Get WeiDU, and make it easily available on the PATH variable

Note
This step is done only once, and is useful "forever" (as long you don’t need to reinstall the OS).

Almost all mods available are implemented using a tool called WeiDU. This is a program specifically made for the Infinity Engine, and mods are created using a programming language implemented by WeiDU. So you need to download it as it’s not normally available packaged by distributions.

You need to download WeiDU, extract the package, and make the different programs that come with it (e.g. weinstall) easily available in the PATH (this is optional, but recommended, and this guide assumes you did it).

Personally, I like to have all the custom programs that I download or compile myself in $HOME/local (like /usr/local or /opt, but without requiring root permissions, and only accessible to my user). You do you.

So I download WeiDU from the releases page on Github and I extract it under $HOME/local/weidu. Then I run:

export PATH=~/local/weidu/bin/amd64:$PATH

whenever I need to install mods.

Install ciopfs. It’s available packaged in many linux distributions.

Prepare the game

Important
Note well the cd commands. The instructions won’t work if you run them from the wrong directory.

Move away the standard game directory (it will be copied later).

cd ~/local/GOG/Baldurs Gate Enhanced Edition/
mv game game.original

Create the dir that will contain the actual data, which will contain additional case information in extended attributes ("user.filename")

mkdir ci-data-game/

Recreate the game directory, and mount the empty data directory to it.

mkdir game
ciopfs ci-data-game/ game

Copy the original game files. The case will be stored in the extended attributes.

cp -r game.original/* game

Test that it worked by starting the game in the ciopfs mounted directory.

cd game
./BaldursGate64
Warning
If you want to mod BG1EE with Siege of Dragonspear installed from GOG or Steam, you’ll need to use a tool called modmerge, or alternatively, make sure that the first mod that you install is DLC Merger. Both will do the same so it’s your choice (but the latter is a maintained project, so I recommend it). They will unpack the contents of Siege of Dragonspear and merge them with the rest of Baldur’s Gate EE so modding tools will apply changes to both. That’s it.

Install one mod

Copy mod directory (extracted from a downloaded ZIP file), and install mod.

cp -r /tmp/cdtweaks/ .
# Remember to set the PATH to weinstall, or use a full path to it
export PATH=~/local/weidu/bin/amd64:$PATH
weinstall cdtweaks/

Repeat for all the mods that you want to install.

That’s it!

To recap

# Move away the standard game directory
cd ~/local/GOG/Baldurs Gate Enhanced Edition/
mv game game.original
# Create the dir that will contain the actual data, which will contain additional
# case information in extended attributes ("user.filename")
mkdir ci-data-game/
# Recreate the game directory, and mount the empty data directory to it.
mkdir game
ciopfs ci-data-game/ game
# Copy the original game files. The case will be stored in the extended
# attributes.
cp -r game.original/* game
# Test that it worked by starting the game in the ciopfs mounted directory
cd game
./BaldursGate64
# Use modmerge or dlcmerger to prepare for modding (if SoD)
# Copy mod directory (extracted from a downloaded ZIP file), and install mod.
cp -r /tmp/cdtweaks/ .
export PATH=$PATH:$HOME/local/WeiDU-Linux/bin/amd64
weinstall cdtweaks/

Bonus tip: auto mount the file system when starting the game

The installer from GOG creates a script named start.sh, which gets invoked from the .desktop entry installed in $HOME/.local/share/applications. I just modify the script adding this:

if [ ! -f $CURRENT_DIR/game/chitin.key ] ; then
    ciopfs $CURRENT_DIR/ci-data-game $CURRENT_DIR/game
fi
execute_game "${bin32_name}" "${bin64_name}" "${bin_path32}" "${bin_path64}" "${lib_path32}" "${lib_path64}"

I just add those 3 lines before the execute_game one, and those will just mount the ciopfs file system when I start the game.