mirror of
https://gitlab.com/lvra/lvra.gitlab.io.git
synced 2025-04-28 10:18:29 +02:00
Update NixOS documentation with setup recommendations, as well as instructions on how to undo the damage that Envision can do to a NixOS VR system.
This commit is contained in:
parent
c1907a137e
commit
d0d653b514
1 changed files with 74 additions and 5 deletions
|
@ -6,6 +6,59 @@ title: NixOS
|
||||||
|
|
||||||
General documentation about VR is provided on the [NixOS Wiki](https://wiki.nixos.org/wiki/VR).
|
General documentation about VR is provided on the [NixOS Wiki](https://wiki.nixos.org/wiki/VR).
|
||||||
|
|
||||||
|
## Recommendations
|
||||||
|
The recommended way to set up NixOS for VR is by using [services.monado](https://search.nixos.org/options?channel=unstable&query=services.monado) or [services.wivrn](https://search.nixos.org/options?channel=unstable&query=services.wivrn).
|
||||||
|
|
||||||
|
You may also want to install [opencomposite](https://search.nixos.org/packages?channel=unstable&query=opencomposite) (or xrizer, currently only available in [nixpkgs-xr](https://github.com/nix-community/nixpkgs-xr)) and [wlx-overlay-s](https://search.nixos.org/packages?channel=unstable&query=wlx-overlay-s).
|
||||||
|
|
||||||
|
For OpenComposite or XRizer, you may want to configure `~/.config/openvr/openvrpaths.vrpath` to point to your OpenComposite or XRizer installation. See below for an example using [home-manager](https://github.com/nix-community/home-manager).
|
||||||
|
|
||||||
|
```nix
|
||||||
|
xdg.configFile."openvr/openvrpaths.vrpath".text = ''
|
||||||
|
{
|
||||||
|
"config" :
|
||||||
|
[
|
||||||
|
"~/.local/share/Steam/config"
|
||||||
|
],
|
||||||
|
"external_drivers" : null,
|
||||||
|
"jsonid" : "vrpathreg",
|
||||||
|
"log" :
|
||||||
|
[
|
||||||
|
"~/.local/share/Steam/logs"
|
||||||
|
],
|
||||||
|
"runtime" :
|
||||||
|
[
|
||||||
|
"${pkgs.opencomposite}/lib/opencomposite"
|
||||||
|
],
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
```
|
||||||
|
|
||||||
|
If you need to run the latest possible version of any of these pieces of software for whatever reason, above what is packaged in NixOS, you may want to check out Community Overlays at the bottom of this article.
|
||||||
|
|
||||||
|
If you need to run a branch of Monado or WiVRn, you can use `.overrideAttrs`, see below for an example of doing this for Coreforge's Monado Pimax fork.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
monado = {
|
||||||
|
enable = true;
|
||||||
|
defaultRuntime = true;
|
||||||
|
highPriority = true;
|
||||||
|
|
||||||
|
package = (pkgs.monado.overrideAttrs {
|
||||||
|
pname = "monado-pimax"; # optional but helps distinguishing between packages
|
||||||
|
|
||||||
|
src = pkgs.fetchFromGitLab {
|
||||||
|
domain = "gitlab.freedesktop.org";
|
||||||
|
owner = "Coreforge";
|
||||||
|
repo = "monado";
|
||||||
|
rev = "f858ee5dd8ca7696bd9219e8278f2671df56fe6e";
|
||||||
|
hash = "sha256-Si56yvG+oSfyUaPAlF1FgB7WJo8td1xuVxYnkJvbu4o=";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
## Monado
|
## Monado
|
||||||
Monado is supported natively on NixOS using the [services.monado](https://search.nixos.org/options?channel=unstable&query=services.monado) since 24.05.
|
Monado is supported natively on NixOS using the [services.monado](https://search.nixos.org/options?channel=unstable&query=services.monado) since 24.05.
|
||||||
|
|
||||||
|
@ -24,19 +77,35 @@ As WiVRn is built around Monado, most, if not all, settings for Monado are also
|
||||||
|
|
||||||
You can find WiVRn on the official [NixOS wiki](https://wiki.nixos.org/wiki/VR#WiVRn).
|
You can find WiVRn on the official [NixOS wiki](https://wiki.nixos.org/wiki/VR#WiVRn).
|
||||||
|
|
||||||
### VRChat
|
### Steam Games
|
||||||
To get VRChat working with monado on nix, use the `env PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/monado_comp_ipc %command%` launch options on steam and click play with the "Launch VRChat in Steam VR" mode. It should open it on your desktop for preview and display it through monado.
|
To get Steam games working with monado on NixOS, use the `env PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/monado_comp_ipc %command%` launch options on steam and, if prompted, choose the SteamVR launch option.
|
||||||
|
|
||||||
|
## OpenXR apps
|
||||||
|
All OpenXR apps should work out of the box, assuming you have a default runtime set.
|
||||||
|
|
||||||
|
To set a default OpenXR runtime, you can either use `services.monado.defaultRuntime` (the same option is present for WiVRn) or create/modify `~/.config/openxr/1/active_runtime.json`.
|
||||||
|
|
||||||
## SteamVR
|
## SteamVR
|
||||||
SteamVR works like it does on other distros for the most part. Unfortunately, if it doesn't work out of the box, troubleshooting it on NixOS can be close to impossible due to NixOS's structure and SteamVR's proprietary nature.
|
SteamVR works like it does on other distros for the most part. Unfortunately, if it doesn't work out of the box, troubleshooting it on NixOS can be close to impossible due to NixOS's structure and SteamVR's proprietary nature.
|
||||||
|
|
||||||
[Asynchronous reprojection does not work](https://github.com/NixOS/nixpkgs/issues/217119) without a kernel patch.
|
[Asynchronous reprojection does not work](https://github.com/NixOS/nixpkgs/issues/217119) without a [kernel patch](https://github.com/Frogging-Family/community-patches/blob/a6a468420c0df18d51342ac6864ecd3f99f7011e/linux61-tkg/cap_sys_nice_begone.mypatch). However, this patch is only applicable for AMD GPUs. There is no way to get SteamVR asynchronous reprojection working on Nvidia.
|
||||||
|
|
||||||
[setcap doesn't work](https://github.com/NixOS/nixpkgs/issues/42117#issuecomment-996731579) but can be done manually.
|
[setcap doesn't work](https://github.com/NixOS/nixpkgs/issues/42117#issuecomment-996731579) but can be done manually.
|
||||||
|
|
||||||
## Envision
|
## Envision
|
||||||
[Envision](../../fossvr/envision/) has been packaged in [nixos unstable](https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=+envision) but is still in early development and is not recommended. It may also mess with your `monado.service` setup in unexpected ways.
|
[Envision](../../fossvr/envision/) has been packaged in [nixos 24.11](https://github.com/NixOS/nixpkgs/blob/nixos-24.11/pkgs/by-name/en/envision/package.nix) but is still in early development and is not recommended. It may also mess with your `monado.service` setup in unexpected ways.
|
||||||
|
|
||||||
|
Notably, if you try to use Envision on NixOS, by default, binaries will be dynamically linked, not statically linked, which will cause many issues with VR apps. Also, if you try to use Envision with a dedicated PCVR headset (ie, Monado with an Index, Pimax, etc), asynchronous reprojection will not work without an AMD-only kernel patch, for the same reason as SteamVR.
|
||||||
|
|
||||||
|
### Removing Envision
|
||||||
|
In case you did not follow the above advice, and attempted to use Envision on NixOS, you may want to undo the changes it has made to your home folder, so `services.monado`, `services.wivrn`, `opencomposite` and/or `xrizer` may work correctly.
|
||||||
|
|
||||||
|
You will want to delete or modify `~/.config/openxr/1/active_runtime.json`. Note that this is an override for `/etc/xdg/openxr/1/active_runtime.json`, so if you are using `services.monado.defaultRuntime = true` (or the WiVRn equivalent) then you can safely delete this file. Otherwise, you'll want to point it to your Monado installation, which will be somewhere in `/nix/store`.
|
||||||
|
|
||||||
|
You will also want to modify `~/.config/openvr/openvrpaths.vrpath`. Remove any runtimes that point to Envision's compiled binaries.
|
||||||
|
|
||||||
|
I recommend using [home-manager](https://github.com/nix-community/home-manager) to automate writing these config files, as these paths will change regularly, due to the nature of NixOS.
|
||||||
|
|
||||||
## Community Overlays
|
## Community Overlays
|
||||||
[Nixpkgs-xr](https://github.com/nix-community/nixpkgs-xr) provides overlays for the exisiting nixpkgs. If the mainline packages are broken for you (whether it be compiling or in function) for any reason, adding this, as described in the readme, might help.
|
[Nixpkgs-xr](https://github.com/nix-community/nixpkgs-xr) provides overlays for the exisiting nixpkgs. If the mainline packages are broken for you (whether it be compiling or in function) for any reason, adding this, as described in the readme, might help. It also provides XR-related packages considerably before they are available in NixOS.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue