diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2023-12-18 16:55:02 +0100 |
---|---|---|
committer | Sefa Eyeoglu <contact@scrumplex.net> | 2024-02-23 14:25:15 +0100 |
commit | 2d2493b23dc35f552e13f6022b0ec4b2a4cdc7b1 (patch) | |
tree | 31c73c4b470cac2b525b9aec1c62c1a1da939910 /nixos/modules/services/hardware/monado.nix | |
parent | ce36e73fdba7264db7296fcac045e41601683a66 (diff) |
nixos/monado: add option to make Monado the default OpenXR runtime
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'nixos/modules/services/hardware/monado.nix')
-rw-r--r-- | nixos/modules/services/hardware/monado.nix | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/nixos/modules/services/hardware/monado.nix b/nixos/modules/services/hardware/monado.nix index 9933d905584fd..09895bfab2f02 100644 --- a/nixos/modules/services/hardware/monado.nix +++ b/nixos/modules/services/hardware/monado.nix @@ -4,15 +4,28 @@ , ... }: let - inherit (lib) mkDefault mkEnableOption mkIf mkPackageOption; + inherit (lib) mkDefault mkEnableOption mkIf mkOption mkPackageOption types; cfg = config.services.monado; + in { options.services.monado = { enable = mkEnableOption "Monado wrapper and user service"; package = mkPackageOption pkgs "monado" { }; + + defaultRuntime = mkOption { + type = types.bool; + description = '' + Whether to enable Monado as the default OpenXR runtime on the system. + + Note that applications can bypass this option by setting an active + runtime in a writable XDG_CONFIG_DIRS location like `~/.config`. + ''; + default = false; + example = true; + }; }; config = mkIf cfg.enable { @@ -70,6 +83,10 @@ in environment.systemPackages = [ cfg.package ]; environment.pathsToLink = [ "/share/openxr" ]; + + environment.etc."xdg/openxr/1/active_runtime.json" = mkIf cfg.defaultRuntime { + source = "${cfg.package}/share/openxr/1/openxr_monado.json"; + }; }; meta.maintainers = with lib.maintainers; [ Scrumplex ]; |