From: Andrew Tropin <andrew@trop.in>
To: Oleg Pykhalov <go.wigust@gmail.com>
Cc: 50208@debbugs.gnu.org
Subject: [bug#50208] [PATCH 1/5] home-services: Add fontutils.
Date: Fri, 27 Aug 2021 09:52:04 +0300 [thread overview]
Message-ID: <87y28ne5wr.fsf@trop.in> (raw)
In-Reply-To: <871r6ffklu.fsf@trop.in>
[-- Attachment #1: Type: text/plain, Size: 3600 bytes --]
* gnu/home-services/fontutils.scm (home-fontconfig-service-type): New
variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add home-services/fontutils.scm.
---
gnu/home-services/fontutils.scm | 65 +++++++++++++++++++++++++++++++++
gnu/local.mk | 1 +
2 files changed, 66 insertions(+)
create mode 100644 gnu/home-services/fontutils.scm
diff --git a/gnu/home-services/fontutils.scm b/gnu/home-services/fontutils.scm
new file mode 100644
index 0000000000..28bfc3d3f7
--- /dev/null
+++ b/gnu/home-services/fontutils.scm
@@ -0,0 +1,65 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Andrew Tropin <andrew@trop.in>
+;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu home-services fontutils)
+ #:use-module (gnu home-services)
+ #:use-module (gnu packages fontutils)
+ #:use-module (guix gexp)
+
+ #:export (home-fontconfig-service-type))
+
+;;; Commentary:
+;;;
+;;; Services related to fonts. home-fontconfig service provides
+;;; fontconfig configuration, which allows fc-* utilities to find
+;;; fonts in Guix Home's profile and regenerates font cache on
+;;; activation.
+;;;
+;;; Code:
+
+(define (add-fontconfig-config-file he-symlink-path)
+ `(("config/fontconfig/fonts.conf"
+ ,(mixed-text-file
+ "fonts.conf"
+ "<?xml version='1.0'?>
+<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
+<fontconfig>
+ <dir>~/.guix-home/profile/share/fonts</dir>
+</fontconfig>"))))
+
+(define (regenerate-font-cache-gexp _)
+ `(("profile/share/fonts"
+ ,#~(system* #$(file-append fontconfig "/bin/fc-cache") "-fv"))))
+
+(define home-fontconfig-service-type
+ (service-type (name 'home-fontconfig)
+ (extensions
+ (list (service-extension
+ home-files-service-type
+ add-fontconfig-config-file)
+ (service-extension
+ home-run-on-change-service-type
+ regenerate-font-cache-gexp)
+ (service-extension
+ home-profile-service-type
+ (const (list fontconfig)))))
+ (default-value #f)
+ (description
+ "Provides configuration file for fontconfig and make
+fc-* utilities aware of font packages installed in Guix Home's profile.")))
diff --git a/gnu/local.mk b/gnu/local.mk
index 91c3b0da3d..e25ff3db53 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -74,6 +74,7 @@ GNU_SYSTEM_MODULES = \
%D%/ci.scm \
%D%/home-services.scm \
%D%/home-services/symlink-manager.scm \
+ %D%/home-services/fontutils.scm \
%D%/image.scm \
%D%/packages.scm \
%D%/packages/abduco.scm \
--
2.33.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]
next prev parent reply other threads:[~2021-08-27 6:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-26 6:39 [bug#50208] [PATCH] home-services: Add symlink-manager Andrew Tropin
2021-08-26 10:58 ` Oleg Pykhalov
2021-08-27 4:31 ` Andrew Tropin
2021-08-27 6:49 ` [bug#50208] [PATCH 0/5] Add home-environment and related services Andrew Tropin
2021-08-27 6:52 ` Andrew Tropin [this message]
2021-08-27 6:58 ` [bug#50208] [PATCH 2/5] home-services: Add helper functions for service configurations Andrew Tropin
2021-08-27 7:03 ` [bug#50208] [PATCH 3/5] home-services: Add shells Andrew Tropin
2021-08-27 15:25 ` Andrew Tropin
2021-08-27 7:06 ` [bug#50208] [PATCH 4/5] home-services: Add xdg Andrew Tropin
2021-08-27 7:07 ` [bug#50208] [PATCH 5/5] home: Add home-environment Andrew Tropin
2021-08-28 10:44 ` Xinglu Chen
2021-08-30 9:10 ` Andrew Tropin
2021-08-27 15:28 ` [bug#50208] [PATCH 0/5] Add home-environment and related services Andrew Tropin
2021-08-27 19:15 ` bug#50208: " Oleg Pykhalov
2021-08-30 9:40 ` [bug#50208] [PATCH 0/4] Fixes and improvements for home-services Andrew Tropin
2021-08-30 10:28 ` [bug#50208] [PATCH v2 0/5] " Andrew Tropin
2021-08-30 23:19 ` [bug#50208] [PATCH] home-services: Add symlink-manager Oleg Pykhalov
2021-08-31 7:03 ` Andrew Tropin
2021-08-27 8:55 ` Jelle Licht
2021-08-27 15:24 ` Andrew Tropin
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y28ne5wr.fsf@trop.in \
--to=andrew@trop.in \
--cc=50208@debbugs.gnu.org \
--cc=go.wigust@gmail.com \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.