@hallettj@beehaw.org avatar

hallettj

@hallettj@beehaw.org

Programmer in NYC

This profile is from a federated server and may be incomplete. Browse more on the original instance.

hallettj,
@hallettj@beehaw.org avatar

I’ve been evaluating NixOS to make sure I can run games on it. I’ve only tried a machine with Intel graphics so far, but I see that AMD and Nvidia drivers are packaged. It seems convenient now that I’ve figured out the setup.

Vulkan is set up out of the box.

It’s necessary to enable 32-bit DRI support by adding this line to /etc/nix/configuration.nix:


<span style="color:#323232;">hardware.opengl.driSupport32Bit = true;
</span>

To use Lutris install the package and use its UI to install runners. I didn’t have to configure any extra libraries to get Battle.net running. You can configure the “system wine” that Lutris sees, and extra libraries your games might need like this:


<span style="color:#323232;">home.packages = with pkgs; [
</span><span style="color:#323232;">  (lutris.override {
</span><span style="color:#323232;">    extraLibraries =  pkgs: [
</span><span style="color:#323232;">      # List library dependencies here
</span><span style="color:#323232;">    ];
</span><span style="color:#323232;">    extraPkgs = pkgs: [
</span><span style="color:#323232;">      wine-staging
</span><span style="color:#323232;">    ];
</span><span style="color:#323232;">  })
</span><span style="color:#323232;">];
</span>

Those lines go in a Home Manager config file, like ~/.config/home-manager/home.nix. That installs Lutris, and any listed dependencies at the same time.

NixOS does not put dependencies in the file paths where programs usually look for them. That traditional directory structure is called the Filesystem Hierarchy Standard, or FHS. But Nix packages can create a virtual FHS where needed, and that is what the Lutris package does. That lets software that isn’t built for Nix work, like Lutris’ Wine runners. That means that for games to access libraries those libraries must be listed in that extraLibraries option so that they are included in the FHS.

32-bit libraries are in pkgs.pkgsi686Linux.* if you need them.

I haven’t tried Steam yet, but I think it has an option similar to the extraLibraries one for Lutris.

A nice feature of NixOS is that if you add a bunch of libraries to your config trying to get a game to work, those libraries are automatically unlinked when you remove them from your config so your system stays nice and tidy.

hallettj,
@hallettj@beehaw.org avatar

Oh good tip, thanks!

hallettj,
@hallettj@beehaw.org avatar

It depends on what your games need. I haven’t added any libraries yet, but I haven’t tested many games yet either. If something isn’t working you might be able to determine a missing library from the log output. In Lutris the Play button has an arrow on it that you can click on to find the “Show log output” button.

hallettj,
@hallettj@beehaw.org avatar

Good to know, thanks! Do you find steam-run to be helpful even for non-steam binaries that need an FHS? Or do you use it mainly for games?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • meta
  • Macbeth
  • All magazines