So, I’m wanting to add some mods to Daggerfall-Unity. On non-NixOs installations this would be achieved by adding the mod files to a directory inside DFU. On NixOs, this directory is in the nix-store so I can’t just add the files directly to the folder.
What I would like to do is have a folder I can put the mods into, but I can’t quite get my head around how I would achieve this. I want to be able to copy new mods into the folder whenever I feel like.
if your game is installed via the package you need to make an overlay that adds the mods at build time
I would suggest installing games via steam as you dont really need games to update with your system and managing mods is a pain
daggerfall unity can be installed as a mod on top of vanilla daggerfall
Hey thanks @GDBlaster, unfortunately the link you’ve provided is not about installing DFU as a mod for Steam Daggerfall, but rather, it is a way to use the Steam files in a DFU install. You still need to use something like Daggerfall-Unity from NixPkgs to install it.
With that said, to be able to mod DFU multiple directories need to be overlaid on the mods folder, I’m struggling to come up with the best way to do this - can they be fetched from a local folder?
you do not need to install the game via nix you can have it installed normally
nix gives 0 advantage over a static install in this case and it makes modding incredibly annoying
there is 0 point to having the game in your nix store
using an overlay will make adding and removing mods require a full game rebuild from source without cache as the input will be different from the nix cache one
for making a single folder with all your mods for the overlay I think you can just take "modfolder/*"
as the input for your overlay
once again overlays are to use sparingly as they will make your build time skyrocket
EDIT: Not sure this works and currently on a metered connection so I would rather not download the game to test but this should be about right
self: super: {
daggerfall-unity-with-mods = super.daggerfall-unity.overrideAttrs (oldAttrs: {
postInstall = (oldAttrs.postInstall or "") + ''
cp -r ${./daggerfall-mods}/* $out/bin/daggerfall-unity/mods/
'';
});
}
you would just put all your mods in a daggerfall-mods folder next to your flake like its the mod folder and they would be put into the mod folder on a rebuild
also feel free to change the output location as its a guess and I have no idea if the mod folder is actually there (just check where it is in your store)
I did try installing it directly but because it uses dynamic libraries I get the following error
Could not start dynamically linked executable: ./DaggerfallUnity.x86_64
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld
oh you just need to enable the programs.nix-ld
module
cant do that out of the box just means you need this program so it works
Ah, I see, I assumed that the options listed in the link were in order of preference. So, since I could see DFU in NixPkgs I assumed that was the preferred option.
I’ve enabled programs.nix-ld and I no longer get the error, but the program freezes before doing much. I assume I need to also add the libraries to my nix conf? If that’s the case, how do I know which libraries need to go in there?
you can use ldd to get a list of the libraries needed by a program and add them in nix-ld.libraries
I don’t see any missing libraries when I check the executable
linux-vdso.so.1 (0x00007f62af4ec000)
UnityPlayer.so => /home/waide/Downloads/dfu_linux_64bit-v1.1.1/./UnityPlayer.so (0x00007f62ad200000)
libm.so.6 => /nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/libm.so.6 (0x00007f62af3fd000)
libgcc_s.so.1 => /nix/store/za53jjhjl1xajv3y1zpjvr9mh4w0c1ay-xgcc-14.2.1.20250322-libgcc/lib/libgcc_s.so.1 (0x00007f62af3cf000)
libpthread.so.0 => /nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/libpthread.so.0 (0x00007f62af3ca000)
libc.so.6 => /nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/libc.so.6 (0x00007f62ace00000)
libdl.so.2 => /nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/libdl.so.2 (0x00007f62af3c3000)
librt.so.1 => /nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/librt.so.1 (0x00007f62af3be000)
/lib64/ld-linux-x86-64.so.2 => /nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib64/ld-linux-x86-64.so.2 (0x00007f62af4ee000)
When I run Daggerfall I get the following:
Mono path[0] = '/home/waide/Downloads/dfu_linux_64bit-v1.1.1/DaggerfallUnity_Data/Managed'
Mono config path = '/home/waide/Downloads/dfu_linux_64bit-v1.1.1/DaggerfallUnity_Data/MonoBleedingEdge/etc'
Preloaded 'lib_burst_generated.so'
Desktop is 0 x 0 @ 0 Hz
it just freezes there. I have to kill -9 it to get it to close.
yep doesnt seem like you are missing anything but this is weird why does it say Desktop is 0x0 at 0 Hz since you are trying to play a game im assuming you have a monitor and that it has more than 0 pixels
no idea how to fix that