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
:
hardware.opengl.driSupport32Bit = true;
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:
home.packages = with pkgs; [
(lutris.override {
extraLibraries = pkgs: [
# List library dependencies here
];
extraPkgs = pkgs: [
wine-staging
];
})
];
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.