diff --git a/nixos/modules/services/desktop-managers/lomiri.nix b/nixos/modules/services/desktop-managers/lomiri.nix index c9444c9466538..eec33597dc711 100644 --- a/nixos/modules/services/desktop-managers/lomiri.nix +++ b/nixos/modules/services/desktop-managers/lomiri.nix @@ -37,6 +37,10 @@ in { suru-icon-theme # telephony-service # currently broken: https://github.com/NixOS/nixpkgs/pull/314043 ]); + variables = { + # To override the keyboard layouts in Lomiri + NIXOS_XKB_LAYOUTS = config.services.xserver.xkb.layout; + }; }; hardware.pulseaudio.enable = lib.mkDefault true; diff --git a/pkgs/desktops/lomiri/applications/lomiri/9902-lomiri-Check-NIXOS_XKB_LAYOUTS.patch b/pkgs/desktops/lomiri/applications/lomiri/9902-lomiri-Check-NIXOS_XKB_LAYOUTS.patch new file mode 100644 index 0000000000000..0563aab5dda85 --- /dev/null +++ b/pkgs/desktops/lomiri/applications/lomiri/9902-lomiri-Check-NIXOS_XKB_LAYOUTS.patch @@ -0,0 +1,29 @@ +From 640cab41986fac83742af39dd19877041a2ab8dc Mon Sep 17 00:00:00 2001 +From: OPNA2608 +Date: Sat, 1 Jun 2024 00:22:27 +0200 +Subject: [PATCH] Check NIXOS_XKB_LAYOUTS for layouts before falling back to + "us" + +--- + plugins/AccountsService/AccountsService.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/plugins/AccountsService/AccountsService.cpp b/plugins/AccountsService/AccountsService.cpp +index bcf18246c..f4a7dfaa1 100644 +--- a/plugins/AccountsService/AccountsService.cpp ++++ b/plugins/AccountsService/AccountsService.cpp +@@ -295,6 +295,11 @@ QStringList AccountsService::keymaps() const + return simplifiedMaps; + } + ++ char* fallbackNixosLayouts = getenv("NIXOS_XKB_LAYOUTS"); ++ if (fallbackNixosLayouts != NULL && fallbackNixosLayouts[0] != '\0') { ++ return QString(fallbackNixosLayouts).split(QLatin1Char(','), Qt::SkipEmptyParts); ++ } ++ + return {QStringLiteral("us")}; + } + +-- +2.42.0 + diff --git a/pkgs/desktops/lomiri/applications/lomiri/default.nix b/pkgs/desktops/lomiri/applications/lomiri/default.nix index 35fdd1e466178..ca46560e702a5 100644 --- a/pkgs/desktops/lomiri/applications/lomiri/default.nix +++ b/pkgs/desktops/lomiri/applications/lomiri/default.nix @@ -117,6 +117,7 @@ stdenv.mkDerivation (finalAttrs: { }) ./9901-lomiri-Disable-Wizard.patch + ./9902-lomiri-Check-NIXOS_XKB_LAYOUTS.patch ]; postPatch = ''