News for hackers. Stuff that matters.
Re:NixOS 22.11 “Raccoon” Released by troad on Thursday December 01, 2022 @08:18AM (#33815825)
I would expect something like Steam gaming on my dual-GPU laptop might be one deep mineshaft of "nope" on NixOS.
Re:NixOS 22.11 “Raccoon” Released by pongo1231 on Thursday December 01, 2022 @08:29AM (#33815952)
If it's an Intel iGPU + an Nvidia dGPU setup beware there's a bug with the implementation of the Nvidia driver currently which breaks connecting external displays on X11 depending on your hardware. See https://github.com/NixOS/nixpkgs/issues/199024 and the comments of https://github.com/NixOS/nixpkgs/pull/165188.

Also setting Coolbits doesn't seem to work either on my end, which means no overclocking support for the Nvidia GPU (if that's something you care about).

Re:NixOS 22.11 “Raccoon” Released by Filligree on Thursday December 01, 2022 @08:19AM (#33815838)
No, that works fine. As well as it ever does.
Re:NixOS 22.11 “Raccoon” Released by troad on Thursday December 01, 2022 @08:21AM (#33815849)
Really? I'm curious to read more.

It works very well for me under Ubuntu these days, but if I can get it working equivalently well on NixOS I may legitimately consider switching.

Re:NixOS 22.11 “Raccoon” Released by Jhsto on Thursday December 01, 2022 @09:21AM (#33816539)
Plugging my own thing here, but I have been experimenting with a Nix configuration for gaming only. My configuration is here (for Nvidia, which does not work without tinkering as AMD does) : https://github.com/jhvst/nix-config/blob/main/nvidia.nix

First, this is a whole system specification. This means that executing this on Nix will build you a whole OS image. You can build the image if you have Nix by running the first line on file. You can also use Docker with the instruction on my README: https://github.com/jhvst/nix-config (however, kexec will not likely work, read more how to run it later)

Back to elaborating on the Nix file from the gaming perspective. First, we have the overlays. These are like patches to the packages, and really useful for gaming because it allows building important packages like mesa from the source tip. This is particularly useful when new games or GPUs are released. Same thing for wayland: Nvidia and its proprietary drivers need some patching, but it's possible to get wayland (and sway) to work this way.

Then, I have taken the reproducibility of Nix to a next step in my opinion, and made the system stateless. This means that it runs from the RAM. It is easy to create installation media like kernel, initrd, and rootfs because you have all the steps to create the distribution. This means that here, Nix works as a meta-distro like Gentoo, on top of which you develop your own. Running from the RAM means that theoretically, if you have a working config, and two people with different hardware runs it, then they should have the same experience. If you look at ProtonDB, you often find that some people claim that game X works on their machine with drivers and mesa of Y and Z, but there is no way to copy their configurations because it's certain that the user has made some stateful changes which they have forgotten hence left undocumented, which is the reason it works for them. If everyone would be using Nix, you could reproduce their system and possibly fix your own, but this is not tractable with most OSs.

If you like to test my changes, you can read more about my approach here: https://github.com/NixOS/nixpkgs/pull/203750

For testing I distribute Nvidia as documented here: https://github.com/jhvst/jhvst.github.io/blob/main/ramdisk.m...

However, I have developed it bit further: if you manage to get into an iPXE shell, you can write `boot -a http://boot.ponkila.com/menu.ipxe`, then select the second option which is Nvidia (proprietary drivers), and with some waiting you will get into a shell prompt to which you can write `sway --unsupported-gpu`, which will launch sway. Cmd+Enter opens a prompt to which you can write `steam`, which will open Steam. Then, you have to mount some drive on another shell with `mount`, and add this as a Steam library via Steam's UI. Then you can play games. I use this on AMD and I have been very happy.

To get iPXE, the easy option is to go along with https://netboot.xyz. You will find the `iPXE shell` option here to which to write the boot option from the previous paragraph.

Re:NixOS 22.11 “Raccoon” Released by tmnvdb on Thursday December 01, 2022 @10:21AM (#33817398)
I use steam on nix and it was a breeze.
Re:NixOS 22.11 “Raccoon” Released by thomastjeffery on Thursday December 01, 2022 @10:20AM (#33817377)
I can't speak to that specific use case, but in a more general sense...

NixOS, just like any other OS, can have you walking down the familiar caverns of, "getting the thing to work that this system isn't designed to accommodate well."

But this time is different: you can start over fresh at any time.

This is really the situation where NixOS shines the most. No more, "wondering what you installed where when you were trying to get that over program working the other day." No more, "did I just do the steps in the wrong order?"

It's unbreakable. Your OS is guaranteed to feel like a fresh install. Forever. Because it can't be anything else.

Re:NixOS 22.11 “Raccoon” Released by pxc on Thursday December 01, 2022 @12:42PM (#33819669)
NixOS actually handles NVIDIA hybrid graphics more easily than most distros. When I got a laptop with NVIDIA/Intel hybrid graphics a few years ago, it took less time to configure on NixOS than it had on openSUSE, which I was dual-booting at the time.

I don't have a laptop like that anymore, but check the NixOS manual and NixOS.wiki, and ask around if you get stuck!

(When I last used it, Bumblebee was the best option and worked well, but these days, native PRIME offloading should also work fine and it's what I would prefer.)

As for Steam, just add

  programs.steam.enable = true;
to your config. Works great!

(If you're accustomed to Flatpak Steam, you can alternatively enable Flatpak and just install Steam that way, like you would on your existing distro.)