From ed1a4501f7427cc60597d2741d6e440cbfc998f1 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Sat, 19 Jul 2025 22:24:45 +0200 Subject: [PATCH] monado: Some changes --- modules/home/configs/monado.nix | 11 +++++++++++ modules/system/services/monado.nix | 16 +++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/modules/home/configs/monado.nix b/modules/home/configs/monado.nix index 7608757..f26b2b0 100644 --- a/modules/home/configs/monado.nix +++ b/modules/home/configs/monado.nix @@ -18,5 +18,16 @@ in sha256 = "x/X4HyyHdQUxn3CdMbWj5cfLvV7UyQe1D01H93UCk+M="; fetchLFS = true; }; + + xdg.configFile."openxr/1/active_runtime.json".source = "${pkgs.monado}/share/openxr/1/openxr_monado.json"; + + xdg.configFile."openvr/openvrpaths.vrpath".text = builtins.toJSON { + config = [ "${config.xdg.dataHome}/Steam/config" ]; + external_drivers = null; + jsonid = "vrpathreg"; + log = [ "${config.xdg.dataHome}/Steam/logs" ]; + runtime = [ "${pkgs.opencomposite}/lib/opencomposite" ]; + version = 1; + }; }; } \ No newline at end of file diff --git a/modules/system/services/monado.nix b/modules/system/services/monado.nix index 045a523..248a961 100644 --- a/modules/system/services/monado.nix +++ b/modules/system/services/monado.nix @@ -20,6 +20,14 @@ in config = mkIf cfg.enable { # https://wiki.nixos.org/wiki/VR # https://github.com/NixOS/nixpkgs/issues/258196 + # + # Monado can be run with the following commands: + # systemctl --user start monado.service + # systemctl --user stop monado.{service,socket} + # journalctl --user --follow --unit monado.service + # Games require LAUNCH OPTIONS: "env PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/monado_comp_ipc %command%" + # + # Requires also `configs.monado.enable = true;` in home.nix for the user to work well services.monado = { enable = true; defaultRuntime = true; @@ -29,12 +37,10 @@ in systemd.user.services.monado.environment = { STEAMVR_LH_ENABLE = "1"; XRT_COMPOSITOR_COMPUTE = "1"; - }; - - environment.variables = { - STEAMVR_LH_ENABLE = "1"; - XRT_COMPOSITOR_COMPUTE = "1"; WMR_HANDTRACKING = "0"; + + # Enable debugging if needed + XRT_DEBUG_GUI = "0"; }; boot.kernelPatches = mkIf cfg.enableAmdgpuPatch [