Thanks to TimP4w for writing this.
This guide is unmaintained, because it's significantly different than the other ones and Nizo doesn't understand NixOs-specific stuff. If you want to help, go ahaed and create pull-requests, or issues with instructions on what to change.
- NixOS Configuration 🡰 You are here
- Choose your method
- Method 1 - Manual
- Method 2 - script
- Set up JACK
- Starting the game
- Known Issues
- Troubleshooting
NixOS 24.05.20240524.d12251e (Uakari) [64-bit]
Wineasio: wineasio-1.2.0
Pipewire Jack: pipewire-1.0.6-jack
RS_ASIO: 0.7.1
Proton: Proton - Experimental, Proton 9.0 (Beta) and Proton 8.0
- You have steam (
programs.steam.enable = true;
) installed- This is very important, because we need steam that comes with its own
FHS
environment ANDsteam-run
to be able to execute commands in this environment.
- This is very important, because we need steam that comes with its own
- You use the pipewire service from nixpkgs (
services.pipewire.enable = true;
)
After applying the configuration, reboot your PC.
### Audio
sound.enable = true;
services.pipewire = {
enable = true;
jack.enable = true;
};
### Audio Extra
security.rtkit.enable = true; # Enables rtkit (https://directory.fsf.org/wiki/RealtimeKit)
#
# domain = "@audio": This specifies that the limits apply to users in the @audio group.
# item = "memlock": Controls the amount of memory that can be locked into RAM.
# value (`unlimited`) allows members of the @audio group to lock as much memory as needed. This is crucial for audio processing to avoid swapping and ensure low latency.
#
# item = "rtprio": Controls the real-time priority that can be assigned to processes.
# value (`99`) is the highest real-time priority level. This setting allows audio applications to run with real-time scheduling, reducing latency and ensuring smoother performance.
#
security.pam.loginLimits = [
{ domain = "@audio"; item = "memlock"; type = "-"; value = "unlimited"; }
{ domain = "@audio"; item = "rtprio"; type = "-"; value = "99"; }
];
# Add user to `audio` and `rtkit` groups.
users.users.<username>.extraGroups = [ "audio" "rtkit" ];
environment.systemPackages = with pkgs; [
qjackctl
rtaudio
];
### Steam (https://nixos.wiki/wiki/Steam)
programs.steam = {
enable = true;
package = pkgs.steam.override {
extraLibraries = pkgs: [ pkgs.pkgsi686Linux.pipewire.jack ]; # Adds pipewire jack (32-bit)
extraPkgs = pkgs: [ pkgs.wineasio ]; # Adds wineasio
};
};
We of course want mainly two things: audio and Steam. These are pretty much self-explanatory, but there are some more settings that we need:
We use pipewire (services.pipewire
) and pipewire-jack. The goal is to connect jack to wine via wineasio.
I noticed that for audio we need some extra things:
- rtkit: without this the game just crashes
- PAM loginLimits: we also need to set some limits here for the audio group to access real-time scheduling with a higher priority.
- user groups: we add our user to the
audio
andrtkit
groups to enable these limits for us qjackctl
to control our audio pipeline (there are also other alternatives here, such ashelvum
orqpwgraph
)
Here we only want to add two things:
- wineasio, to connect JACK with wine
- The 32-bit libraries of pipewire JACK since Rocksmith is a 32-bit game.
NixOS is not using the FHS convention however the official steam program is packaged with its own FHS environment. So what we are doing is to add an extra library (pkgsi686Linux.pipewire.jack
) to the default environment that comes from nixpkgs. For wineasio
we only need some .dll
and .so
files that we usually need to compile. However if we install it via nixpkgs, this is done automatically and we can later copy the generated files (see below).
You must apply the configuration and rebuild your system BEFORE continuing.
Everything is done by hand.
A script that does almost everything automatically is provided in this repo.