-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopenxr.nix
More file actions
74 lines (66 loc) · 2.18 KB
/
openxr.nix
File metadata and controls
74 lines (66 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{ config, lib, pkgs, ... }:
let
inherit (lib.attrsets) getLib;
openvrRuntimeEnv = pkgs.buildEnv {
name = "openvr-runtime";
paths = [
(getLib pkgs.opencomposite)
(getLib pkgs.xrizer)
(lib.attrsets.getStatic pkgs.monado)
];
};
openvrRuntimeEnv32 = pkgs.buildEnv {
name = "openvr-runtime-32bit";
paths = [
(getLib pkgs.pkgsi686Linux.opencomposite)
# (lib.attrsets.getStatic pkgs.pkgsi686Linux.monado)
];
};
# wlx-overlay-s = pkgs.callPackage ({ fetchFromGitHub, rustPlatform }: rustPlatform.buildRustPackage rec {
# pname = "wlx-overlay-s";
# version = "1.2.0";
# src = fetchFromGitHub {
# owner = "galister";
# repo = "wlx-overlay-s";
# rev = "659f1492fb857e723ad5be02cbaa2828516f970f";
# hash = "sha256-HgLItpwVn1MU5/GKECQxJWpZFEMZkAR+BqkWx9/xay4=";
# };
# useFetchCargoVendor = true;
# cargoHash = "sha256-sA/8IEwVD62isx53Q15KBqNVqAT7ozWr/J0Bf63RZxE=";
# cargoDepsName = pname;
# # ...
# }) {};
monadoEnv = {
LH_DEFAULT_BRIGHTNESS = "1.0";
STEAMVR_LH_ENABLE = "1";
XRT_COMPOSITOR_COMPUTE = "1";
XRT_COMPOSITOR_SCALE_PERCENTAGE = "150";
OXR_VIEWPORT_SCALE_PERCENTAGE = "125";
WMR_HANDTRACKING = "0";
XRT_CURATED_GUI = "1";
IPC_EXIT_WHEN_IDLE = "1";
};
in
{
options.lun.openxr.enable = lib.mkEnableOption "Enable openxr compatible VR runtime with monado and opencomposite";
config = lib.mkIf config.lun.openxr.enable {
services.monado = {
enable = true;
defaultRuntime = true; # Register as default OpenXR runtime
highPriority = true;
};
environment.variables = monadoEnv;
systemd.user.services.monado.environment = monadoEnv;
environment.systemPackages = [ pkgs.libsurvive pkgs.xrgears pkgs.wlx-overlay-s ];
systemd.tmpfiles.settings.openvr-runtime = {
"/run/openvr-runtime"."L+".argument = toString openvrRuntimeEnv;
"/run/openvr-runtime-32" =
if pkgs.stdenv.hostPlatform.isi686 then
{ "L+".argument = "openvr-runtime"; }
else if config.hardware.graphics.enable32Bit then
{ "L+".argument = toString openvrRuntimeEnv32; }
else
{ "r" = { }; };
};
};
}