unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Fulbert <fulbert@bluewin.ch>
To: John Soo <jsoo1@asu.edu>
Cc: help-guix@gnu.org
Subject: Re: error setting console font in system.scm
Date: Sun, 14 Jun 2020 17:50:45 +0200	[thread overview]
Message-ID: <20200614155045.GA1605@bluewin.ch> (raw)
In-Reply-To: <87pna2z3ed.fsf@asu.edu>

On Sat, Jun 13, 2020 at 09:18:18PM -0700, John Soo wrote:
> Hello Fullbert,
> 
> Fulbert <fulbert@bluewin.ch> writes:
> 
> >   Trying to change console font with the following in "services" section
> > of my system configuration file :
> >
> > ----
> > …
> >   (services (append (list
> >         …
> >         (service console-font-service-type
> >           `(("tty3" . ,(file-append font-terminus "/share/consolefonts/ter-128n"))))
> >       ) %desktop-services))
> > …
> > ----
> >
> > which results in the following error when reconfiguring the system :
> >
> > ----
> > $ sudo guix system --dry-run reconfigure /etc/config.scm
> > guix system: error: service 'console-font-tty3' provided more than once
> > ----
> 
> This is because there is already a console-font-service-type in
> %desktop-services. […]You will need to modify the existing service instead
> like below. Note I have not tested this myself but something like it can be
> found in the documentation of guile association lists
> 
> https://www.gnu.org/software/guile/manual/html_node/Adding-or-Setting-Alist-Entries.html
> 
> ;; At the top of the file
> (use-modules
>   ...
>   (ice-9 match))
> 
> ;; Replace %desktop-services with this:
> 
> (modify-services %desktop-services
>   (console-font-service-type
>     configuration =>
>     (map
>       (match-lambda
>         (("tty3" . f)
>           `("tty3" . (file-append font-terminus "/share/consolefonts/ter-128n")))
>         ((tty . font) `(,tty . ,font)))
>       configuration)))
> 
> >   I probably missunderstand something and/or ill-format the
> > configuration…?… Help appreciated.
> 
> No problem. The error message is saying that such a service would
> conflict with the existing one. The aim of the snippet is to keep the
> other tty fonts and update the one on tty3.
> 
> Hope that helps!

  Indeed! It works now. Thank you for your Help John !

  For this to work though, I just had to correct a typo : add a `comma`
(to _unquote_, if I'm not wrong) before the `(file-append …`.
So, for reference :
----
;; At the top of the file
(use-modules
  ...
  (ice-9 match))

;; Replace %desktop-services with this:
(modify-services %desktop-services
  (console-font-service-type configuration =>
    (map
      (match-lambda
        (("tty3" . f)
          `("tty3" . ,(file-append
                        font-terminus
                        "/share/consolefonts/ter-128n.psf.gz")))
        ((tty . font) `(,tty . ,font))) configuration)))
----


  reply	other threads:[~2020-06-14 15:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-13 14:32 error setting console font in system.scm Fulbert
2020-06-14  4:18 ` John Soo
2020-06-14 15:50   ` Fulbert [this message]
2020-06-14 15:59     ` John Soo
  -- strict thread matches above, loose matches on Subject: below --
2020-06-13 13:53 Fulbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200614155045.GA1605@bluewin.ch \
    --to=fulbert@bluewin.ch \
    --cc=help-guix@gnu.org \
    --cc=jsoo1@asu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).