aboutsummaryrefslogtreecommitdiff
path: root/gnu/installer/services.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-08-02 23:27:52 +0200
committerLudovic Courtès <ludo@gnu.org>2022-08-08 11:54:25 +0200
commitff9522fb69b9f4a31a5b766029e26dc53a2d1cf8 (patch)
tree95ca88675af10dc2abae8f223364bc1d9f8b78c2 /gnu/installer/services.scm
parentcd1a98b928be9602ebf103744164ace7bfcae22c (diff)
downloadguix-ff9522fb69b9f4a31a5b766029e26dc53a2d1cf8.tar
guix-ff9522fb69b9f4a31a5b766029e26dc53a2d1cf8.tar.gz
installer: Add comments and vertical space to the generated config.
* gnu/installer/parted.scm (user-partitions->configuration): Introduce vertical space and a comment. * gnu/installer/services.scm (G_): New macro. (%system-services): Add comment for OpenSSH. (system-services->configuration): Add vertical space and comments. * gnu/installer/user.scm (users->configuration): Add comment. * gnu/installer/steps.scm (format-configuration): Add comment. (configuration->file): Expound leading comment. Pass #:format-comment to 'pretty-print-with-comments/splice'.
Diffstat (limited to 'gnu/installer/services.scm')
-rw-r--r--gnu/installer/services.scm39
1 files changed, 31 insertions, 8 deletions
diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm
index 6584fcceec..6c5f49622f 100644
--- a/gnu/installer/services.scm
+++ b/gnu/installer/services.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019, 2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
@@ -22,6 +22,7 @@
(define-module (gnu installer services)
#:use-module (guix records)
+ #:use-module (guix read-print)
#:use-module (srfi srfi-1)
#:export (system-service?
system-service-name
@@ -35,6 +36,11 @@
%system-services
system-services->configuration))
+(define-syntax-rule (G_ str)
+ ;; In this file, translatable strings are annotated with 'G_' so xgettext
+ ;; catches them, but translation happens later on at run time.
+ str)
+
(define-record-type* <system-service>
system-service make-system-service
system-service?
@@ -52,9 +58,7 @@
((_ fields ...)
(system-service
(type 'desktop)
- fields ...))))
- (G_ (syntax-rules () ;for xgettext
- ((_ str) str))))
+ fields ...)))))
(list
;; This is the list of desktop environments supported as services.
(desktop-environment
@@ -94,7 +98,12 @@
(system-service
(name (G_ "OpenSSH secure shell daemon (sshd)"))
(type 'networking)
- (snippet '((service openssh-service-type))))
+ (snippet `(,(vertical-space 1)
+ ,(comment
+ (G_ "\
+;; To configure OpenSSH, pass an 'openssh-configuration'
+;; record as a second argument to 'service' below.\n"))
+ (service openssh-service-type))))
(system-service
(name (G_ "Tor anonymous network router"))
(type 'networking)
@@ -149,24 +158,38 @@
(desktop? (find desktop-system-service? services))
(base (if desktop?
'%desktop-services
- '%base-services)))
+ '%base-services))
+ (heading (list (vertical-space 1)
+ (comment (G_ "\
+;; Below is the list of system services. To search for available
+;; services, run 'guix system search KEYWORD' in a terminal.\n")))))
+
(if (null? snippets)
`(,@(if (null? packages)
'()
`((packages (append (list ,@packages)
%base-packages))))
+
+ ,@heading
(services ,base))
`(,@(if (null? packages)
'()
`((packages (append (list ,@packages)
%base-packages))))
+
+ ,@heading
(services (append (list ,@snippets
,@(if desktop?
;; XXX: Assume 'keyboard-layout' is in
;; scope.
- '((set-xorg-configuration
+ `((set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout))))
'()))
- ,base))))))
+
+ ,(vertical-space 1)
+ ,(comment (G_ "\
+;; This is the default list of services we
+;; are appending to.\n"))
+ ,base))))))