SMAPI does not work on nixos

I am trying to run SMAPI, which is a modding tool for stardew valley. Whenever I run it, keep giving me the error install on line 4: internal/linux/SMAPI.Installer: cannot execute: required file not found.
For instance, running this in the ubuntu vm works fine.

Edit: with ldd I found the issue. but have no idea how to solve it (0x00007ffe38716000) => /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/ (0x00007efe12899000) => /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/ (0x00007efe12894000) => not found => /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/ (0x00007efe12520000) => /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/ (0x00007efe1287a000) => /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/ (0x00007efe12200000)
	/lib64/ => /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib64/ (0x00007efe128a0000)

Running generic linux executables generally does not work on nixos. This is because the ELF interpreter ( is not in the standard location in /lib (there isn’t even a /lib on nixos!), because script interpreters aren’t found at their usual locations aside from /bin/sh and /usr/bin/env, and because there is no global library path on nixos at all.

The possible solutions include, in rough order of preference:

  • Package whatever program it is from source, if possible
  • Package whatever program it is with autoPatchelfHook
  • Package whatever program it is with buildFHSUserEnv
  • Run it with steam-run
  • Run it with nix-ld and/or envfs

My kids and I have logged too many hours on Stardew Valley. Recently we decided it was time to download some mods. I downloaded SMAPI, extracted it, then just used steam-run to execute the installer and everything worked flawlessly.

Thank you for the solution, I’ll try it once I get back.

Also, is gamescope (the compositor from steamos) installed automatically with steam or do I need to install it separately?

Would you mind providing the command you used to do this? I am having the same issue, but I can’t figure out steam-run to be able to do it.

Took a look at my ~/.bash_history and this is what I see:

cd SMAPI\ 3.18.2\ installer/
./install\ on\

You should be able to run that command from anywhere that you have downloaded the SMAPI installer to.

Let me know if it works or not.

steam-run should be in your path if you have enabled the steam module in your configuration.nix

  programs.steam = {
    enable = true;
    remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
    dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server

then just run steam-run ./install\ on\