From patchwork Sat Jul 1 20:48:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Denys Nykula X-Patchwork-Id: 14493 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 472A427BBEA; Sat, 1 Jul 2023 22:05:17 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8E1A627BBE2 for ; Sat, 1 Jul 2023 22:05:15 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFhmH-0002k4-TF; Sat, 01 Jul 2023 17:05:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFhmA-0002i4-TW for guix-patches@gnu.org; Sat, 01 Jul 2023 17:05:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFhmA-0005Kp-IJ for guix-patches@gnu.org; Sat, 01 Jul 2023 17:05:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qFhm9-0005yi-Tm for guix-patches@gnu.org; Sat, 01 Jul 2023 17:05:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64399] [PATCH v2] installer: Restore LatGrkCyr-8x16 console font depending on language. References: <34ca88bad83d40c14346f18ddbc34e8d2884f88f.1688217377.git.vegan@libre.net.ua> In-Reply-To: <34ca88bad83d40c14346f18ddbc34e8d2884f88f.1688217377.git.vegan@libre.net.ua> Resent-From: Denys Nykula Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Jul 2023 21:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64399 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64399@debbugs.gnu.org Cc: Denys Nykula Received: via spool by 64399-submit@debbugs.gnu.org id=B64399.168824549622963 (code B ref 64399); Sat, 01 Jul 2023 21:05:01 +0000 Received: (at 64399) by debbugs.gnu.org; 1 Jul 2023 21:04:56 +0000 Received: from localhost ([127.0.0.1]:58785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFhm4-0005yJ-Fl for submit@debbugs.gnu.org; Sat, 01 Jul 2023 17:04:56 -0400 Received: from libre.net.ua ([91.234.34.15]:50970 helo=fff.org.ua) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFhlz-0005xy-Ig for 64399@debbugs.gnu.org; Sat, 01 Jul 2023 17:04:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libre.net.ua; s=mail; t=1688245483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YqNCN8oeiAXqYVFEs2/byM7VDg30o/gnHzZx8uAymTU=; b=wS16izSzCx2JBaqr6iDI17i6I0MyKVOJ+UaUjDRDVbtRm5z09omo/RAbNqJOzZrYYpMvb0 11Ei/jdigm+Z1uOuItfHlD993pot8SVmWzJ8iAPGnxOdgYdFq8uhl3uiLTtC641VixMuJh GSEqS3Qhs1gA91HwusruQJhAUVytUZM= From: Denys Nykula Date: Sat, 1 Jul 2023 23:48:11 +0300 Message-Id: <48d9788a3a2dceab15c5432bd439d8f33492d4a5.1688233529.git.vegan@libre.net.ua> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Partially-Fixes: * gnu/installer/services.scm (system-services->configuration): When the LANGUAGE environment variable matches a known native console font, wrap the base services with modify-services, configuring console-font-service-type to set the native console font on every tty instead of the default console font. --- Untabified version 2 with suggested naming changes. Version 1 was in fact written in Emacs and formatted using the tab key, but I was editing remotely and hadn't customized enable-remote-dir-locals, so .dir-locals.el wasn't applied. gnu/installer/services.scm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) base-commit: b24a05830d11e3011eee4bc5f60a41e26188cde1 diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm index d08bab47fd..a0ac2f35d3 100644 --- a/gnu/installer/services.scm +++ b/gnu/installer/services.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Tobias Geerinckx-Rice ;;; Copyright © 2021 Leo Famulari +;;; Copyright © 2023 Denys Nykula ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,6 +24,7 @@ (define-module (gnu installer services) #:use-module (guix records) #:use-module (guix read-print) + #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:export (system-service? system-service-name @@ -159,6 +161,19 @@ (define (system-services->configuration services) (base (if desktop? '%desktop-services '%base-services)) + (native-console-font (match (getenv "LANGUAGE") + ((or "be" "bg" "el" "eo" "kk" "ky" + "mk" "mn" "ru" "sr" "tg" "uk") + "LatGrkCyr-8x16.psfu.gz") + (_ #f))) + (services (if native-console-font + `(modify-services ,base + (console-font-service-type + config => (map (lambda (tty) + (cons (car tty) + ,native-console-font)) + config))) + base)) (service-heading (list (vertical-space 1) (comment (G_ "\ ;; Below is the list of system services. To search for available @@ -177,7 +192,7 @@ (define (system-services->configuration services) %base-packages)))) ,@service-heading - (services ,base)) + (services ,services)) `(,@(if (null? packages) '() `(,@package-heading @@ -199,4 +214,4 @@ (define (system-services->configuration services) ,(comment (G_ "\ ;; This is the default list of services we ;; are appending to.\n")) - ,base)))))) + ,services))))))