cosmic-greeter: add missing cosmic-randr and orca dependency

The path to the orca screen reader was hardcoded to /usr/bin/orca, which prevents it from being executed in a NixOS environment.

This change adds orca as a dependency and patches the source code to use the Nix-provided executable path, allowing the greeter to launch it correctly.

Also adds cosmic-randr to PATH.
This commit is contained in:
Heitor Augusto
2025-10-05 10:02:25 -03:00
committed by John Titor
parent 107f8b572e
commit 7462f05a96

View File

@@ -14,6 +14,7 @@
xkeyboard_config,
nix-update-script,
nixosTests,
orca,
}:
rustPlatform.buildRustPackage (finalAttrs: {
@@ -47,6 +48,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
libinput
linux-pam
udev
orca
];
dontUseJustBuild = true;
@@ -63,10 +65,12 @@ rustPlatform.buildRustPackage (finalAttrs: {
postPatch = ''
substituteInPlace src/greeter.rs --replace-fail '/usr/bin/env' '${lib.getExe' coreutils "env"}'
substituteInPlace src/greeter.rs --replace-fail '/usr/bin/orca' '${lib.getExe orca}'
'';
preFixup = ''
libcosmicAppWrapperArgs+=(
--prefix PATH : ${lib.makeBinPath [ cosmic-randr ]}
--set-default X11_BASE_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/base.xml
--set-default X11_BASE_EXTRA_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/extra.xml
)