From d22ec36762c59a1f45dbcbb00d3f8ae30e641058 Mon Sep 17 00:00:00 2001 From: Pratham Patel Date: Tue, 17 Jun 2025 20:23:06 +0530 Subject: [PATCH 1/3] cosmic-session: add orca (screen reader) support The environment variable `ORCA` is used to specify the path to the executable binary of orca. If left empty, it defaults to `/usr/bin/orca` which is not available on NixOS. Setting it to "orca" means that the executable will be picked up from $PATH. We can hardcode the path for `ORCA` like we do with `XDP_COSMIC` but that would introduce an _unnecessary_ dependency, which we would like to avoid. The support for orca in the COSMIC session on NixOS will be handled by the NixOS module. Everyone else (non-NixOS-module users) should have support for orca as long as the executable can be found in their system's $PATH. --- pkgs/by-name/co/cosmic-session/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/co/cosmic-session/package.nix b/pkgs/by-name/co/cosmic-session/package.nix index 0f605f183615..13116e329ed9 100644 --- a/pkgs/by-name/co/cosmic-session/package.nix +++ b/pkgs/by-name/co/cosmic-session/package.nix @@ -50,7 +50,10 @@ rustPlatform.buildRustPackage (finalAttrs: { "target/${stdenv.hostPlatform.rust.cargoShortTarget}" ]; - env.XDP_COSMIC = "${xdg-desktop-portal-cosmic}/libexec/xdg-desktop-portal-cosmic"; + env = { + XDP_COSMIC = lib.getExe xdg-desktop-portal-cosmic; + ORCA = "orca"; # get orca from $PATH + }; passthru = { providedSessions = [ "cosmic" ]; From 83a5712b72c20e5b72b0aa05e5334051aae6687a Mon Sep 17 00:00:00 2001 From: Pratham Patel Date: Tue, 17 Jun 2025 20:28:32 +0530 Subject: [PATCH 2/3] nixos/cosmic: add helper function to check for excluded package --- nixos/modules/services/desktop-managers/cosmic.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/desktop-managers/cosmic.nix b/nixos/modules/services/desktop-managers/cosmic.nix index 58e4a10177be..99aa66bbf98c 100644 --- a/nixos/modules/services/desktop-managers/cosmic.nix +++ b/nixos/modules/services/desktop-managers/cosmic.nix @@ -13,6 +13,7 @@ let cfg = config.services.desktopManager.cosmic; + notExcluded = pkg: utils.disablePackageByName pkg config.environment.cosmic.excludePackages; excludedCorePkgs = lib.lists.intersectLists corePkgs config.environment.cosmic.excludePackages; # **ONLY ADD PACKAGES WITHOUT WHICH COSMIC CRASHES, NOTHING ELSE** corePkgs = From 4b3f38fb7708baf252e36ffec39d283ecd260be1 Mon Sep 17 00:00:00 2001 From: Pratham Patel Date: Thu, 19 Jun 2025 12:11:26 +0530 Subject: [PATCH 3/3] nixos/cosmic: add orca (screen reader) support --- nixos/modules/services/desktop-managers/cosmic.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/desktop-managers/cosmic.nix b/nixos/modules/services/desktop-managers/cosmic.nix index 99aa66bbf98c..52cb480a7248 100644 --- a/nixos/modules/services/desktop-managers/cosmic.nix +++ b/nixos/modules/services/desktop-managers/cosmic.nix @@ -163,6 +163,7 @@ in services.avahi.enable = lib.mkDefault true; services.gnome.gnome-keyring.enable = lib.mkDefault true; services.gvfs.enable = lib.mkDefault true; + services.orca.enable = lib.mkDefault (notExcluded pkgs.orca); services.power-profiles-daemon.enable = lib.mkDefault ( !config.hardware.system76.power-daemon.enable );