From patchwork Wed Mar 20 22:32:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 1504 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7108116DB4; Wed, 20 Mar 2019 22:48:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 4787416DB2 for ; Wed, 20 Mar 2019 22:48:10 +0000 (GMT) Received: from localhost ([127.0.0.1]:54880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6k0H-0002w1-Mg for patchwork@mira.cbaines.net; Wed, 20 Mar 2019 18:48:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6jwJ-00083u-Ss for guix-patches@gnu.org; Wed, 20 Mar 2019 18:44:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6jwI-0006jN-VY for guix-patches@gnu.org; Wed, 20 Mar 2019 18:44:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38793) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h6jwI-0006im-M0 for guix-patches@gnu.org; Wed, 20 Mar 2019 18:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h6jwI-000322-HA for guix-patches@gnu.org; Wed, 20 Mar 2019 18:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#34929] [PATCH 00/12] Provide uniform keyboard layout configuration Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 20 Mar 2019 22:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34929 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34929@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155312183611633 (code B ref -1); Wed, 20 Mar 2019 22:44:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 Mar 2019 22:43:56 +0000 Received: from localhost ([127.0.0.1]:52337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h6jwB-00031Z-Kf for submit@debbugs.gnu.org; Wed, 20 Mar 2019 18:43:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50199) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h6jw9-00031M-KQ for submit@debbugs.gnu.org; Wed, 20 Mar 2019 18:43:54 -0400 Received: from lists.gnu.org ([209.51.188.17]:40799) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h6jw1-0006XS-NX for submit@debbugs.gnu.org; Wed, 20 Mar 2019 18:43:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6jw0-0007Yo-Ok for guix-patches@gnu.org; Wed, 20 Mar 2019 18:43:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6jlI-0005OL-0T; Wed, 20 Mar 2019 18:32:41 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57662 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h6jlE-0006qT-Ag; Wed, 20 Mar 2019 18:32:37 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 20 Mar 2019 23:32:29 +0100 Message-Id: <20190320223229.24417-1-ludo@gnu.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello Guix! This patch series attempts to address a longstanding issue in Guix: keyboard layout configuration. The end result is that you can configure the layout for GRUB, the Linux console, and Xorg using a single record, which directly corresponds to an XKB layout specification. The three things still have to be configured separately. Here’s an example where GRUB, Linux, and Xorg use the same layout: (operating-system ;; ... (keyboard-layout (keyboard-layout "tr")) ;for the console (bootloader (bootloader-configuration (bootloader grub-efi-bootloader) (target "/boot/efi") (keyboard-layout keyboard-layout))) ;for GRUB (services (modify-services %desktop-services (slim-service-type config => (slim-configuration (inherit config) (xorg-configuration (xorg-configuration ;for Xorg (keyboard-layout keyboard-layout)))))))) Clearly the Xorg bit is suboptimal. I don’t see any obvious way to simplify this part unfortunately because the record is aggregated by ‘slim-configuration’ & co. (there’s no Xorg service that we could extend.) That’s something we can still improve afterwards, though. Potentially controversial issues: 1. The Xorg API is changed in an incompatible way: ‘xorg-start-command’ has a different prototype, the ‘startx’ field of ‘slim-configuration’ is gone, etc. If you were using these, your config will have to be adjusted to use the new ‘xorg-configuration’ record. (But hey, we’re still pre-1.0!). 2. Since both fields and the record constructor are called ‘keyboard-layout’, you could easily have name clashes (it’s more of an aesthetic consideration, not a showstopper.) After that we should probably change the installer to generate the right incantations. These patches fix and . Feedback welcome! And thanks to nee for the initial inspiration! Ludo’. Ludovic Courtès (12): bootloader: Remove unused 'additional-configuration' field. bootloader: Reindent record type definition. Add (gnu system keyboard). bootloader: Add a 'keyboard-layout' field. services: xorg: Remove unused #:guile parameter. services: xorg: Define and record type. services: sddm, slim, gdm: Take an record. services: xorg: Add a 'keyboard-layout' field in . vm: 'virtualized-operating-system' inherits from the user's bootloader config. gnu: Add loadkeys-static. system: Initialize console keyboard layout in the initrd. doc: Document keyboard layout. doc/guix.texi | 305 ++++++++++++++++++++++++------------ gnu.scm | 3 +- gnu/bootloader.scm | 43 ++--- gnu/bootloader/grub.scm | 35 +++++ gnu/build/linux-boot.scm | 15 +- gnu/local.mk | 1 + gnu/packages/linux.scm | 37 +++++ gnu/services/sddm.scm | 14 +- gnu/services/xorg.scm | 182 ++++++++++++--------- gnu/system.scm | 7 +- gnu/system/keyboard.scm | 98 ++++++++++++ gnu/system/linux-initrd.scm | 26 ++- gnu/system/vm.scm | 1 + 13 files changed, 561 insertions(+), 206 deletions(-) create mode 100644 gnu/system/keyboard.scm