Subject: gnu: services: kmscon-configuration add font-engine,font-size field.
From: qblade <[email-masked]>
To: Guix-patches <[email-masked]>
Date: Sun, 28 Mar 2021 03:30:09 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

This will give an easier choice for machines that don't want a graphical interface (Xorg, Wayland).

The reason why the font-name field is not specified is that it often does not work on my machine, and I think it (in service) requires a font checker (to check if the font is available).

From ecb90879fee5bfbf0d3f44d487f8d24bcaf8fea7 Mon Sep 17 00:00:00 2001
From: qblade <[email-masked]>
Date: Sun, 28 Mar 2021 00:54:47 +0000
Subject: [PATCH] services: kmscon: Add font-engine,font-size field

* gnu/services/base.scm (<kmscon-configuration>,
<kmscon-service-type>): Add font-engine,font-size field.
---
 doc/guix.texi         |  6 ++++++
 gnu/services/base.scm | 12 ++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index c23d044ff5..cb683d8fb7 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -15178,6 +15178,12 @@ in automatically without prompting for their login name or password.
 @item @code{hardware-acceleration?} (default: #f)
 Whether to use hardware acceleration.
 
+@item @code{font-engine} (default: @code{"pango"})
+Font engine used in Kmscon.
+
+@item @code{font-size} (default: @code{12})
+Font size used in Kmscon.
+
 @item @code{kmscon} (default: @var{kmscon})
 The Kmscon package to use.
 
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index f50bcfdcb4..e92cfd90bb 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -2304,7 +2304,11 @@ This service is not part of @var{%base-services}."
   (auto-login              kmscon-configuration-auto-login
                            (default #f))
   (hardware-acceleration?  kmscon-configuration-hardware-acceleration?
-                           (default #f))) ; #t causes failure
+                           (default #f))  ; #t causes failure
+  (font-engine             kmscon-configuration-font-engine
+                           (default "pango"))
+  (font-size               kmscon-configuration-font-size
+                           (default 12)))
 
 (define kmscon-service-type
   (shepherd-service-type
@@ -2315,13 +2319,17 @@ This service is not part of @var{%base-services}."
            (login-program (kmscon-configuration-login-program config))
            (login-arguments (kmscon-configuration-login-arguments config))
            (auto-login (kmscon-configuration-auto-login config))
-           (hardware-acceleration? (kmscon-configuration-hardware-acceleration? config)))
+           (hardware-acceleration? (kmscon-configuration-hardware-acceleration? config))
+           (font-engine (kmscon-configuration-font-engine config))
+           (font-size (kmscon-configuration-font-size config)))
 
        (define kmscon-command
          #~(list
             #$(file-append kmscon "/bin/kmscon") "--login"
             "--vt" #$virtual-terminal
             "--no-switchvt" ;Prevent a switch to the virtual terminal.
+            "--font-engine" #$font-engine
+            "--font-size" #$(number->string font-size)
             #$@(if hardware-acceleration? '("--hwaccel") '())
             "--login" "--"
             #$login-program #$@login-arguments
-- 
2.31.0