-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
255 changed files
with
6,278 additions
and
2,599 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7606,6 +7606,12 @@ | |
githubId = 287769; | ||
name = "Sergii Paryzhskyi"; | ||
}; | ||
heijligen = { | ||
email = "[email protected]"; | ||
github = "heijligen"; | ||
githubId = 19170376; | ||
name = "Thomas Heijligen"; | ||
}; | ||
heisfer = { | ||
email = "[email protected]"; | ||
github = "heisfer"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
{ config | ||
, lib | ||
, pkgs | ||
, ... | ||
}: | ||
let | ||
inherit (lib) mkDefault mkEnableOption mkIf mkOption mkPackageOption types; | ||
|
||
cfg = config.services.monado; | ||
|
||
in | ||
{ | ||
options.services.monado = { | ||
enable = mkEnableOption "Monado 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; | ||
}; | ||
|
||
highPriority = mkEnableOption "high priority capability for monado-service" | ||
// mkOption { default = true; }; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
security.wrappers."monado-service" = mkIf cfg.highPriority { | ||
setuid = false; | ||
owner = "root"; | ||
group = "root"; | ||
# cap_sys_nice needed for asynchronous reprojection | ||
capabilities = "cap_sys_nice+eip"; | ||
source = lib.getExe' cfg.package "monado-service"; | ||
}; | ||
|
||
services.udev.packages = with pkgs; [ xr-hardware ]; | ||
|
||
systemd.user = { | ||
services.monado = { | ||
description = "Monado XR runtime service module"; | ||
requires = [ "monado.socket" ]; | ||
conflicts = [ "monado-dev.service" ]; | ||
|
||
unitConfig.ConditionUser = "!root"; | ||
|
||
environment = { | ||
# Default options | ||
# https://gitlab.freedesktop.org/monado/monado/-/blob/4548e1738591d0904f8db4df8ede652ece889a76/src/xrt/targets/service/monado.in.service#L12 | ||
XRT_COMPOSITOR_LOG = mkDefault "debug"; | ||
XRT_PRINT_OPTIONS = mkDefault "on"; | ||
IPC_EXIT_ON_DISCONNECT = mkDefault "off"; | ||
}; | ||
|
||
serviceConfig = { | ||
ExecStart = | ||
if cfg.highPriority | ||
then "${config.security.wrapperDir}/monado-service" | ||
else lib.getExe' cfg.package "monado-service"; | ||
Restart = "no"; | ||
}; | ||
|
||
restartTriggers = [ cfg.package ]; | ||
}; | ||
|
||
sockets.monado = { | ||
description = "Monado XR service module connection socket"; | ||
conflicts = [ "monado-dev.service" ]; | ||
|
||
unitConfig.ConditionUser = "!root"; | ||
|
||
socketConfig = { | ||
ListenStream = "%t/monado_comp_ipc"; | ||
RemoveOnStop = true; | ||
|
||
# If Monado crashes while starting up, we want to close incoming OpenXR connections | ||
FlushPending = true; | ||
}; | ||
|
||
restartTriggers = [ cfg.package ]; | ||
|
||
wantedBy = [ "sockets.target" ]; | ||
}; | ||
}; | ||
|
||
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 ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.