Issues with wine library dependency

I am currently trying to play OW2 on NixOS via Lutris. There is an issue that requires people use the Caffe runner to play. Caffe for some reason requires libunwind, which I installed in my configuration. However, when I try to run the game, the logs say wine: could not load []( cannot open shared object file: No such file or directory. I can see the file at /run/current-system/sw/lib/

Am I missing something about how NixOS handles libraries? I’m not sure how to make the library visible to lutris/caffe. I’m still fairly new to NixOS, and I’m still learning how Nix works with dependencies and libraries, so apologies if I’m missing something obvious.

I found a solution to this. To include libraries with Lutris you need to use an overlay and set extraLibraries. I set it like this:

  nixpkgs.overlays = [
    (self: super:
      { lutris = super.lutris.override { extraLibraries = pkgs: [pkgs.libunwind ]; }; })

I still don’t understand why it works like this, and I would appreciate it if anybody could explain it.

You may only need to use override.

systemPackages = {
    (lutris.override { extraLibraries = pkgs: [pkgs.libunwind ]; })

You would need an overlay if you need to redefine the lutris package so that another package which depends on it uses your definition instead of the default provided by Nixpkgs. If all you need is to redefine lutris so that you can use it, meaning another package doesn’t depend on it, then an override should suffice.

Ah, thank you, that looks much more concise. I appreciate the explanation, I wasn’t really sure of the differences between an override and an overlay.