From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id YNGKAnQYs2NXpwAAbAwnHQ (envelope-from ) for ; Mon, 02 Jan 2023 18:46:28 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id MH3JAXQYs2NnQgAAG6o9tA (envelope-from ) for ; Mon, 02 Jan 2023 18:46:28 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BB96326944 for ; Mon, 2 Jan 2023 18:46:27 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCOsu-0007H7-VC; Mon, 02 Jan 2023 12:46:04 -0500 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 1pCOst-0007Gr-AG for guix-patches@gnu.org; Mon, 02 Jan 2023 12:46:03 -0500 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 1pCOss-0004yM-NC for guix-patches@gnu.org; Mon, 02 Jan 2023 12:46:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pCOss-0004HR-Ht for guix-patches@gnu.org; Mon, 02 Jan 2023 12:46:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60498] [PATCH] home: services: fontutils: Add service value. References: <3c0e43334aab599678ddeee842c073ee@autistici.org> In-Reply-To: <3c0e43334aab599678ddeee842c073ee@autistici.org> Resent-From: Giacomo Leidi Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 02 Jan 2023 17:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60498 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60498@debbugs.gnu.org Cc: Giacomo Leidi Received: via spool by 60498-submit@debbugs.gnu.org id=B60498.167268152216399 (code B ref 60498); Mon, 02 Jan 2023 17:46:02 +0000 Received: (at 60498) by debbugs.gnu.org; 2 Jan 2023 17:45:22 +0000 Received: from localhost ([127.0.0.1]:43986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCOry-0004G6-UV for submit@debbugs.gnu.org; Mon, 02 Jan 2023 12:45:22 -0500 Received: from confino.investici.org ([93.190.126.19]:36061) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCOrw-0004Fu-6b for 60498@debbugs.gnu.org; Mon, 02 Jan 2023 12:45:05 -0500 Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4Nm3Cx4db1z10ww; Mon, 2 Jan 2023 17:45:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1672681501; bh=i3ET5w9nIvh9zCbeTi7ECFmtyIbq3VVddT0dgccqug4=; h=From:To:Cc:Subject:Date:From; b=U1IJqMRPGC0boe3NE1Fy1lOLi9nsvOJ60JMoU5V5IJ7SWPfDEA5EfSaonIu/CbYsg KGBoMFtnCUh1nnQsoKzuQ21jbyE7d609RTtaVkA4e38waPa4UxP2M01kV68+Q7DYld 9+ziu7zAgcNMBdXy846dfOHy2TMAQFR+2LFWd2cw= Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19]) (Authenticated sender: goodoldpaul@autistici.org) by localhost (Postfix) with ESMTPSA id 4Nm3Cx46rSz10sk; Mon, 2 Jan 2023 17:45:01 +0000 (UTC) Date: Mon, 2 Jan 2023 18:44:51 +0100 Message-Id: <20230102174451.6827-1-goodoldpaul@autistici.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: , Reply-to: Giacomo Leidi X-ACL-Warn: , Giacomo Leidi via Guix-patches From: Giacomo Leidi via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672681587; a=rsa-sha256; cv=none; b=oqAUBSZrhSz4E/+pzauja0a8GD2HkjSiPGwU0ROkvG6x9gsYX6MODYGZdUfaMHPQFibMGW DlJiq7nM2auLA8L4A/XFOqql4Vn+p5h307o2p/sGAxPK4XsMP/VoC8IylTAWBiM1MDAgPV 0jRWev8YtOnPNWYlgQ/LuUdpm7e/U9GLRMNIhtIJdPMf/UYcrTE/jkJx30uoMWon9tEMym 138pDgsXPY0GwXD0wQgziNZj1ZCZf1IOMDBOmxDKOkU47gAA0sS3G5hPwYRdEINOn2sp3v MLV+Mu/grBi/vzEQMdA5AJGsOGjqABH0PzJ9wLeZtXkLaNHNwDgX1xGZuhFXqg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=autistici.org header.s=stigmate header.b=U1IJqMRP; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672681587; h=from:from:sender:sender:reply-to: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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=i3ET5w9nIvh9zCbeTi7ECFmtyIbq3VVddT0dgccqug4=; b=Dwm/qTnRWtGFSYxW/j8Hoe1pRU6lODeIo/GIHRrgP0TZWFqpMNZqBSig+pD1iRkMApODBa aoKuzPYlCy4Ozp3Vvh/fg4x1R8kiJAv122o+jQNfwEAs8LkxD+hMOhnzQ8w7PyN0YWI8Ah kcYCSGqIbF1t2u5pcCk6ZTzb1NfRXIBjTueDS1rkSIgsipXYyu8pcw/9MSM2Kl25/pDwEL OvPdr/0A/3KFhvd7VucJV/MBujanlAZ9Qslz++pWQZU/sVnav3IA3GQxE0yaQuFzvlppOO 9jkjF+17omS3RMlqOfv2bN+bpwDPKr8IAj/X+aiDW9IOhl5ZcCWCBs+HBbCxCA== X-Spam-Score: -3.95 X-Migadu-Queue-Id: BB96326944 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=autistici.org header.s=stigmate header.b=U1IJqMRP; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -3.95 X-TUID: zOOvTyy68Yen * gnu/home/services/fontutils.scm (add-fontconfig-config-file): Add support for multiple paths; (home-fontconfig-service-type): Honor it; * doc/guix.texi (Fonts Services): Document it. --- doc/guix.texi | 25 +++++++++++++++++++++++++ gnu/home/services/fontutils.scm | 18 ++++++++++++------ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 5c85680831..1e70dd05c0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -40980,6 +40980,7 @@ services)}. * SSH: Secure Shell. Setting up the secure shell client. * Desktop: Desktop Home Services. Services for graphical environments. * Guix: Guix Home Services. Services for Guix. +* Fonts: Fonts Home Services. Services for managing User's fonts. @end menu @c In addition to that Home Services can provide @@ -41856,6 +41857,30 @@ A typical extension for adding a channel might look like this: @end lisp @end defvr +@node Fonts Services +@subsection Fonts Home Services + +The @code{(gnu home services fontutils)} module provides services for +user-specific @code{fontconfig} setup. + +@defvr {Scheme Variable} home-fontconfig-service-type +This is the service type for generating configurations for @code{fontconfig} and @code{fc-*} utilities. +Its associated value is a list of strings (or gexps) pointing to fonts locations. + +Generally, it is better to extend this service than to directly +configure it, as its default value is the default Guix Home's profile +font installation path (@code{~/.guix-home/profile/share/fonts}). If you configure this +service directly, be sure to include the above path. + +A typical extension for adding an additional path might look like this: + +@lisp +(simple-service 'additional-fonts-service + home-fontconfig-service-type + (list "~/.nix-profile/share/fonts")) +@end lisp +@end defvr + @node Invoking guix home @section Invoking @command{guix home} diff --git a/gnu/home/services/fontutils.scm b/gnu/home/services/fontutils.scm index 6062eaed6a..f959ee4fd6 100644 --- a/gnu/home/services/fontutils.scm +++ b/gnu/home/services/fontutils.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Andrew Tropin ;;; Copyright © 2021 Xinglu Chen +;;; Copyright © 2023 Giacomo Leidi ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +22,7 @@ (define-module (gnu home services fontutils) #:use-module (gnu home services) #:use-module (gnu packages fontutils) #:use-module (guix gexp) + #:use-module (srfi srfi-1) #:export (home-fontconfig-service-type)) @@ -33,15 +35,17 @@ (define-module (gnu home services fontutils) ;;; ;;; Code: -(define (add-fontconfig-config-file he-symlink-path) +(define (add-fontconfig-config-file paths) `(("fontconfig/fonts.conf" ,(mixed-text-file "fonts.conf" - " + (apply string-append + `(" - - ~/.guix-home/profile/share/fonts -")))) +\n" ,@(map (lambda (path) + (string-append " " path "\n")) + paths) + "\n")))))) (define (regenerate-font-cache-gexp _) `(("profile/share/fonts" @@ -59,7 +63,9 @@ (define home-fontconfig-service-type (service-extension home-profile-service-type (const (list fontconfig))))) - (default-value #f) + (compose concatenate) + (extend append) + (default-value '("~/.guix-home/profile/share/fonts")) (description "Provides configuration file for fontconfig and make fc-* utilities aware of font packages installed in Guix Home's profile."))) base-commit: 7efcf36e3b753a1dba6f8208f3c22d151007eaf0 -- 2.38.1