mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/monado: add option to make Monado the default OpenXR runtime
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
ce36e73fdb
commit
2d2493b23d
1 changed files with 18 additions and 1 deletions
|
@ -4,15 +4,28 @@
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (lib) mkDefault mkEnableOption mkIf mkPackageOption;
|
inherit (lib) mkDefault mkEnableOption mkIf mkOption mkPackageOption types;
|
||||||
|
|
||||||
cfg = config.services.monado;
|
cfg = config.services.monado;
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.services.monado = {
|
options.services.monado = {
|
||||||
enable = mkEnableOption "Monado wrapper and user service";
|
enable = mkEnableOption "Monado wrapper and user service";
|
||||||
|
|
||||||
package = mkPackageOption pkgs "monado" { };
|
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 {
|
config = mkIf cfg.enable {
|
||||||
|
@ -70,6 +83,10 @@ in
|
||||||
|
|
||||||
environment.systemPackages = [ cfg.package ];
|
environment.systemPackages = [ cfg.package ];
|
||||||
environment.pathsToLink = [ "/share/openxr" ];
|
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 ];
|
meta.maintainers = with lib.maintainers; [ Scrumplex ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue