1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00

lomiri.lomiri: Try to consider services.xserver.xkb.layout

Propagate the configuration setting through an envvar, check the envvar in the compositor.
Needed because querying AccountsSettings for this information fails, due to Ubuntu-only
"InputSources" interface. So you're stuck on US layout without this hack.

(cherry picked from commit 2735184f6d)
This commit is contained in:
OPNA2608 2024-06-01 00:26:25 +02:00 committed by github-actions[bot]
parent 968425a092
commit 34b6455ddb
3 changed files with 34 additions and 0 deletions

View file

@ -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;

View file

@ -0,0 +1,29 @@
From 640cab41986fac83742af39dd19877041a2ab8dc Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
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

View file

@ -117,6 +117,7 @@ stdenv.mkDerivation (finalAttrs: {
})
./9901-lomiri-Disable-Wizard.patch
./9902-lomiri-Check-NIXOS_XKB_LAYOUTS.patch
];
postPatch = ''