--- /dev/null
+;; Copyright (c) 2022 Jakub Czajka <jakub@ekhem.eu.org>
+;; License: GPL-3.0 or later.
+;;
+;; fonts.scm - packages for fonts.
+
+(define-module (conf common fonts)
+ #:use-module (gnu packages compression)
+ #:use-module (gnu services)
+ #:use-module (guix build-system trivial)
+ #:use-module (guix gexp)
+ #:use-module (guix git-download)
+ #:use-module (guix licenses)
+ #:use-module (guix packages)
+ #:export (font-meslo))
+
+(define font-meslo
+ (package
+ (name "font-meslo")
+ (version "1.2.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/andreberg/Meslo-Font")
+ (commit "c7ee3ce8fa43de2a9c99e94677ea9d1c46e56f26")))
+ (sha256
+ (base32
+ "1594lxdk6788bb3i3c2fh74z4pwpzcp2r1xl3cz8cz77nrcjkl8m"))))
+ (build-system trivial-build-system)
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils))
+ (let* ((unzip (string-append (assoc-ref %build-inputs "unzip")
+ "/bin/unzip"))
+ (ins (assoc-ref %build-inputs "source"))
+ (out (assoc-ref %outputs "out"))
+ (ver (string-append "v" ,version))
+ (in-dir (string-concatenate (list ins "/dist/" ver)))
+ (fonts (string-append "Meslo LG " ver))
+ (archive (string-concatenate (list in-dir "/" fonts)))
+ (out-dir (string-append out "/share/fonts"))
+ (file (string-append out-dir "/meslo-regular.ttf")))
+ (system* unzip archive)
+ (mkdir-p out-dir)
+ (for-each (lambda (font)
+ (copy-file font
+ (string-append out-dir "/"
+ (basename font))))
+ (find-files fonts "\\.ttf$"))))))
+ (native-inputs
+ `(("source" ,source)
+ ("unzip" ,unzip)))
+ (synopsis "Custom version of Apple’s Menlo-Regular font.")
+ (description "Meslo LG is a customized version of Apple’s Menlo-Regular font.")
+ (home-page "https://github.com/andreberg/Meslo-Font")
+ (license asl2.0)))