GNU bug report logs - #50967
[PATCH 00/12] Move (gnu home-services XYZ) to (gnu services XYZ)

Previous Next

Package: guix-patches;

Reported by: Oleg Pykhalov <go.wigust <at> gmail.com>

Date: Sat, 2 Oct 2021 13:45:01 UTC

Severity: normal

Done: Oleg Pykhalov <go.wigust <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50967 in the body.
You can then email your comments to 50967 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 13:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 02 Oct 2021 13:45:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 00/12] Move (gnu home-services XYZ) to (gnu services XYZ)
Date: Sat,  2 Oct 2021 16:43:52 +0300
This patch series moves (gnu home-services XYZ) to (gnu services XYZ) for:

1. Better module naming (discussed at
https://lists.gnu.org/archive/html/guix-devel/2021-09/msg00169.html )

2. Easier code sharing.  E.g. (gnu home-services mcron) uses ‘@@’ which should
never be used, and not guaranteed to work these days, due to inlining.

Tests:

passes ‘make check TESTS=tests/guix-home.sh’
succeeded ‘./pre-inst-env guix home build …/home.scm’
succeeded ‘./pre-inst-env guix home reconfigure …/home.scm’

Andrew Tropin (1):
  tests: Add tests for guix home cli.

Oleg Pykhalov (11):
  gnu: home-services: Move configuration to (gnu services).
  gnu: home-services: Move symlink-manager to (gnu services).
  gnu: home-services: Move utils to (gnu services).
  gnu: home-services: Move fontutils to (gnu services).
  gnu: home-services: Move shells to (gnu services).
  gnu: home-services: Move xdg to (gnu services).
  gnu: home-services: Move shepherd to (gnu services).
  gnu: home-services: Move mcron to (gnu services).
  gnu: home-services: Change %service-type-path and filter services.
  scripts: home: (gnu home-services bash) -> (gnu services bash).
  doc: (gnu home-services) -> (gnu services).

 Makefile.am                                   |   1 +
 doc/guix.texi                                 |   8 +-
 doc/he-config-bare-bones.scm                  |   2 +-
 gnu/home-services.scm                         |   9 +-
 gnu/home-services/configuration.scm           | 109 --------------
 gnu/home-services/mcron.scm                   | 115 ---------------
 gnu/home-services/shepherd.scm                | 134 ------------------
 gnu/home.scm                                  |   8 +-
 gnu/local.mk                                  |  13 +-
 gnu/services/configuration.scm                |  89 +++++++++++-
 gnu/{home-services => services}/fontutils.scm |   2 +-
 gnu/services/mcron.scm                        |  89 +++++++++++-
 gnu/{home-services => services}/shells.scm    |   6 +-
 gnu/services/shepherd.scm                     | 112 ++++++++++++++-
 .../symlink-manager.scm                       |   2 +-
 gnu/{home-services => services}/utils.scm     |   2 +-
 gnu/{home-services => services}/xdg.scm       |   6 +-
 guix/scripts/home/import.scm                  |   2 +-
 tests/guix-home.sh                            |  99 +++++++++++++
 19 files changed, 417 insertions(+), 391 deletions(-)
 delete mode 100644 gnu/home-services/configuration.scm
 delete mode 100644 gnu/home-services/mcron.scm
 delete mode 100644 gnu/home-services/shepherd.scm
 rename gnu/{home-services => services}/fontutils.scm (98%)
 rename gnu/{home-services => services}/shells.scm (99%)
 rename gnu/{home-services => services}/symlink-manager.scm (99%)
 rename gnu/{home-services => services}/utils.scm (98%)
 rename gnu/{home-services => services}/xdg.scm (99%)
 create mode 100644 tests/guix-home.sh

-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 13:48:02 GMT) Full text and rfc822 format available.

Message #8 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH 01/12] tests: Add tests for guix home cli.
Date: Sat,  2 Oct 2021 16:45:52 +0300
From: Andrew Tropin <andrew <at> trop.in>

* tests/guix-home.sh: New file.
* Makefile.am (SH_TESTS): Add tests/guix-home.sh.

Signed-off-by: Oleg Pykhalov <go.wigust <at> gmail.com>
---
 Makefile.am        |  1 +
 tests/guix-home.sh | 99 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 100 insertions(+)
 create mode 100644 tests/guix-home.sh

diff --git a/Makefile.am b/Makefile.am
index b66789fa0b..5bf2567dc8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -546,6 +546,7 @@ SH_TESTS =					\
   tests/guix-package-aliases.sh			\
   tests/guix-package-net.sh			\
   tests/guix-system.sh				\
+  tests/guix-home.sh				\
   tests/guix-archive.sh				\
   tests/guix-authenticate.sh			\
   tests/guix-environment.sh			\
diff --git a/tests/guix-home.sh b/tests/guix-home.sh
new file mode 100644
index 0000000000..cb015c907f
--- /dev/null
+++ b/tests/guix-home.sh
@@ -0,0 +1,99 @@
+# GNU Guix --- Functional package management for GNU
+# Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
+#
+# 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/>.
+
+#
+# Test 'guix home' cli.
+#
+
+set -e
+
+guix home --version
+
+tmpfile="t-guix-home-$$"
+errorfile="t-guix-home-error-$$"
+
+# Note: This directory is chosen outside $builddir so that relative file name
+# canonicalization doesn't mess up with 'current-source-directory', used by
+# 'local-file' ('load' forces 'relative' for
+# %FILE-PORT-NAME-CANONICALIZATION.)
+tmpdir="${TMPDIR:-/tmp}/t-guix-home-$$"
+mkdir "$tmpdir"
+
+trap 'rm -f "$tmpfile" "$errorfile" "$tmpdir"/*; rmdir "$tmpdir"' EXIT
+
+# Reporting of syntax errors.
+
+cat > "$tmpfile"<<EOF
+;; This is line 1, and the next one is line 2.
+   (home-environment
+    (packages))
+;; The 'T' is at column 3.
+EOF
+
+if guix home build "$tmpfile" 2> "$errorfile"
+then
+    # This must not succeed.
+    exit 1
+else
+    grep "$tmpfile:3:4: error: (packages): invalid field specifier" "$errorfile"
+fi
+
+
+cat > "$tmpfile"<<EOF
+;; This is line 1, and the next one is line 2.
+   (home-environment
+;; This is line 3, and there is no closing paren!
+EOF
+
+if guix home build "$tmpfile" 2> "$errorfile"
+then
+    # This must not succeed.
+    exit 1
+else
+    # Guile 3.0.6 gets line/column numbers for 'read-error' wrong
+    # (zero-indexed): <https://bugs.gnu.org/48089>.
+    grep "$tmpfile:4:1: missing closing paren" "$errorfile" || \
+    grep "$tmpfile:3:0: missing closing paren" "$errorfile"
+fi
+
+# Reporting of duplicate system service declaration.
+
+cat > "$tmpfile" <<EOF
+(use-modules (gnu))
+(use-modules (gnu home-services shepherd))
+
+(home-environment
+  (services (list (service home-shepherd-service-type)
+                  (simple-service 'test-shepherd-extension
+                   home-shepherd-service-type '())
+                  (service home-shepherd-service-type)
+                  (service home-shepherd-service-type))))
+EOF
+
+if guix home build "$tmpfile" 2> "$errorfile"
+then
+    # This must not succeed.
+    exit 1
+else
+    grep "guix home: error: more than one target service of type 'home-shepherd'" "$errorfile"
+fi
+
+# Searching.
+
+guix home search mcron | grep "^name: home-mcron"
+guix home search job manager | grep "^name: home-mcron"
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 13:48:02 GMT) Full text and rfc822 format available.

Message #11 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 03/12] gnu: home-services: Move symlink-manager to (gnu
 services).
Date: Sat,  2 Oct 2021 16:45:54 +0300
* gnu/home-services/symlink-manager.scm: Rename to
gnu/services/symlink-manager.scm.
* gnu/local.mk: Same.
* gnu/home.scm: Replace (gnu home-services symlink-manager) with
(gnu services symlink-manager).
---
 gnu/home.scm                                        | 2 +-
 gnu/local.mk                                        | 2 +-
 gnu/{home-services => services}/symlink-manager.scm | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename gnu/{home-services => services}/symlink-manager.scm (99%)

diff --git a/gnu/home.scm b/gnu/home.scm
index f4c9359e25..9a25a20b6c 100644
--- a/gnu/home.scm
+++ b/gnu/home.scm
@@ -18,7 +18,7 @@
 
 (define-module (gnu home)
   #:use-module (gnu home-services)
-  #:use-module (gnu home-services symlink-manager)
+  #:use-module (gnu services symlink-manager)
   #:use-module (gnu home-services shells)
   #:use-module (gnu home-services xdg)
   #:use-module (gnu home-services fontutils)
diff --git a/gnu/local.mk b/gnu/local.mk
index 0e1ff9f462..1c30763ff2 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -75,7 +75,6 @@ GNU_SYSTEM_MODULES =				\
   %D%/ci.scm					\
   %D%/home.scm					\
   %D%/home-services.scm			\
-  %D%/home-services/symlink-manager.scm	\
   %D%/home-services/fontutils.scm		\
   %D%/home-services/shells.scm			\
   %D%/home-services/shepherd.scm		\
@@ -660,6 +659,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/services/spice.scm				\
   %D%/services/ssh.scm				\
   %D%/services/syncthing.scm			\
+  %D%/services/symlink-manager.scm		\
   %D%/services/sysctl.scm			\
   %D%/services/telephony.scm			\
   %D%/services/version-control.scm              \
diff --git a/gnu/home-services/symlink-manager.scm b/gnu/services/symlink-manager.scm
similarity index 99%
rename from gnu/home-services/symlink-manager.scm
rename to gnu/services/symlink-manager.scm
index 11f5d503d4..84adec8d44 100644
--- a/gnu/home-services/symlink-manager.scm
+++ b/gnu/services/symlink-manager.scm
@@ -17,7 +17,7 @@
 ;;; 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 symlink-manager)
+(define-module (gnu services symlink-manager)
   #:use-module (gnu home-services)
   #:use-module (guix gexp)
 
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 13:48:02 GMT) Full text and rfc822 format available.

Message #14 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 02/12] gnu: home-services: Move configuration to (gnu
 services).
Date: Sat,  2 Oct 2021 16:45:53 +0300
* gnu/home-services/configuration.scm: Move the content ...
* gnu/services/configuration.scm: ... here.
* gnu/local.mk (GNU_SYSTEM_MODULES): Delete gnu/home-services/configuration.
* gnu/home-services/shells.scm: Replace (gnu home-services configuration)
with (gnu services configuration).
* gnu/home-services/xdg.scm: Same.
---
 gnu/home-services/configuration.scm | 109 ----------------------------
 gnu/home-services/shells.scm        |   2 +-
 gnu/home-services/xdg.scm           |   2 +-
 gnu/local.mk                        |   1 -
 gnu/services/configuration.scm      |  89 ++++++++++++++++++++++-
 5 files changed, 89 insertions(+), 114 deletions(-)
 delete mode 100644 gnu/home-services/configuration.scm

diff --git a/gnu/home-services/configuration.scm b/gnu/home-services/configuration.scm
deleted file mode 100644
index e8f4bc77ec..0000000000
--- a/gnu/home-services/configuration.scm
+++ /dev/null
@@ -1,109 +0,0 @@
-;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
-;;; Copyright © 2021 Xinglu Chen <public <at> 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 configuration)
-  #:use-module (gnu services configuration)
-  #:use-module (guix gexp)
-  #:use-module (srfi srfi-1)
-  #:use-module (ice-9 curried-definitions)
-  #:use-module (ice-9 match)
-  #:use-module (guix i18n)
-  #:use-module (guix diagnostics)
-
-  #:export (filter-configuration-fields
-
-            interpose
-            list-of
-
-            list-of-strings?
-            alist?
-            string-or-gexp?
-	    serialize-string-or-gexp
-	    text-config?
-            serialize-text-config
-            generic-serialize-alist-entry
-            generic-serialize-alist))
-
-(define* (filter-configuration-fields configuration-fields fields
-				      #:optional negate?)
-  "Retrieve the fields listed in FIELDS from CONFIGURATION-FIELDS.
-If NEGATE? is @code{#t}, retrieve all fields except FIELDS."
-  (filter (lambda (field)
-            (let ((member? (member (configuration-field-name field) fields)))
-              (if (not negate?) member? (not member?))))
-          configuration-fields))
-
-
-(define* (interpose ls  #:optional (delimiter "\n") (grammar 'infix))
-  "Same as @code{string-join}, but without join and string, returns an
-DELIMITER interposed LS.  Support 'infix and 'suffix GRAMMAR values."
-  (when (not (member grammar '(infix suffix)))
-    (raise
-     (formatted-message
-      (G_ "The GRAMMAR value must be 'infix or 'suffix, but ~a provided.")
-      grammar)))
-  (fold-right (lambda (e acc)
-		(cons e
-		      (if (and (null? acc) (eq? grammar 'infix))
-			  acc
-			  (cons delimiter acc))))
-	      '() ls))
-
-(define (list-of pred?)
-  "Return a procedure that takes a list and check if all the elements of
-the list result in @code{#t} when applying PRED? on them."
-    (lambda (x)
-      (if (list? x)
-          (every pred? x)
-          #f)))
-
-
-(define list-of-strings?
-  (list-of string?))
-
-(define alist? list?)
-
-(define (string-or-gexp? sg) (or (string? sg) (gexp? sg)))
-(define (serialize-string-or-gexp field-name val) "")
-
-(define (text-config? config)
-  (and (list? config) (every string-or-gexp? config)))
-(define (serialize-text-config field-name val)
-  #~(string-append #$@(interpose val "\n" 'suffix)))
-
-(define ((generic-serialize-alist-entry serialize-field) entry)
-  "Apply the SERIALIZE-FIELD procedure on the field and value of ENTRY."
-  (match entry
-    ((field . val) (serialize-field field val))))
-
-(define (generic-serialize-alist combine serialize-field fields)
-  "Generate a configuration from an association list FIELDS.
-
-SERIALIZE-FIELD is a procedure that takes two arguments, it will be
-applied on the fields and values of FIELDS using the
-@code{generic-serialize-alist-entry} procedure.
-
-COMBINE is a procedure that takes one or more arguments and combines
-all the alist entries into one value, @code{string-append} or
-@code{append} are usually good candidates for this.
-
-See the @code{serialize-alist} procedure in `@code{(gnu home-services
-version-control}' for an example usage.)}"
-  (apply combine
-         (map (generic-serialize-alist-entry serialize-field) fields)))
diff --git a/gnu/home-services/shells.scm b/gnu/home-services/shells.scm
index ecb02098f7..f9057cc8a2 100644
--- a/gnu/home-services/shells.scm
+++ b/gnu/home-services/shells.scm
@@ -19,7 +19,7 @@
 
 (define-module (gnu home-services shells)
   #:use-module (gnu services configuration)
-  #:use-module (gnu home-services configuration)
+  #:use-module (gnu services configuration)
   #:use-module (gnu home-services utils)
   #:use-module (gnu home-services)
   #:use-module (gnu packages shells)
diff --git a/gnu/home-services/xdg.scm b/gnu/home-services/xdg.scm
index 94275f3b65..efc1870c28 100644
--- a/gnu/home-services/xdg.scm
+++ b/gnu/home-services/xdg.scm
@@ -19,7 +19,7 @@
 
 (define-module (gnu home-services xdg)
   #:use-module (gnu services configuration)
-  #:use-module (gnu home-services configuration)
+  #:use-module (gnu services configuration)
   #:use-module (gnu home-services)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu home-services utils)
diff --git a/gnu/local.mk b/gnu/local.mk
index d415b892e9..0e1ff9f462 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -77,7 +77,6 @@ GNU_SYSTEM_MODULES =				\
   %D%/home-services.scm			\
   %D%/home-services/symlink-manager.scm	\
   %D%/home-services/fontutils.scm		\
-  %D%/home-services/configuration.scm		\
   %D%/home-services/shells.scm			\
   %D%/home-services/shepherd.scm		\
   %D%/home-services/mcron.scm			\
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index df3d3b6f9b..54e5cd1a79 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2017, 2018 Clément Lassieur <clement <at> lassieur.org>
 ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,10 +26,12 @@
   #:use-module (guix records)
   #:use-module (guix gexp)
   #:use-module ((guix utils) #:select (source-properties->location))
-  #:use-module ((guix diagnostics) #:select (location-file))
+  #:use-module ((guix diagnostics) #:select (formatted-message location-file))
   #:use-module ((guix modules) #:select (file-name->module-name))
+  #:use-module (guix i18n)
   #:autoload   (texinfo) (texi-fragment->stexi)
   #:autoload   (texinfo serialize) (stexi->texi)
+  #:use-module (ice-9 curried-definitions)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-34)
@@ -56,7 +59,21 @@
             generate-documentation
             configuration->documentation
             empty-serializer
-            serialize-package))
+            serialize-package
+
+            filter-configuration-fields
+
+            interpose
+            list-of
+
+            list-of-strings?
+            alist?
+            string-or-gexp?
+	    serialize-string-or-gexp
+	    text-config?
+            serialize-text-config
+            generic-serialize-alist-entry
+            generic-serialize-alist))
 
 ;;; Commentary:
 ;;;
@@ -323,3 +340,71 @@ Texinfo documentation of its fields."
                                                   '-fields))))
     (display (generate-documentation `((,configuration-symbol ,fields-getter))
                                      configuration-symbol))))
+
+(define* (filter-configuration-fields configuration-fields fields
+				      #:optional negate?)
+  "Retrieve the fields listed in FIELDS from CONFIGURATION-FIELDS.
+If NEGATE? is @code{#t}, retrieve all fields except FIELDS."
+  (filter (lambda (field)
+            (let ((member? (member (configuration-field-name field) fields)))
+              (if (not negate?) member? (not member?))))
+          configuration-fields))
+
+
+(define* (interpose ls  #:optional (delimiter "\n") (grammar 'infix))
+  "Same as @code{string-join}, but without join and string, returns an
+DELIMITER interposed LS.  Support 'infix and 'suffix GRAMMAR values."
+  (when (not (member grammar '(infix suffix)))
+    (raise
+     (formatted-message
+      (G_ "The GRAMMAR value must be 'infix or 'suffix, but ~a provided.")
+      grammar)))
+  (fold-right (lambda (e acc)
+		(cons e
+		      (if (and (null? acc) (eq? grammar 'infix))
+			  acc
+			  (cons delimiter acc))))
+	      '() ls))
+
+(define (list-of pred?)
+  "Return a procedure that takes a list and check if all the elements of
+the list result in @code{#t} when applying PRED? on them."
+    (lambda (x)
+      (if (list? x)
+          (every pred? x)
+          #f)))
+
+
+(define list-of-strings?
+  (list-of string?))
+
+(define alist? list?)
+
+(define (string-or-gexp? sg) (or (string? sg) (gexp? sg)))
+(define (serialize-string-or-gexp field-name val) "")
+
+(define (text-config? config)
+  (and (list? config) (every string-or-gexp? config)))
+(define (serialize-text-config field-name val)
+  #~(string-append #$@(interpose val "\n" 'suffix)))
+
+(define ((generic-serialize-alist-entry serialize-field) entry)
+  "Apply the SERIALIZE-FIELD procedure on the field and value of ENTRY."
+  (match entry
+    ((field . val) (serialize-field field val))))
+
+(define (generic-serialize-alist combine serialize-field fields)
+  "Generate a configuration from an association list FIELDS.
+
+SERIALIZE-FIELD is a procedure that takes two arguments, it will be
+applied on the fields and values of FIELDS using the
+@code{generic-serialize-alist-entry} procedure.
+
+COMBINE is a procedure that takes one or more arguments and combines
+all the alist entries into one value, @code{string-append} or
+@code{append} are usually good candidates for this.
+
+See the @code{serialize-alist} procedure in `@code{(gnu home-services
+version-control}' for an example usage.)}"
+  (apply combine
+         (map (generic-serialize-alist-entry serialize-field) fields)))
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 13:48:03 GMT) Full text and rfc822 format available.

Message #17 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 04/12] gnu: home-services: Move utils to (gnu services).
Date: Sat,  2 Oct 2021 16:45:55 +0300
* gnu/home-services/utils.scm: Rename to gnu/services/utils.scm.
* gnu/local.mk: Same.
* gnu/home-services/shells.scm: Replace (gnu home-services utils) with
(gnu services utils)
* gnu/home-services/xdg.scm: Same.
---
 gnu/home-services/shells.scm              | 2 +-
 gnu/home-services/xdg.scm                 | 2 +-
 gnu/local.mk                              | 2 +-
 gnu/{home-services => services}/utils.scm | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
 rename gnu/{home-services => services}/utils.scm (98%)

diff --git a/gnu/home-services/shells.scm b/gnu/home-services/shells.scm
index f9057cc8a2..377ff74542 100644
--- a/gnu/home-services/shells.scm
+++ b/gnu/home-services/shells.scm
@@ -20,7 +20,7 @@
 (define-module (gnu home-services shells)
   #:use-module (gnu services configuration)
   #:use-module (gnu services configuration)
-  #:use-module (gnu home-services utils)
+  #:use-module (gnu services utils)
   #:use-module (gnu home-services)
   #:use-module (gnu packages shells)
   #:use-module (gnu packages bash)
diff --git a/gnu/home-services/xdg.scm b/gnu/home-services/xdg.scm
index efc1870c28..183bca630c 100644
--- a/gnu/home-services/xdg.scm
+++ b/gnu/home-services/xdg.scm
@@ -22,7 +22,7 @@
   #:use-module (gnu services configuration)
   #:use-module (gnu home-services)
   #:use-module (gnu packages freedesktop)
-  #:use-module (gnu home-services utils)
+  #:use-module (gnu services utils)
   #:use-module (guix gexp)
   #:use-module (guix records)
   #:use-module (guix i18n)
diff --git a/gnu/local.mk b/gnu/local.mk
index 1c30763ff2..50f5e58fbc 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -79,7 +79,6 @@ GNU_SYSTEM_MODULES =				\
   %D%/home-services/shells.scm			\
   %D%/home-services/shepherd.scm		\
   %D%/home-services/mcron.scm			\
-  %D%/home-services/utils.scm			\
   %D%/home-services/xdg.scm			\
   %D%/image.scm					\
   %D%/packages.scm				\
@@ -664,6 +663,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/services/telephony.scm			\
   %D%/services/version-control.scm              \
   %D%/services/vpn.scm				\
+  %D%/services/utils.scm			\
   %D%/services/web.scm				\
   %D%/services/xorg.scm				\
 						\
diff --git a/gnu/home-services/utils.scm b/gnu/services/utils.scm
similarity index 98%
rename from gnu/home-services/utils.scm
rename to gnu/services/utils.scm
index f13133a7ae..b95f2395c4 100644
--- a/gnu/home-services/utils.scm
+++ b/gnu/services/utils.scm
@@ -17,7 +17,7 @@
 ;;; 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 utils)
+(define-module (gnu services utils)
   #:use-module (ice-9 string-fun)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 13:48:03 GMT) Full text and rfc822 format available.

Message #20 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 05/12] gnu: home-services: Move fontutils to (gnu services).
Date: Sat,  2 Oct 2021 16:45:56 +0300
* gnu/home-services/fontutils.scm: Rename to gnu/services/fontutils.scm.
* gnu/local.mk: Same.
* gnu/home.scm: Replace (gnu home-services fontutils) with
(gnu services fontutils).
---
 gnu/home.scm                                  | 2 +-
 gnu/local.mk                                  | 2 +-
 gnu/{home-services => services}/fontutils.scm | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename gnu/{home-services => services}/fontutils.scm (98%)

diff --git a/gnu/home.scm b/gnu/home.scm
index 9a25a20b6c..352f19ea06 100644
--- a/gnu/home.scm
+++ b/gnu/home.scm
@@ -21,7 +21,7 @@
   #:use-module (gnu services symlink-manager)
   #:use-module (gnu home-services shells)
   #:use-module (gnu home-services xdg)
-  #:use-module (gnu home-services fontutils)
+  #:use-module (gnu services fontutils)
   #:use-module (gnu services)
   #:use-module (guix records)
   #:use-module (guix diagnostics)
diff --git a/gnu/local.mk b/gnu/local.mk
index 50f5e58fbc..5df35435e7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -75,7 +75,6 @@ GNU_SYSTEM_MODULES =				\
   %D%/ci.scm					\
   %D%/home.scm					\
   %D%/home-services.scm			\
-  %D%/home-services/fontutils.scm		\
   %D%/home-services/shells.scm			\
   %D%/home-services/shepherd.scm		\
   %D%/home-services/mcron.scm			\
@@ -630,6 +629,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/services/docker.scm			\
   %D%/services/authentication.scm		\
   %D%/services/file-sharing.scm			\
+  %D%/services/fontutils.scm			\
   %D%/services/games.scm			\
   %D%/services/ganeti.scm			\
   %D%/services/getmail.scm				\
diff --git a/gnu/home-services/fontutils.scm b/gnu/services/fontutils.scm
similarity index 98%
rename from gnu/home-services/fontutils.scm
rename to gnu/services/fontutils.scm
index 28bfc3d3f7..82c6048bb4 100644
--- a/gnu/home-services/fontutils.scm
+++ b/gnu/services/fontutils.scm
@@ -17,7 +17,7 @@
 ;;; 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)
+(define-module (gnu services fontutils)
   #:use-module (gnu home-services)
   #:use-module (gnu packages fontutils)
   #:use-module (guix gexp)
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 13:48:04 GMT) Full text and rfc822 format available.

Message #23 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 06/12] gnu: home-services: Move shells to (gnu services).
Date: Sat,  2 Oct 2021 16:45:57 +0300
* gnu/home-services/shells.scm: Rename to gnu/services/shells.scm.
* gnu/local.mk: Same.
* gnu/home.scm: Replace (gnu home-services shells) with (gnu services shells).
* doc/he-config-bare-bones.scm: Same.
---
 doc/he-config-bare-bones.scm               | 2 +-
 gnu/home.scm                               | 2 +-
 gnu/local.mk                               | 2 +-
 gnu/{home-services => services}/shells.scm | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
 rename gnu/{home-services => services}/shells.scm (99%)

diff --git a/doc/he-config-bare-bones.scm b/doc/he-config-bare-bones.scm
index 01be46a7b0..c6c5866a17 100644
--- a/doc/he-config-bare-bones.scm
+++ b/doc/he-config-bare-bones.scm
@@ -1,6 +1,6 @@
 (use-modules (gnu home)
              (gnu home-services)
-             (gnu home-services shells)
+             (gnu services shells)
              (gnu services)
              (gnu packages admin)
              (guix gexp))
diff --git a/gnu/home.scm b/gnu/home.scm
index 352f19ea06..a36b41daf9 100644
--- a/gnu/home.scm
+++ b/gnu/home.scm
@@ -19,7 +19,7 @@
 (define-module (gnu home)
   #:use-module (gnu home-services)
   #:use-module (gnu services symlink-manager)
-  #:use-module (gnu home-services shells)
+  #:use-module (gnu services shells)
   #:use-module (gnu home-services xdg)
   #:use-module (gnu services fontutils)
   #:use-module (gnu services)
diff --git a/gnu/local.mk b/gnu/local.mk
index 5df35435e7..c549a96966 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -75,7 +75,6 @@ GNU_SYSTEM_MODULES =				\
   %D%/ci.scm					\
   %D%/home.scm					\
   %D%/home-services.scm			\
-  %D%/home-services/shells.scm			\
   %D%/home-services/shepherd.scm		\
   %D%/home-services/mcron.scm			\
   %D%/home-services/xdg.scm			\
@@ -655,6 +654,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/services/pm.scm				\
   %D%/services/rsync.scm			\
   %D%/services/sddm.scm				\
+  %D%/services/shells.scm			\
   %D%/services/spice.scm				\
   %D%/services/ssh.scm				\
   %D%/services/syncthing.scm			\
diff --git a/gnu/home-services/shells.scm b/gnu/services/shells.scm
similarity index 99%
rename from gnu/home-services/shells.scm
rename to gnu/services/shells.scm
index 377ff74542..1e51fa99df 100644
--- a/gnu/home-services/shells.scm
+++ b/gnu/services/shells.scm
@@ -17,7 +17,7 @@
 ;;; 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 shells)
+(define-module (gnu services shells)
   #:use-module (gnu services configuration)
   #:use-module (gnu services configuration)
   #:use-module (gnu services utils)
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 13:48:04 GMT) Full text and rfc822 format available.

Message #26 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 07/12] gnu: home-services: Move xdg to (gnu services).
Date: Sat,  2 Oct 2021 16:45:58 +0300
* gnu/home-services/xdg.scm: Rename to gnu/services/xdg.scm.
* gnu/local.mk: Same.
* gnu/home.scm: Replace (gnu home-services xdg) with (gnu services xdg).
---
 gnu/home.scm                            | 2 +-
 gnu/local.mk                            | 2 +-
 gnu/{home-services => services}/xdg.scm | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename gnu/{home-services => services}/xdg.scm (99%)

diff --git a/gnu/home.scm b/gnu/home.scm
index a36b41daf9..fc4193385e 100644
--- a/gnu/home.scm
+++ b/gnu/home.scm
@@ -20,7 +20,7 @@
   #:use-module (gnu home-services)
   #:use-module (gnu services symlink-manager)
   #:use-module (gnu services shells)
-  #:use-module (gnu home-services xdg)
+  #:use-module (gnu services xdg)
   #:use-module (gnu services fontutils)
   #:use-module (gnu services)
   #:use-module (guix records)
diff --git a/gnu/local.mk b/gnu/local.mk
index c549a96966..97ff893bf7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -77,7 +77,6 @@ GNU_SYSTEM_MODULES =				\
   %D%/home-services.scm			\
   %D%/home-services/shepherd.scm		\
   %D%/home-services/mcron.scm			\
-  %D%/home-services/xdg.scm			\
   %D%/image.scm					\
   %D%/packages.scm				\
   %D%/packages/abduco.scm			\
@@ -665,6 +664,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/services/vpn.scm				\
   %D%/services/utils.scm			\
   %D%/services/web.scm				\
+  %D%/services/xdg.scm				\
   %D%/services/xorg.scm				\
 						\
   %D%/system.scm				\
diff --git a/gnu/home-services/xdg.scm b/gnu/services/xdg.scm
similarity index 99%
rename from gnu/home-services/xdg.scm
rename to gnu/services/xdg.scm
index 183bca630c..47e1751f75 100644
--- a/gnu/home-services/xdg.scm
+++ b/gnu/services/xdg.scm
@@ -17,7 +17,7 @@
 ;;; 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 xdg)
+(define-module (gnu services xdg)
   #:use-module (gnu services configuration)
   #:use-module (gnu services configuration)
   #:use-module (gnu home-services)
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 13:48:04 GMT) Full text and rfc822 format available.

Message #29 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 09/12] gnu: home-services: Move mcron to (gnu services).
Date: Sat,  2 Oct 2021 16:46:00 +0300
* gnu/home-services/mcron.scm: Move content without delete job-files and
shepherd-schedule-action ...
* gnu/services/mcron.scm: ... here.
* gnu/local.mk: Delete gnu/home-services/mcron.scm.
* doc/guix.texi: Replace (gnu home-services mcron) with (gnu services mcron).
---
 doc/guix.texi               |   2 +-
 gnu/home-services/mcron.scm | 115 ------------------------------------
 gnu/local.mk                |   1 -
 gnu/services/mcron.scm      |  89 +++++++++++++++++++++++++++-
 4 files changed, 89 insertions(+), 118 deletions(-)
 delete mode 100644 gnu/home-services/mcron.scm

diff --git a/doc/guix.texi b/doc/guix.texi
index a72a726b54..d06590ab8c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -35810,7 +35810,7 @@ for example).
 @cindex mcron
 @cindex scheduling jobs
 
-The @code{(gnu home-services mcron)} module provides an interface to
+The @code{(gnu services mcron)} module provides an interface to
 GNU <at> tie{}mcron, a daemon to run jobs at scheduled times (@pxref{Top,,,
 mcron, GNU <at> tie{}mcron}).  The information about system's mcron is
 applicable here (@pxref{Scheduled Job Execution}), the only difference
diff --git a/gnu/home-services/mcron.scm b/gnu/home-services/mcron.scm
deleted file mode 100644
index a4e09f509c..0000000000
--- a/gnu/home-services/mcron.scm
+++ /dev/null
@@ -1,115 +0,0 @@
-;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
-;;; Copyright © 2021 Xinglu Chen <public <at> 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 mcron)
-  #:use-module (gnu packages guile-xyz)
-  #:use-module (gnu home-services)
-  #:use-module (gnu services shepherd)
-  #:use-module (gnu services shepherd)
-  #:use-module (guix records)
-  #:use-module (guix gexp)
-  #:use-module (srfi srfi-1)
-  #:use-module (ice-9 match)
-
-  #:export (home-mcron-configuration
-            home-mcron-service-type))
-
-;;; Commentary:
-;;
-;; Service for the GNU mcron cron job manager.
-;;
-;; Example configuration, the first job runs mbsync once every ten
-;; minutes, the second one writes "Mcron service" to ~/mcron-file once
-;; every minute.
-;;
-;; (service home-mcron-service-type
-;;            (home-mcron-configuration
-;;             (jobs (list #~(job '(next-minute
-;;                                  (range 0 60 10))
-;;                                (lambda ()
-;;                                  (system* "mbsync" "--all")))
-;;                         #~(job next-minute-from
-;;                                (lambda ()
-;;                                  (call-with-output-file (string-append (getenv "HOME")
-;;                                                                        "/mcron-file")
-;;                                    (lambda (port)
-;;                                      (display "Mcron service" port)))))))))
-;;
-;;; Code:
-
-(define-record-type* <home-mcron-configuration> home-mcron-configuration
-  make-home-mcron-configuration
-  home-mcron-configuration?
-  (package home-mcron-configuration-package ; package
-           (default mcron))
-  (jobs home-mcron-configuration-jobs   ; list of jobs
-        (default '())))
-
-(define job-files (@@ (gnu services mcron) job-files))
-(define shepherd-schedule-action
-  (@@ (gnu services mcron) shepherd-schedule-action))
-
-(define home-mcron-shepherd-services
-  (match-lambda
-    (($ <home-mcron-configuration> mcron '()) ; no jobs to run
-     '())
-    (($ <home-mcron-configuration> mcron jobs)
-     (let ((files (job-files mcron jobs)))
-       (list (shepherd-service
-              (documentation "User cron jobs.")
-              (provision '(mcron))
-              (modules `((srfi srfi-1)
-                         (srfi srfi-26)
-                         (ice-9 popen)            ; for the 'schedule' action
-                         (ice-9 rdelim)
-                         (ice-9 match)
-                         ,@%default-modules))
-              (start #~(make-forkexec-constructor
-                        (list #$(file-append mcron "/bin/mcron") #$@files)
-                        #:log-file (string-append
-                                    (or (getenv "XDG_LOG_HOME")
-                                        (format #f "~a/.local/var/log"
-                                                (getenv "HOME")))
-                                    "/mcron.log")))
-              (stop #~(make-kill-destructor))
-              (actions
-               (list (shepherd-schedule-action mcron files)))))))))
-
-(define home-mcron-profile (compose list home-mcron-configuration-package))
-
-(define (home-mcron-extend config jobs)
-  (home-mcron-configuration
-   (inherit config)
-   (jobs (append (home-mcron-configuration-jobs config)
-                 jobs))))
-
-(define home-mcron-service-type
-  (service-type (name 'home-mcron)
-                (extensions
-                 (list (service-extension
-                        home-shepherd-service-type
-                        home-mcron-shepherd-services)
-                       (service-extension
-                        home-profile-service-type
-                        home-mcron-profile)))
-                (compose concatenate)
-                (extend home-mcron-extend)
-                (default-value (home-mcron-configuration))
-                (description
-                 "Install and configure the GNU mcron cron job manager.")))
diff --git a/gnu/local.mk b/gnu/local.mk
index fb60e6492e..ca4c15ba25 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -75,7 +75,6 @@ GNU_SYSTEM_MODULES =				\
   %D%/ci.scm					\
   %D%/home.scm					\
   %D%/home-services.scm			\
-  %D%/home-services/mcron.scm			\
   %D%/image.scm					\
   %D%/packages.scm				\
   %D%/packages/abduco.scm			\
diff --git a/gnu/services/mcron.scm b/gnu/services/mcron.scm
index 0e675607f3..79639caee4 100644
--- a/gnu/services/mcron.scm
+++ b/gnu/services/mcron.scm
@@ -1,5 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
+;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -19,6 +21,7 @@
 (define-module (gnu services mcron)
   #:use-module (gnu services)
   #:use-module (gnu services shepherd)
+  #:use-module (gnu home-services)
   #:use-module (gnu packages guile-xyz)
   #:use-module (guix deprecation)
   #:use-module (guix records)
@@ -31,7 +34,10 @@
             mcron-configuration-mcron
             mcron-configuration-jobs
 
-            mcron-service-type))
+            mcron-service-type
+
+            home-mcron-configuration
+            home-mcron-service-type))
 
 ;;; Commentary:
 ;;;
@@ -172,4 +178,85 @@ files."
                                          jobs)))))
                 (default-value (mcron-configuration)))) ;empty job list
 
+
+;;;
+;;; Home services
+;;;
+
+;; Service for the GNU mcron cron job manager.
+;;
+;; Example configuration, the first job runs mbsync once every ten
+;; minutes, the second one writes "Mcron service" to ~/mcron-file once
+;; every minute.
+;;
+;; (service home-mcron-service-type
+;;            (home-mcron-configuration
+;;             (jobs (list #~(job '(next-minute
+;;                                  (range 0 60 10))
+;;                                (lambda ()
+;;                                  (system* "mbsync" "--all")))
+;;                         #~(job next-minute-from
+;;                                (lambda ()
+;;                                  (call-with-output-file (string-append (getenv "HOME")
+;;                                                                        "/mcron-file")
+;;                                    (lambda (port)
+;;                                      (display "Mcron service" port)))))))))
+
+(define-record-type* <home-mcron-configuration> home-mcron-configuration
+  make-home-mcron-configuration
+  home-mcron-configuration?
+  (package home-mcron-configuration-package ; package
+           (default mcron))
+  (jobs home-mcron-configuration-jobs   ; list of jobs
+        (default '())))
+
+(define home-mcron-shepherd-services
+  (match-lambda
+    (($ <home-mcron-configuration> mcron '()) ; no jobs to run
+     '())
+    (($ <home-mcron-configuration> mcron jobs)
+     (let ((files (job-files mcron jobs)))
+       (list (shepherd-service
+              (documentation "User cron jobs.")
+              (provision '(mcron))
+              (modules `((srfi srfi-1)
+                         (srfi srfi-26)
+                         (ice-9 popen)            ; for the 'schedule' action
+                         (ice-9 rdelim)
+                         (ice-9 match)
+                         ,@%default-modules))
+              (start #~(make-forkexec-constructor
+                        (list #$(file-append mcron "/bin/mcron") #$@files)
+                        #:log-file (string-append
+                                    (or (getenv "XDG_LOG_HOME")
+                                        (format #f "~a/.local/var/log"
+                                                (getenv "HOME")))
+                                    "/mcron.log")))
+              (stop #~(make-kill-destructor))
+              (actions
+               (list (shepherd-schedule-action mcron files)))))))))
+
+(define home-mcron-profile (compose list home-mcron-configuration-package))
+
+(define (home-mcron-extend config jobs)
+  (home-mcron-configuration
+   (inherit config)
+   (jobs (append (home-mcron-configuration-jobs config)
+                 jobs))))
+
+(define home-mcron-service-type
+  (service-type (name 'home-mcron)
+                (extensions
+                 (list (service-extension
+                        home-shepherd-service-type
+                        home-mcron-shepherd-services)
+                       (service-extension
+                        home-profile-service-type
+                        home-mcron-profile)))
+                (compose concatenate)
+                (extend home-mcron-extend)
+                (default-value (home-mcron-configuration))
+                (description
+                 "Install and configure the GNU mcron cron job manager.")))
+
 ;;; mcron.scm ends here
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 13:48:05 GMT) Full text and rfc822 format available.

Message #32 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 10/12] gnu: home-services: Change %service-type-path and
 filter services.
Date: Sat,  2 Oct 2021 16:46:01 +0300
* gnu/home-services.scm
(%service-type-path): Search home services in "gnu/services".
* gnu/home-services.scm (fold-home-service-types): Filter home services.
---
 gnu/home-services.scm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gnu/home-services.scm b/gnu/home-services.scm
index 9f1e986616..bc4b857715 100644
--- a/gnu/home-services.scm
+++ b/gnu/home-services.scm
@@ -512,7 +512,7 @@ environment, and its configuration file, when available.")))
 
 (define %service-type-path
   ;; Search path for service types.
-  (make-parameter `((,%guix-home-root-directory . "gnu/home-services"))))
+  (make-parameter `((,%guix-home-root-directory . "gnu/services"))))
 
 (define (all-home-service-modules)
   "Return the default set of home-service modules."
@@ -521,4 +521,9 @@ environment, and its configuration file, when available.")))
                      #:warn warn-about-load-error)))
 
 (define* (fold-home-service-types proc seed)
-  (fold-service-types proc seed (all-home-service-modules)))
+  (filter (match-lambda
+            ((service-type . _)
+             (string-prefix? "home-"
+                             (symbol->string
+                              (service-type-name service-type)))))
+          (fold-service-types proc seed (all-home-service-modules))))
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 13:48:05 GMT) Full text and rfc822 format available.

Message #35 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 11/12] scripts: home: (gnu home-services bash) -> (gnu
 services bash).
Date: Sat,  2 Oct 2021 16:46:02 +0300
* guix/scripts/home/import.scm: Replace (gnu home-services bash) with
(gnu services bash).
---
 guix/scripts/home/import.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm
index 79fb23a2fd..98dcdea388 100644
--- a/guix/scripts/home/import.scm
+++ b/guix/scripts/home/import.scm
@@ -41,7 +41,7 @@
   (let ((rc (string-append (getenv "HOME") "/.bashrc"))
         (profile (string-append (getenv "HOME") "/.bash_profile"))
         (logout (string-append (getenv "HOME") "/.bash_logout")))
-    `((gnu home-services bash)
+    `((gnu services bash)
       (service home-bash-service-type
                  (home-bash-configuration
                   ,@(if (file-exists? rc)
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 13:48:06 GMT) Full text and rfc822 format available.

Message #38 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 12/12] doc: (gnu home-services) -> (gnu services).
Date: Sat,  2 Oct 2021 16:46:03 +0300
* doc/guix.texi: Replace (gnu home-services) with (gnu services).
---
 doc/guix.texi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index d06590ab8c..a647ea150a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -35555,9 +35555,9 @@ services)}.
 
 @node Essential Home Services
 @subsection Essential Home Services
-There are a few essential services defined in @code{(gnu
-home-services)}, they are mostly for internal use and are required to
-build a home environment, but some of them will be useful for the end
+There are a few essential home services defined in
+@code{(gnu services)}, they are mostly for internal use and are required
+to build a home environment, but some of them will be useful for the end
 user.
 
 @cindex environment variables
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 13:48:06 GMT) Full text and rfc822 format available.

Message #41 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 08/12] gnu: home-services: Move shepherd to (gnu services).
Date: Sat,  2 Oct 2021 16:45:59 +0300
* gnu/home-services/shepherd.scm: Move content ...
* gnu/services/shepherd.scm: ... here.
* gnu/local.mk: Delete gnu/home-services/shepherd.scm.
* gnu/home-services/mcron.scm: Replace (gnu home-services shepherd) with
(gnu services shepherd).
* tests/guix-home.sh: Same.
---
 gnu/home-services/mcron.scm    |   2 +-
 gnu/home-services/shepherd.scm | 134 ---------------------------------
 gnu/local.mk                   |   1 -
 gnu/services/shepherd.scm      | 112 ++++++++++++++++++++++++++-
 tests/guix-home.sh             |   2 +-
 5 files changed, 113 insertions(+), 138 deletions(-)
 delete mode 100644 gnu/home-services/shepherd.scm

diff --git a/gnu/home-services/mcron.scm b/gnu/home-services/mcron.scm
index fdfde179a5..a4e09f509c 100644
--- a/gnu/home-services/mcron.scm
+++ b/gnu/home-services/mcron.scm
@@ -20,7 +20,7 @@
 (define-module (gnu home-services mcron)
   #:use-module (gnu packages guile-xyz)
   #:use-module (gnu home-services)
-  #:use-module (gnu home-services shepherd)
+  #:use-module (gnu services shepherd)
   #:use-module (gnu services shepherd)
   #:use-module (guix records)
   #:use-module (guix gexp)
diff --git a/gnu/home-services/shepherd.scm b/gnu/home-services/shepherd.scm
deleted file mode 100644
index 120cfde1a1..0000000000
--- a/gnu/home-services/shepherd.scm
+++ /dev/null
@@ -1,134 +0,0 @@
-;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
-;;; Copyright © 2021 Xinglu Chen <public <at> 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 shepherd)
-  #:use-module (gnu home-services)
-  #:use-module (gnu packages admin)
-  #:use-module (gnu services shepherd)
-  #:use-module (guix sets)
-  #:use-module (guix gexp)
-  #:use-module (guix records)
-
-  #:use-module (srfi srfi-1)
-
-  #:export (home-shepherd-service-type
-            home-shepherd-configuration)
-  #:re-export (shepherd-service
-               shepherd-action))
-
-(define-record-type* <home-shepherd-configuration>
-  home-shepherd-configuration make-home-shepherd-configuration
-  home-shepherd-configuration?
-  (shepherd home-shepherd-configuration-shepherd
-            (default shepherd)) ; package
-  (auto-start? home-shepherd-configuration-auto-start?
-               (default #t))
-  (services home-shepherd-configuration-services
-            (default '())))
-
-(define (home-shepherd-configuration-file services shepherd)
-  "Return the shepherd configuration file for SERVICES.  SHEPHERD is used
-as shepherd package."
-  (assert-valid-graph services)
-
-  (let ((files (map shepherd-service-file services))
-        ;; TODO: Add compilation of services, it can improve start
-        ;; time.
-        ;; (scm->go (cute scm->go <> shepherd))
-        )
-    (define config
-      #~(begin
-          (use-modules (srfi srfi-34)
-                       (system repl error-handling))
-          (apply
-           register-services
-           (map
-            (lambda (file) (load file))
-            '#$files))
-          (action 'root 'daemonize)
-          (format #t "Starting services...~%")
-          (for-each
-           (lambda (service) (start service))
-           '#$(append-map shepherd-service-provision
-                          (filter shepherd-service-auto-start?
-                                  services)))
-          (newline)))
-
-    (scheme-file "shepherd.conf" config)))
-
-(define (launch-shepherd-gexp config)
-  (let* ((shepherd (home-shepherd-configuration-shepherd config))
-         (services (home-shepherd-configuration-services config)))
-    (if (home-shepherd-configuration-auto-start? config)
-        (with-imported-modules '((guix build utils))
-          #~(let ((log-dir (or (getenv "XDG_LOG_HOME")
-                               (format #f "~a/.local/var/log" (getenv "HOME")))))
-              ((@ (guix build utils) mkdir-p) log-dir)
-              (system*
-               #$(file-append shepherd "/bin/shepherd")
-               "--logfile"
-               (string-append
-                log-dir
-                "/shepherd.log")
-               "--config"
-               #$(home-shepherd-configuration-file services shepherd))))
-        #~"")))
-
-(define (reload-configuration-gexp config)
-  (let* ((shepherd (home-shepherd-configuration-shepherd config))
-         (services (home-shepherd-configuration-services config)))
-    #~(system*
-       #$(file-append shepherd "/bin/herd")
-       "load" "root"
-       #$(home-shepherd-configuration-file services shepherd))))
-
-(define (ensure-shepherd-gexp config)
-  #~(if (file-exists?
-         (string-append
-          (or (getenv "XDG_RUNTIME_DIR")
-              (format #f "/run/user/~a" (getuid)))
-          "/shepherd/socket"))
-        #$(reload-configuration-gexp config)
-        #$(launch-shepherd-gexp config)))
-
-(define-public home-shepherd-service-type
-  (service-type (name 'home-shepherd)
-                (extensions
-                 (list (service-extension
-                        home-run-on-first-login-service-type
-                        launch-shepherd-gexp)
-                       (service-extension
-                        home-activation-service-type
-                        ensure-shepherd-gexp)
-                       (service-extension
-                        home-profile-service-type
-                        (lambda (config)
-                          `(,(home-shepherd-configuration-shepherd config))))))
-                (compose concatenate)
-                (extend
-                 (lambda (config extra-services)
-                   (home-shepherd-configuration
-                    (inherit config)
-                    (services
-                     (append (home-shepherd-configuration-services config)
-                             extra-services)))))
-                (default-value (home-shepherd-configuration))
-                (description "Configure and install userland Shepherd.")))
-
-
diff --git a/gnu/local.mk b/gnu/local.mk
index 97ff893bf7..fb60e6492e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -75,7 +75,6 @@ GNU_SYSTEM_MODULES =				\
   %D%/ci.scm					\
   %D%/home.scm					\
   %D%/home-services.scm			\
-  %D%/home-services/shepherd.scm		\
   %D%/home-services/mcron.scm			\
   %D%/image.scm					\
   %D%/packages.scm				\
diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index 7277273686..46c80472dc 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -4,6 +4,8 @@
 ;;; Copyright © 2018 Carlo Zancanaro <carlo <at> zancanaro.id.au>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2021 Maxime Devos <maximedevos <at> telenet.be>
+;;; Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
+;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -28,6 +30,7 @@
   #:use-module (guix records)
   #:use-module (guix derivations)                 ;imported-modules, etc.
   #:use-module (guix utils)
+  #:use-module (gnu home-services)
   #:use-module (gnu services)
   #:use-module (gnu services herd)
   #:use-module (gnu packages admin)
@@ -75,7 +78,10 @@
 
             user-processes-service-type
 
-            assert-valid-graph))
+            assert-valid-graph
+
+            home-shepherd-service-type
+            home-shepherd-configuration))
 
 ;;; Commentary:
 ;;;
@@ -590,4 +596,108 @@ read-only, just before rebooting/halting.  Processes still running after a few
 seconds after @code{SIGTERM} has been sent are terminated with
 @code{SIGKILL}.")))
 
+
+;;;
+;;; Home services
+;;;
+
+(define-record-type* <home-shepherd-configuration>
+  home-shepherd-configuration make-home-shepherd-configuration
+  home-shepherd-configuration?
+  (shepherd home-shepherd-configuration-shepherd
+            (default shepherd)) ; package
+  (auto-start? home-shepherd-configuration-auto-start?
+               (default #t))
+  (services home-shepherd-configuration-services
+            (default '())))
+
+(define (home-shepherd-configuration-file services shepherd)
+  "Return the shepherd configuration file for SERVICES.  SHEPHERD is used
+as shepherd package."
+  (assert-valid-graph services)
+
+  (let ((files (map shepherd-service-file services))
+        ;; TODO: Add compilation of services, it can improve start
+        ;; time.
+        ;; (scm->go (cute scm->go <> shepherd))
+        )
+    (define config
+      #~(begin
+          (use-modules (srfi srfi-34)
+                       (system repl error-handling))
+          (apply
+           register-services
+           (map
+            (lambda (file) (load file))
+            '#$files))
+          (action 'root 'daemonize)
+          (format #t "Starting services...~%")
+          (for-each
+           (lambda (service) (start service))
+           '#$(append-map shepherd-service-provision
+                          (filter shepherd-service-auto-start?
+                                  services)))
+          (newline)))
+
+    (scheme-file "shepherd.conf" config)))
+
+(define (launch-shepherd-gexp config)
+  (let* ((shepherd (home-shepherd-configuration-shepherd config))
+         (services (home-shepherd-configuration-services config)))
+    (if (home-shepherd-configuration-auto-start? config)
+        (with-imported-modules '((guix build utils))
+          #~(let ((log-dir (or (getenv "XDG_LOG_HOME")
+                               (format #f "~a/.local/var/log" (getenv "HOME")))))
+              ((@ (guix build utils) mkdir-p) log-dir)
+              (system*
+               #$(file-append shepherd "/bin/shepherd")
+               "--logfile"
+               (string-append
+                log-dir
+                "/shepherd.log")
+               "--config"
+               #$(home-shepherd-configuration-file services shepherd))))
+        #~"")))
+
+(define (reload-configuration-gexp config)
+  (let* ((shepherd (home-shepherd-configuration-shepherd config))
+         (services (home-shepherd-configuration-services config)))
+    #~(system*
+       #$(file-append shepherd "/bin/herd")
+       "load" "root"
+       #$(home-shepherd-configuration-file services shepherd))))
+
+(define (ensure-shepherd-gexp config)
+  #~(if (file-exists?
+         (string-append
+          (or (getenv "XDG_RUNTIME_DIR")
+              (format #f "/run/user/~a" (getuid)))
+          "/shepherd/socket"))
+        #$(reload-configuration-gexp config)
+        #$(launch-shepherd-gexp config)))
+
+(define-public home-shepherd-service-type
+  (service-type (name 'home-shepherd)
+                (extensions
+                 (list (service-extension
+                        home-run-on-first-login-service-type
+                        launch-shepherd-gexp)
+                       (service-extension
+                        home-activation-service-type
+                        ensure-shepherd-gexp)
+                       (service-extension
+                        home-profile-service-type
+                        (lambda (config)
+                          `(,(home-shepherd-configuration-shepherd config))))))
+                (compose concatenate)
+                (extend
+                 (lambda (config extra-services)
+                   (home-shepherd-configuration
+                    (inherit config)
+                    (services
+                     (append (home-shepherd-configuration-services config)
+                             extra-services)))))
+                (default-value (home-shepherd-configuration))
+                (description "Configure and install userland Shepherd.")))
+
 ;;; shepherd.scm ends here
diff --git a/tests/guix-home.sh b/tests/guix-home.sh
index cb015c907f..46cd779c81 100644
--- a/tests/guix-home.sh
+++ b/tests/guix-home.sh
@@ -75,7 +75,7 @@ fi
 
 cat > "$tmpfile" <<EOF
 (use-modules (gnu))
-(use-modules (gnu home-services shepherd))
+(use-modules (gnu services shepherd))
 
 (home-environment
   (services (list (service home-shepherd-service-type)
-- 
2.33.0





Reply sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
You have taken responsibility. (Sat, 02 Oct 2021 16:38:02 GMT) Full text and rfc822 format available.

Notification sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
bug acknowledged by developer. (Sat, 02 Oct 2021 16:38:03 GMT) Full text and rfc822 format available.

Message #46 received at 50967-done <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Xinglu Chen <public <at> yoctocell.xyz>, 50967-done <at> debbugs.gnu.org,
 Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH 00/14] (gnu home services), file-like objects,
 guix home import documentation
Date: Sat,  2 Oct 2021 19:37:16 +0300
This patch series is a replacement for https://issues.guix.gnu.org/50967

* Moves every home service to (gnu home services).

* Adds support for file-like objects in configuration.scm, e.g. the following
  will work now:

(home-environment
 (services
  (list
   (service home-bash-service-type
            (home-bash-configuration
             (bashrc
              (list
               (local-file .bashrc))))))))

* Documents guix home import.

Andrew Tropin (1):
  tests: Add tests for guix home cli.

Oleg Pykhalov (13):
  gnu: home-services: Move configuration to (gnu home services).
  gnu: home-services: Move symlink-manager to (gnu home services).
  gnu: home-services: Move utils to (gnu home services).
  gnu: home-services: Move fontutils to (gnu services).
  gnu: home-services: Move shells to (gnu home services).
  gnu: home-services: Move xdg to (gnu home services).
  gnu: home-services: Move shepherd to (gnu home services).
  gnu: home-services: Move mcron to (gnu home services).
  scripts: home: (gnu home-services bash) -> (gnu home services bash).
  doc: (gnu home-services) -> (gnu home services).
  gnu: home-services: Update %service-type-path.
  home: services: configuration: Support file-like objects.
  doc: Document guix home import.

 Makefile.am                                   |  1 +
 doc/guix.texi                                 | 12 ++-
 doc/he-config-bare-bones.scm                  |  2 +-
 gnu/home-services.scm                         |  4 +-
 gnu/home.scm                                  |  8 +-
 .../services}/configuration.scm               | 16 ++-
 .../services}/fontutils.scm                   |  2 +-
 .../services}/mcron.scm                       |  4 +-
 .../services}/shells.scm                      |  6 +-
 .../services}/shepherd.scm                    |  2 +-
 .../services}/symlink-manager.scm             |  2 +-
 .../services}/utils.scm                       |  2 +-
 gnu/{home-services => home/services}/xdg.scm  |  6 +-
 gnu/local.mk                                  | 16 +--
 guix/scripts/home/import.scm                  | 10 +-
 tests/guix-home.sh                            | 99 +++++++++++++++++++
 16 files changed, 150 insertions(+), 42 deletions(-)
 rename gnu/{home-services => home/services}/configuration.scm (86%)
 rename gnu/{home-services => home/services}/fontutils.scm (98%)
 rename gnu/{home-services => home/services}/mcron.scm (98%)
 rename gnu/{home-services => home/services}/shells.scm (99%)
 rename gnu/{home-services => home/services}/shepherd.scm (99%)
 rename gnu/{home-services => home/services}/symlink-manager.scm (99%)
 rename gnu/{home-services => home/services}/utils.scm (98%)
 rename gnu/{home-services => home/services}/xdg.scm (99%)
 create mode 100644 tests/guix-home.sh


base-commit: 159b94cfb526e8695ae159ae29edc608b7a29bef
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 16:40:01 GMT) Full text and rfc822 format available.

Message #49 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH 01/14] tests: Add tests for guix home cli.
Date: Sat,  2 Oct 2021 19:38:21 +0300
From: Andrew Tropin <andrew <at> trop.in>

* tests/guix-home.sh: New file.
* Makefile.am (SH_TESTS): Add tests/guix-home.sh.

Signed-off-by: Oleg Pykhalov <go.wigust <at> gmail.com>
---
 Makefile.am        |  1 +
 tests/guix-home.sh | 99 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 100 insertions(+)
 create mode 100644 tests/guix-home.sh

diff --git a/Makefile.am b/Makefile.am
index b66789fa0b..5bf2567dc8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -546,6 +546,7 @@ SH_TESTS =					\
   tests/guix-package-aliases.sh			\
   tests/guix-package-net.sh			\
   tests/guix-system.sh				\
+  tests/guix-home.sh				\
   tests/guix-archive.sh				\
   tests/guix-authenticate.sh			\
   tests/guix-environment.sh			\
diff --git a/tests/guix-home.sh b/tests/guix-home.sh
new file mode 100644
index 0000000000..cb015c907f
--- /dev/null
+++ b/tests/guix-home.sh
@@ -0,0 +1,99 @@
+# GNU Guix --- Functional package management for GNU
+# Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
+#
+# 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/>.
+
+#
+# Test 'guix home' cli.
+#
+
+set -e
+
+guix home --version
+
+tmpfile="t-guix-home-$$"
+errorfile="t-guix-home-error-$$"
+
+# Note: This directory is chosen outside $builddir so that relative file name
+# canonicalization doesn't mess up with 'current-source-directory', used by
+# 'local-file' ('load' forces 'relative' for
+# %FILE-PORT-NAME-CANONICALIZATION.)
+tmpdir="${TMPDIR:-/tmp}/t-guix-home-$$"
+mkdir "$tmpdir"
+
+trap 'rm -f "$tmpfile" "$errorfile" "$tmpdir"/*; rmdir "$tmpdir"' EXIT
+
+# Reporting of syntax errors.
+
+cat > "$tmpfile"<<EOF
+;; This is line 1, and the next one is line 2.
+   (home-environment
+    (packages))
+;; The 'T' is at column 3.
+EOF
+
+if guix home build "$tmpfile" 2> "$errorfile"
+then
+    # This must not succeed.
+    exit 1
+else
+    grep "$tmpfile:3:4: error: (packages): invalid field specifier" "$errorfile"
+fi
+
+
+cat > "$tmpfile"<<EOF
+;; This is line 1, and the next one is line 2.
+   (home-environment
+;; This is line 3, and there is no closing paren!
+EOF
+
+if guix home build "$tmpfile" 2> "$errorfile"
+then
+    # This must not succeed.
+    exit 1
+else
+    # Guile 3.0.6 gets line/column numbers for 'read-error' wrong
+    # (zero-indexed): <https://bugs.gnu.org/48089>.
+    grep "$tmpfile:4:1: missing closing paren" "$errorfile" || \
+    grep "$tmpfile:3:0: missing closing paren" "$errorfile"
+fi
+
+# Reporting of duplicate system service declaration.
+
+cat > "$tmpfile" <<EOF
+(use-modules (gnu))
+(use-modules (gnu home-services shepherd))
+
+(home-environment
+  (services (list (service home-shepherd-service-type)
+                  (simple-service 'test-shepherd-extension
+                   home-shepherd-service-type '())
+                  (service home-shepherd-service-type)
+                  (service home-shepherd-service-type))))
+EOF
+
+if guix home build "$tmpfile" 2> "$errorfile"
+then
+    # This must not succeed.
+    exit 1
+else
+    grep "guix home: error: more than one target service of type 'home-shepherd'" "$errorfile"
+fi
+
+# Searching.
+
+guix home search mcron | grep "^name: home-mcron"
+guix home search job manager | grep "^name: home-mcron"
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 16:40:02 GMT) Full text and rfc822 format available.

Message #52 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 02/14] gnu: home-services: Move configuration to (gnu home
 services).
Date: Sat,  2 Oct 2021 19:38:22 +0300
* gnu/home-services/configuration.scm: Move the content ...
* gnu/home/services/configuration.scm: ... here.
* gnu/local.mk (GNU_SYSTEM_MODULES): Same.
* gnu/home-services/shells.scm: Replace (gnu home-services configuration)
with (gnu home services configuration).
* gnu/home-services/xdg.scm: Same.
---
 gnu/home-services/shells.scm                           | 2 +-
 gnu/home-services/xdg.scm                              | 2 +-
 gnu/{home-services => home/services}/configuration.scm | 2 +-
 gnu/local.mk                                           | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
 rename gnu/{home-services => home/services}/configuration.scm (98%)

diff --git a/gnu/home-services/shells.scm b/gnu/home-services/shells.scm
index ecb02098f7..2be35ac56e 100644
--- a/gnu/home-services/shells.scm
+++ b/gnu/home-services/shells.scm
@@ -19,7 +19,7 @@
 
 (define-module (gnu home-services shells)
   #:use-module (gnu services configuration)
-  #:use-module (gnu home-services configuration)
+  #:use-module (gnu home services configuration)
   #:use-module (gnu home-services utils)
   #:use-module (gnu home-services)
   #:use-module (gnu packages shells)
diff --git a/gnu/home-services/xdg.scm b/gnu/home-services/xdg.scm
index 94275f3b65..07b25e9e12 100644
--- a/gnu/home-services/xdg.scm
+++ b/gnu/home-services/xdg.scm
@@ -19,7 +19,7 @@
 
 (define-module (gnu home-services xdg)
   #:use-module (gnu services configuration)
-  #:use-module (gnu home-services configuration)
+  #:use-module (gnu home services configuration)
   #:use-module (gnu home-services)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu home-services utils)
diff --git a/gnu/home-services/configuration.scm b/gnu/home/services/configuration.scm
similarity index 98%
rename from gnu/home-services/configuration.scm
rename to gnu/home/services/configuration.scm
index e8f4bc77ec..5e7743e7d6 100644
--- a/gnu/home-services/configuration.scm
+++ b/gnu/home/services/configuration.scm
@@ -17,7 +17,7 @@
 ;;; 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 configuration)
+(define-module (gnu home services configuration)
   #:use-module (gnu services configuration)
   #:use-module (guix gexp)
   #:use-module (srfi srfi-1)
diff --git a/gnu/local.mk b/gnu/local.mk
index d415b892e9..ac0b8947d5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -77,7 +77,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/home-services.scm			\
   %D%/home-services/symlink-manager.scm	\
   %D%/home-services/fontutils.scm		\
-  %D%/home-services/configuration.scm		\
+  %D%/home/services/configuration.scm		\
   %D%/home-services/shells.scm			\
   %D%/home-services/shepherd.scm		\
   %D%/home-services/mcron.scm			\
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 16:40:02 GMT) Full text and rfc822 format available.

Message #55 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 03/14] gnu: home-services: Move symlink-manager to (gnu home
 services).
Date: Sat,  2 Oct 2021 19:38:23 +0300
* gnu/home-services/symlink-manager.scm: Rename to
gnu/home/services/symlink-manager.scm.
* gnu/local.mk: Same.
* gnu/home.scm: Replace (gnu home-services symlink-manager) with
(gnu home services symlink-manager).
---
 gnu/home.scm                                             | 2 +-
 gnu/{home-services => home/services}/symlink-manager.scm | 2 +-
 gnu/local.mk                                             | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename gnu/{home-services => home/services}/symlink-manager.scm (99%)

diff --git a/gnu/home.scm b/gnu/home.scm
index f4c9359e25..c981c5aef9 100644
--- a/gnu/home.scm
+++ b/gnu/home.scm
@@ -18,7 +18,7 @@
 
 (define-module (gnu home)
   #:use-module (gnu home-services)
-  #:use-module (gnu home-services symlink-manager)
+  #:use-module (gnu home services symlink-manager)
   #:use-module (gnu home-services shells)
   #:use-module (gnu home-services xdg)
   #:use-module (gnu home-services fontutils)
diff --git a/gnu/home-services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
similarity index 99%
rename from gnu/home-services/symlink-manager.scm
rename to gnu/home/services/symlink-manager.scm
index 11f5d503d4..d53e8f5046 100644
--- a/gnu/home-services/symlink-manager.scm
+++ b/gnu/home/services/symlink-manager.scm
@@ -17,7 +17,7 @@
 ;;; 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 symlink-manager)
+(define-module (gnu home services symlink-manager)
   #:use-module (gnu home-services)
   #:use-module (guix gexp)
 
diff --git a/gnu/local.mk b/gnu/local.mk
index ac0b8947d5..29dd4ae5b5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -75,7 +75,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/ci.scm					\
   %D%/home.scm					\
   %D%/home-services.scm			\
-  %D%/home-services/symlink-manager.scm	\
+  %D%/home/services/symlink-manager.scm		\
   %D%/home-services/fontutils.scm		\
   %D%/home/services/configuration.scm		\
   %D%/home-services/shells.scm			\
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 16:40:03 GMT) Full text and rfc822 format available.

Message #58 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 04/14] gnu: home-services: Move utils to (gnu home services).
Date: Sat,  2 Oct 2021 19:38:24 +0300
* gnu/home-services/utils.scm: Rename to gnu/home/services/utils.scm.
* gnu/local.mk: Same.
* gnu/home-services/shells.scm: Replace (gnu home-services utils) with
(gnu home services utils)
* gnu/home-services/xdg.scm: Same.
---
 gnu/home-services/shells.scm                   | 2 +-
 gnu/home-services/xdg.scm                      | 2 +-
 gnu/{home-services => home/services}/utils.scm | 2 +-
 gnu/local.mk                                   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
 rename gnu/{home-services => home/services}/utils.scm (98%)

diff --git a/gnu/home-services/shells.scm b/gnu/home-services/shells.scm
index 2be35ac56e..4939f86b2c 100644
--- a/gnu/home-services/shells.scm
+++ b/gnu/home-services/shells.scm
@@ -20,7 +20,7 @@
 (define-module (gnu home-services shells)
   #:use-module (gnu services configuration)
   #:use-module (gnu home services configuration)
-  #:use-module (gnu home-services utils)
+  #:use-module (gnu home services utils)
   #:use-module (gnu home-services)
   #:use-module (gnu packages shells)
   #:use-module (gnu packages bash)
diff --git a/gnu/home-services/xdg.scm b/gnu/home-services/xdg.scm
index 07b25e9e12..7f91da9ece 100644
--- a/gnu/home-services/xdg.scm
+++ b/gnu/home-services/xdg.scm
@@ -22,7 +22,7 @@
   #:use-module (gnu home services configuration)
   #:use-module (gnu home-services)
   #:use-module (gnu packages freedesktop)
-  #:use-module (gnu home-services utils)
+  #:use-module (gnu home services utils)
   #:use-module (guix gexp)
   #:use-module (guix records)
   #:use-module (guix i18n)
diff --git a/gnu/home-services/utils.scm b/gnu/home/services/utils.scm
similarity index 98%
rename from gnu/home-services/utils.scm
rename to gnu/home/services/utils.scm
index f13133a7ae..cea75ee896 100644
--- a/gnu/home-services/utils.scm
+++ b/gnu/home/services/utils.scm
@@ -17,7 +17,7 @@
 ;;; 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 utils)
+(define-module (gnu home services utils)
   #:use-module (ice-9 string-fun)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
diff --git a/gnu/local.mk b/gnu/local.mk
index 29dd4ae5b5..729cfda100 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -81,7 +81,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/home-services/shells.scm			\
   %D%/home-services/shepherd.scm		\
   %D%/home-services/mcron.scm			\
-  %D%/home-services/utils.scm			\
+  %D%/home/services/utils.scm			\
   %D%/home-services/xdg.scm			\
   %D%/image.scm					\
   %D%/packages.scm				\
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 16:40:03 GMT) Full text and rfc822 format available.

Message #61 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 05/14] gnu: home-services: Move fontutils to (gnu services).
Date: Sat,  2 Oct 2021 19:38:25 +0300
* gnu/home-services/fontutils.scm: Rename to gnu/services/fontutils.scm.
* gnu/local.mk: Same.
* gnu/home.scm: Replace (gnu home-services fontutils) with
(gnu services fontutils).
---
 gnu/home.scm                                       | 2 +-
 gnu/{home-services => home/services}/fontutils.scm | 2 +-
 gnu/local.mk                                       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename gnu/{home-services => home/services}/fontutils.scm (98%)

diff --git a/gnu/home.scm b/gnu/home.scm
index c981c5aef9..5591d12704 100644
--- a/gnu/home.scm
+++ b/gnu/home.scm
@@ -21,7 +21,7 @@
   #:use-module (gnu home services symlink-manager)
   #:use-module (gnu home-services shells)
   #:use-module (gnu home-services xdg)
-  #:use-module (gnu home-services fontutils)
+  #:use-module (gnu home services fontutils)
   #:use-module (gnu services)
   #:use-module (guix records)
   #:use-module (guix diagnostics)
diff --git a/gnu/home-services/fontutils.scm b/gnu/home/services/fontutils.scm
similarity index 98%
rename from gnu/home-services/fontutils.scm
rename to gnu/home/services/fontutils.scm
index 28bfc3d3f7..72a84fdecd 100644
--- a/gnu/home-services/fontutils.scm
+++ b/gnu/home/services/fontutils.scm
@@ -17,7 +17,7 @@
 ;;; 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)
+(define-module (gnu home services fontutils)
   #:use-module (gnu home-services)
   #:use-module (gnu packages fontutils)
   #:use-module (guix gexp)
diff --git a/gnu/local.mk b/gnu/local.mk
index 729cfda100..dbc4221937 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -76,7 +76,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/home.scm					\
   %D%/home-services.scm			\
   %D%/home/services/symlink-manager.scm		\
-  %D%/home-services/fontutils.scm		\
+  %D%/home/services/fontutils.scm		\
   %D%/home/services/configuration.scm		\
   %D%/home-services/shells.scm			\
   %D%/home-services/shepherd.scm		\
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 16:40:03 GMT) Full text and rfc822 format available.

Message #64 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 06/14] gnu: home-services: Move shells to (gnu home services).
Date: Sat,  2 Oct 2021 19:38:26 +0300
* gnu/home-services/shells.scm: Rename to gnu/home/services/shells.scm.
* gnu/local.mk: Same.
* gnu/home.scm: Replace (gnu home-services shells) with (gnu home services shells).
* doc/he-config-bare-bones.scm: Same.
---
 doc/he-config-bare-bones.scm                    | 2 +-
 gnu/home.scm                                    | 2 +-
 gnu/{home-services => home/services}/shells.scm | 2 +-
 gnu/local.mk                                    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
 rename gnu/{home-services => home/services}/shells.scm (99%)

diff --git a/doc/he-config-bare-bones.scm b/doc/he-config-bare-bones.scm
index 01be46a7b0..1faf75b871 100644
--- a/doc/he-config-bare-bones.scm
+++ b/doc/he-config-bare-bones.scm
@@ -1,6 +1,6 @@
 (use-modules (gnu home)
              (gnu home-services)
-             (gnu home-services shells)
+             (gnu home services shells)
              (gnu services)
              (gnu packages admin)
              (guix gexp))
diff --git a/gnu/home.scm b/gnu/home.scm
index 5591d12704..c0d4c71d51 100644
--- a/gnu/home.scm
+++ b/gnu/home.scm
@@ -19,7 +19,7 @@
 (define-module (gnu home)
   #:use-module (gnu home-services)
   #:use-module (gnu home services symlink-manager)
-  #:use-module (gnu home-services shells)
+  #:use-module (gnu home services shells)
   #:use-module (gnu home-services xdg)
   #:use-module (gnu home services fontutils)
   #:use-module (gnu services)
diff --git a/gnu/home-services/shells.scm b/gnu/home/services/shells.scm
similarity index 99%
rename from gnu/home-services/shells.scm
rename to gnu/home/services/shells.scm
index 4939f86b2c..2308371dd0 100644
--- a/gnu/home-services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -17,7 +17,7 @@
 ;;; 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 shells)
+(define-module (gnu home services shells)
   #:use-module (gnu services configuration)
   #:use-module (gnu home services configuration)
   #:use-module (gnu home services utils)
diff --git a/gnu/local.mk b/gnu/local.mk
index dbc4221937..2e48a70130 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -78,7 +78,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/home/services/symlink-manager.scm		\
   %D%/home/services/fontutils.scm		\
   %D%/home/services/configuration.scm		\
-  %D%/home-services/shells.scm			\
+  %D%/home/services/shells.scm			\
   %D%/home-services/shepherd.scm		\
   %D%/home-services/mcron.scm			\
   %D%/home/services/utils.scm			\
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 16:40:04 GMT) Full text and rfc822 format available.

Message #67 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 07/14] gnu: home-services: Move xdg to (gnu home services).
Date: Sat,  2 Oct 2021 19:38:27 +0300
* gnu/home-services/xdg.scm: Rename to gnu/home/services/xdg.scm.
* gnu/local.mk: Same.
* gnu/home.scm: Replace (gnu home-services xdg) with (gnu home services xdg).
---
 gnu/home.scm                                 | 2 +-
 gnu/{home-services => home/services}/xdg.scm | 2 +-
 gnu/local.mk                                 | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename gnu/{home-services => home/services}/xdg.scm (99%)

diff --git a/gnu/home.scm b/gnu/home.scm
index c0d4c71d51..5ac382dc5a 100644
--- a/gnu/home.scm
+++ b/gnu/home.scm
@@ -20,7 +20,7 @@
   #:use-module (gnu home-services)
   #:use-module (gnu home services symlink-manager)
   #:use-module (gnu home services shells)
-  #:use-module (gnu home-services xdg)
+  #:use-module (gnu home services xdg)
   #:use-module (gnu home services fontutils)
   #:use-module (gnu services)
   #:use-module (guix records)
diff --git a/gnu/home-services/xdg.scm b/gnu/home/services/xdg.scm
similarity index 99%
rename from gnu/home-services/xdg.scm
rename to gnu/home/services/xdg.scm
index 7f91da9ece..4aed9a5803 100644
--- a/gnu/home-services/xdg.scm
+++ b/gnu/home/services/xdg.scm
@@ -17,7 +17,7 @@
 ;;; 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 xdg)
+(define-module (gnu home services xdg)
   #:use-module (gnu services configuration)
   #:use-module (gnu home services configuration)
   #:use-module (gnu home-services)
diff --git a/gnu/local.mk b/gnu/local.mk
index 2e48a70130..78ca4688e3 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -82,7 +82,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/home-services/shepherd.scm		\
   %D%/home-services/mcron.scm			\
   %D%/home/services/utils.scm			\
-  %D%/home-services/xdg.scm			\
+  %D%/home/services/xdg.scm			\
   %D%/image.scm					\
   %D%/packages.scm				\
   %D%/packages/abduco.scm			\
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 16:40:04 GMT) Full text and rfc822 format available.

Message #70 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 08/14] gnu: home-services: Move shepherd to (gnu home
 services).
Date: Sat,  2 Oct 2021 19:38:28 +0300
* gnu/home-services/shepherd.scm: Move to gnu/home/services/shepherd.scm.
* gnu/local.mk: Same.
* gnu/home-services/mcron.scm: Replace (gnu home-services shepherd) with
(gnu home services shepherd).
* tests/guix-home.sh: Same.
---
 gnu/home-services/mcron.scm                       | 2 +-
 gnu/{home-services => home/services}/shepherd.scm | 2 +-
 gnu/local.mk                                      | 2 +-
 tests/guix-home.sh                                | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
 rename gnu/{home-services => home/services}/shepherd.scm (99%)

diff --git a/gnu/home-services/mcron.scm b/gnu/home-services/mcron.scm
index fdfde179a5..fb044351a9 100644
--- a/gnu/home-services/mcron.scm
+++ b/gnu/home-services/mcron.scm
@@ -20,8 +20,8 @@
 (define-module (gnu home-services mcron)
   #:use-module (gnu packages guile-xyz)
   #:use-module (gnu home-services)
-  #:use-module (gnu home-services shepherd)
   #:use-module (gnu services shepherd)
+  #:use-module (gnu home services shepherd)
   #:use-module (guix records)
   #:use-module (guix gexp)
   #:use-module (srfi srfi-1)
diff --git a/gnu/home-services/shepherd.scm b/gnu/home/services/shepherd.scm
similarity index 99%
rename from gnu/home-services/shepherd.scm
rename to gnu/home/services/shepherd.scm
index 120cfde1a1..1a3e849bb2 100644
--- a/gnu/home-services/shepherd.scm
+++ b/gnu/home/services/shepherd.scm
@@ -17,7 +17,7 @@
 ;;; 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 shepherd)
+(define-module (gnu home services shepherd)
   #:use-module (gnu home-services)
   #:use-module (gnu packages admin)
   #:use-module (gnu services shepherd)
diff --git a/gnu/local.mk b/gnu/local.mk
index 78ca4688e3..5e3722a2d8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -79,7 +79,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/home/services/fontutils.scm		\
   %D%/home/services/configuration.scm		\
   %D%/home/services/shells.scm			\
-  %D%/home-services/shepherd.scm		\
+  %D%/home/services/shepherd.scm		\
   %D%/home-services/mcron.scm			\
   %D%/home/services/utils.scm			\
   %D%/home/services/xdg.scm			\
diff --git a/tests/guix-home.sh b/tests/guix-home.sh
index cb015c907f..86ba42bb8b 100644
--- a/tests/guix-home.sh
+++ b/tests/guix-home.sh
@@ -75,7 +75,7 @@ fi
 
 cat > "$tmpfile" <<EOF
 (use-modules (gnu))
-(use-modules (gnu home-services shepherd))
+(use-modules (gnu home services shepherd))
 
 (home-environment
   (services (list (service home-shepherd-service-type)
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 16:40:05 GMT) Full text and rfc822 format available.

Message #73 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 09/14] gnu: home-services: Move mcron to (gnu home services).
Date: Sat,  2 Oct 2021 19:38:29 +0300
* gnu/home-services/mcron.scm: Move to gnu/home/services/mcron.scm.
* gnu/local.mk: Same.
* doc/guix.texi: Replace (gnu home-services mcron) with
(gnu home services mcron).
---
 doc/guix.texi                                  | 2 +-
 gnu/{home-services => home/services}/mcron.scm | 2 +-
 gnu/local.mk                                   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename gnu/{home-services => home/services}/mcron.scm (99%)

diff --git a/doc/guix.texi b/doc/guix.texi
index a72a726b54..8edbcd4edf 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -35810,7 +35810,7 @@ for example).
 @cindex mcron
 @cindex scheduling jobs
 
-The @code{(gnu home-services mcron)} module provides an interface to
+The @code{(gnu home services mcron)} module provides an interface to
 GNU <at> tie{}mcron, a daemon to run jobs at scheduled times (@pxref{Top,,,
 mcron, GNU <at> tie{}mcron}).  The information about system's mcron is
 applicable here (@pxref{Scheduled Job Execution}), the only difference
diff --git a/gnu/home-services/mcron.scm b/gnu/home/services/mcron.scm
similarity index 99%
rename from gnu/home-services/mcron.scm
rename to gnu/home/services/mcron.scm
index fb044351a9..cc6faac47f 100644
--- a/gnu/home-services/mcron.scm
+++ b/gnu/home/services/mcron.scm
@@ -17,7 +17,7 @@
 ;;; 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 mcron)
+(define-module (gnu home services mcron)
   #:use-module (gnu packages guile-xyz)
   #:use-module (gnu home-services)
   #:use-module (gnu services shepherd)
diff --git a/gnu/local.mk b/gnu/local.mk
index 5e3722a2d8..5e8b769ce9 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -80,7 +80,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/home/services/configuration.scm		\
   %D%/home/services/shells.scm			\
   %D%/home/services/shepherd.scm		\
-  %D%/home-services/mcron.scm			\
+  %D%/home/services/mcron.scm			\
   %D%/home/services/utils.scm			\
   %D%/home/services/xdg.scm			\
   %D%/image.scm					\
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 16:40:05 GMT) Full text and rfc822 format available.

Message #76 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 10/14] scripts: home: (gnu home-services bash) -> (gnu home
 services bash).
Date: Sat,  2 Oct 2021 19:38:30 +0300
* guix/scripts/home/import.scm: Replace (gnu home-services bash) with
(gnu home services bash).
---
 guix/scripts/home/import.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm
index 79fb23a2fd..c977ec3861 100644
--- a/guix/scripts/home/import.scm
+++ b/guix/scripts/home/import.scm
@@ -41,7 +41,7 @@
   (let ((rc (string-append (getenv "HOME") "/.bashrc"))
         (profile (string-append (getenv "HOME") "/.bash_profile"))
         (logout (string-append (getenv "HOME") "/.bash_logout")))
-    `((gnu home-services bash)
+    `((gnu home services bash)
       (service home-bash-service-type
                  (home-bash-configuration
                   ,@(if (file-exists? rc)
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 16:40:06 GMT) Full text and rfc822 format available.

Message #79 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 11/14] doc: (gnu home-services) -> (gnu home services).
Date: Sat,  2 Oct 2021 19:38:31 +0300
* doc/guix.texi: Replace (gnu home-services) with (gnu home services).
---
 doc/guix.texi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 8edbcd4edf..d641935e0f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -35555,9 +35555,9 @@ services)}.
 
 @node Essential Home Services
 @subsection Essential Home Services
-There are a few essential services defined in @code{(gnu
-home-services)}, they are mostly for internal use and are required to
-build a home environment, but some of them will be useful for the end
+There are a few essential home services defined in
+@code{(gnu services)}, they are mostly for internal use and are required
+to build a home environment, but some of them will be useful for the end
 user.
 
 @cindex environment variables
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 16:40:06 GMT) Full text and rfc822 format available.

Message #82 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 12/14] gnu: home-services: Update %service-type-path.
Date: Sat,  2 Oct 2021 19:38:32 +0300
* gnu/home-services.scm
(%service-type-path): Search home services in "gnu/services".
* gnu/home-services.scm: Update documentation string.
---
 gnu/home-services.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/home-services.scm b/gnu/home-services.scm
index 9f1e986616..a244a15511 100644
--- a/gnu/home-services.scm
+++ b/gnu/home-services.scm
@@ -512,10 +512,10 @@ environment, and its configuration file, when available.")))
 
 (define %service-type-path
   ;; Search path for service types.
-  (make-parameter `((,%guix-home-root-directory . "gnu/home-services"))))
+  (make-parameter `((,%guix-home-root-directory . "gnu/home/services"))))
 
 (define (all-home-service-modules)
-  "Return the default set of home-service modules."
+  "Return the default set of `home service' modules."
   (cons (resolve-interface '(gnu home-services))
         (all-modules (%service-type-path)
                      #:warn warn-about-load-error)))
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 16:40:06 GMT) Full text and rfc822 format available.

Message #85 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 13/14] home: services: configuration: Support file-like
 objects.
Date: Sat,  2 Oct 2021 19:38:33 +0300
* gnu/home/services/configuration.scm (interpose): Include content of files.
(string-or-gexp?): Rename to 'file-or-string-or-gexp?' and check for file-like
object.
(serialize-string-or-gexp): Rename to 'serialize-file-or-string-or-gexp'.
(text-config?): Call 'file-or-string-or-gexp?' intead of 'string-or-gexp?'.
* guix/scripts/home/import.scm:
(generate-bash-module+configuration): Don't call slurp-file-gexp.
---
 gnu/home/services/configuration.scm | 14 ++++++++++----
 guix/scripts/home/import.scm        |  8 +++-----
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/gnu/home/services/configuration.scm b/gnu/home/services/configuration.scm
index 5e7743e7d6..39db7a5693 100644
--- a/gnu/home/services/configuration.scm
+++ b/gnu/home/services/configuration.scm
@@ -59,7 +59,12 @@ DELIMITER interposed LS.  Support 'infix and 'suffix GRAMMAR values."
       (G_ "The GRAMMAR value must be 'infix or 'suffix, but ~a provided.")
       grammar)))
   (fold-right (lambda (e acc)
-		(cons e
+		(cons (if (file-like? e)
+                          #~(begin
+                              (use-modules (ice-9 rdelim))
+                              (with-fluids ((%default-port-encoding "UTF-8"))
+                                (with-input-from-file #$e read-string)))
+                          e)
 		      (if (and (null? acc) (eq? grammar 'infix))
 			  acc
 			  (cons delimiter acc))))
@@ -79,11 +84,12 @@ the list result in @code{#t} when applying PRED? on them."
 
 (define alist? list?)
 
-(define (string-or-gexp? sg) (or (string? sg) (gexp? sg)))
-(define (serialize-string-or-gexp field-name val) "")
+(define (file-or-string-or-gexp? fsg)
+  (or (string? fsg) (gexp? fsg) (file-like? fsg)))
+(define (serialize-file-or-string-or-gexp field-name val) "")
 
 (define (text-config? config)
-  (and (list? config) (every string-or-gexp? config)))
+  (and (list? config) (every file-or-string-or-gexp? config)))
 (define (serialize-text-config field-name val)
   #~(string-append #$@(interpose val "\n" 'suffix)))
 
diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm
index c977ec3861..611f580e85 100644
--- a/guix/scripts/home/import.scm
+++ b/guix/scripts/home/import.scm
@@ -46,17 +46,15 @@
                  (home-bash-configuration
                   ,@(if (file-exists? rc)
                         `((bashrc
-                           (list (slurp-file-gexp (local-file ,rc)))))
+                           (list (local-file ,rc))))
                         '())
                   ,@(if (file-exists? profile)
                         `((bash-profile
-                           (list (slurp-file-gexp
-                                  (local-file ,profile)))))
+                           (list (local-file ,profile))))
                         '())
                   ,@(if (file-exists? logout)
                         `((bash-logout
-                           (list (slurp-file-gexp
-                                  (local-file ,logout)))))
+                           (list (local-file ,logout))))
                         '()))))))
 
 
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 16:40:07 GMT) Full text and rfc822 format available.

Message #88 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH 14/14] doc: Document guix home import.
Date: Sat,  2 Oct 2021 19:38:34 +0300
* doc/guix.texi (Invoking guix home): Document guix home import.
---
 doc/guix.texi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index d641935e0f..2f09f50629 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -36091,6 +36091,10 @@ generations that are up to 10 days old:
 $ guix home list-generations 10d
 @end example
 
+@item import
+Generate a Scheme code template that could be saved as a file and passed
+to @command{guix home reconfigure} command.
+
 @end table
 
 @node Documentation
-- 
2.33.0





Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 02 Oct 2021 16:53:02 GMT) Full text and rfc822 format available.

Removed tag(s) patch. Request was from Oleg Pykhalov <go.wigust <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 02 Oct 2021 16:53:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 18:36:01 GMT) Full text and rfc822 format available.

Message #95 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Xinglu Chen <public <at> yoctocell.xyz>
To: Oleg Pykhalov <go.wigust <at> gmail.com>, 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: Re: [bug#50967] [PATCH 13/14] home: services: configuration:
 Support file-like objects.
Date: Sat, 02 Oct 2021 20:35:40 +0200
[Message part 1 (text/plain, inline)]
On Sat, Oct 02 2021, Oleg Pykhalov wrote:

> * gnu/home/services/configuration.scm (interpose): Include content of files.
> (string-or-gexp?): Rename to 'file-or-string-or-gexp?' and check for file-like
> object.

I would call it ‘file-like-or-string-or-gexp?’, just ‘files’ doesn’t
really make it clear that it should be a “file-like object”.

> (serialize-string-or-gexp): Rename to 'serialize-file-or-string-or-gexp'.
> (text-config?): Call 'file-or-string-or-gexp?' intead of 'string-or-gexp?'.
> * guix/scripts/home/import.scm:
> (generate-bash-module+configuration): Don't call slurp-file-gexp.
> ---
>  gnu/home/services/configuration.scm | 14 ++++++++++----
>  guix/scripts/home/import.scm        |  8 +++-----
>  2 files changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/gnu/home/services/configuration.scm b/gnu/home/services/configuration.scm
> index 5e7743e7d6..39db7a5693 100644
> --- a/gnu/home/services/configuration.scm
> +++ b/gnu/home/services/configuration.scm
> @@ -59,7 +59,12 @@ DELIMITER interposed LS.  Support 'infix and 'suffix GRAMMAR values."
>        (G_ "The GRAMMAR value must be 'infix or 'suffix, but ~a provided.")
>        grammar)))
>    (fold-right (lambda (e acc)
> -		(cons e
> +		(cons (if (file-like? e)
> +                          #~(begin
> +                              (use-modules (ice-9 rdelim))
> +                              (with-fluids ((%default-port-encoding "UTF-8"))
> +                                (with-input-from-file #$e read-string)))
> +                          e)
>  		      (if (and (null? acc) (eq? grammar 'infix))
>  			  acc
>  			  (cons delimiter acc))))
> @@ -79,11 +84,12 @@ the list result in @code{#t} when applying PRED? on them."
>  
>  (define alist? list?)
>  
> -(define (string-or-gexp? sg) (or (string? sg) (gexp? sg)))
> -(define (serialize-string-or-gexp field-name val) "")
> +(define (file-or-string-or-gexp? fsg)
> +  (or (string? fsg) (gexp? fsg) (file-like? fsg)))
> +(define (serialize-file-or-string-or-gexp field-name val) "")

This could defined as ‘empty-serializer’ from (gnu services
configuration).

>  
>  (define (text-config? config)
> -  (and (list? config) (every string-or-gexp? config)))
> +  (and (list? config) (every file-or-string-or-gexp? config)))

‘text-config?’ could be defined as (list-of file-or-string-or-gexp?)

>  (define (serialize-text-config field-name val)
>    #~(string-append #$@(interpose val "\n" 'suffix)))
>  
> diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm
> index c977ec3861..611f580e85 100644
> --- a/guix/scripts/home/import.scm
> +++ b/guix/scripts/home/import.scm
> @@ -46,17 +46,15 @@
>                   (home-bash-configuration
>                    ,@(if (file-exists? rc)
>                          `((bashrc
> -                           (list (slurp-file-gexp (local-file ,rc)))))
> +                           (list (local-file ,rc))))
>                          '())
>                    ,@(if (file-exists? profile)
>                          `((bash-profile
> -                           (list (slurp-file-gexp
> -                                  (local-file ,profile)))))
> +                           (list (local-file ,profile))))
>                          '())
>                    ,@(if (file-exists? logout)
>                          `((bash-logout
> -                           (list (slurp-file-gexp
> -                                  (local-file ,logout)))))
> +                           (list (local-file ,logout))))
>                          '()))))))
>  
>  
> -- 
> 2.33.0
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 18:38:02 GMT) Full text and rfc822 format available.

Message #98 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Xinglu Chen <public <at> yoctocell.xyz>
To: Oleg Pykhalov <go.wigust <at> gmail.com>, 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: Re: [bug#50967] [PATCH 02/14] gnu: home-services: Move
 configuration to (gnu home services).
Date: Sat, 02 Oct 2021 20:37:42 +0200
[Message part 1 (text/plain, inline)]
On Sat, Oct 02 2021, Oleg Pykhalov wrote:

> * gnu/home-services/configuration.scm: Move the content ...
> * gnu/home/services/configuration.scm: ... here.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Same.
> * gnu/home-services/shells.scm: Replace (gnu home-services configuration)
> with (gnu home services configuration).
> * gnu/home-services/xdg.scm: Same.
> ---
>  gnu/home-services/shells.scm                           | 2 +-
>  gnu/home-services/xdg.scm                              | 2 +-
>  gnu/{home-services => home/services}/configuration.scm | 2 +-
>  gnu/local.mk                                           | 2 +-

I think it makes more sense to move (gnu home-services configuration) to
(gnu services configuration) since none of the things in (gnu
home-services configuration) seem specific to home services.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 18:43:01 GMT) Full text and rfc822 format available.

Message #101 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Xinglu Chen <public <at> yoctocell.xyz>
To: Oleg Pykhalov <go.wigust <at> gmail.com>, 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: Re: [bug#50967] [PATCH 14/14] doc: Document guix home import.
Date: Sat, 02 Oct 2021 20:42:17 +0200
[Message part 1 (text/plain, inline)]
On Sat, Oct 02 2021, Oleg Pykhalov wrote:

> * doc/guix.texi (Invoking guix home): Document guix home import.
> ---
>  doc/guix.texi | 4 ++++
>  1 file changed, 4 insertions(+)

I sent a patch that documents ‘guix home import’ in a separate series
which also fixes some things about ‘guix home import’[1].

[1]: <https://issues.guix.gnu.org/50873>
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 20:15:01 GMT) Full text and rfc822 format available.

Message #104 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH] home: services: configuration: Move and refactor content.
Date: Sat,  2 Oct 2021 23:13:46 +0300
* gnu/home/services/configuration.scm: Move content ...
* gnu/services/configuration.scm: here.
* gnu/home/services/shells.scm: Delete (gnu home services configuration).
* gnu/home/services/xdg.scm: Same.
* gnu/local.mk: Same.
---
 gnu/home/services/configuration.scm | 115 ----------------------------
 gnu/home/services/shells.scm        |   1 -
 gnu/home/services/xdg.scm           |   1 -
 gnu/local.mk                        |   1 -
 gnu/services/configuration.scm      |  95 ++++++++++++++++++++++-
 5 files changed, 93 insertions(+), 120 deletions(-)
 delete mode 100644 gnu/home/services/configuration.scm

diff --git a/gnu/home/services/configuration.scm b/gnu/home/services/configuration.scm
deleted file mode 100644
index 39db7a5693..0000000000
--- a/gnu/home/services/configuration.scm
+++ /dev/null
@@ -1,115 +0,0 @@
-;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
-;;; Copyright © 2021 Xinglu Chen <public <at> 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 configuration)
-  #:use-module (gnu services configuration)
-  #:use-module (guix gexp)
-  #:use-module (srfi srfi-1)
-  #:use-module (ice-9 curried-definitions)
-  #:use-module (ice-9 match)
-  #:use-module (guix i18n)
-  #:use-module (guix diagnostics)
-
-  #:export (filter-configuration-fields
-
-            interpose
-            list-of
-
-            list-of-strings?
-            alist?
-            string-or-gexp?
-	    serialize-string-or-gexp
-	    text-config?
-            serialize-text-config
-            generic-serialize-alist-entry
-            generic-serialize-alist))
-
-(define* (filter-configuration-fields configuration-fields fields
-				      #:optional negate?)
-  "Retrieve the fields listed in FIELDS from CONFIGURATION-FIELDS.
-If NEGATE? is @code{#t}, retrieve all fields except FIELDS."
-  (filter (lambda (field)
-            (let ((member? (member (configuration-field-name field) fields)))
-              (if (not negate?) member? (not member?))))
-          configuration-fields))
-
-
-(define* (interpose ls  #:optional (delimiter "\n") (grammar 'infix))
-  "Same as @code{string-join}, but without join and string, returns an
-DELIMITER interposed LS.  Support 'infix and 'suffix GRAMMAR values."
-  (when (not (member grammar '(infix suffix)))
-    (raise
-     (formatted-message
-      (G_ "The GRAMMAR value must be 'infix or 'suffix, but ~a provided.")
-      grammar)))
-  (fold-right (lambda (e acc)
-		(cons (if (file-like? e)
-                          #~(begin
-                              (use-modules (ice-9 rdelim))
-                              (with-fluids ((%default-port-encoding "UTF-8"))
-                                (with-input-from-file #$e read-string)))
-                          e)
-		      (if (and (null? acc) (eq? grammar 'infix))
-			  acc
-			  (cons delimiter acc))))
-	      '() ls))
-
-(define (list-of pred?)
-  "Return a procedure that takes a list and check if all the elements of
-the list result in @code{#t} when applying PRED? on them."
-    (lambda (x)
-      (if (list? x)
-          (every pred? x)
-          #f)))
-
-
-(define list-of-strings?
-  (list-of string?))
-
-(define alist? list?)
-
-(define (file-or-string-or-gexp? fsg)
-  (or (string? fsg) (gexp? fsg) (file-like? fsg)))
-(define (serialize-file-or-string-or-gexp field-name val) "")
-
-(define (text-config? config)
-  (and (list? config) (every file-or-string-or-gexp? config)))
-(define (serialize-text-config field-name val)
-  #~(string-append #$@(interpose val "\n" 'suffix)))
-
-(define ((generic-serialize-alist-entry serialize-field) entry)
-  "Apply the SERIALIZE-FIELD procedure on the field and value of ENTRY."
-  (match entry
-    ((field . val) (serialize-field field val))))
-
-(define (generic-serialize-alist combine serialize-field fields)
-  "Generate a configuration from an association list FIELDS.
-
-SERIALIZE-FIELD is a procedure that takes two arguments, it will be
-applied on the fields and values of FIELDS using the
-@code{generic-serialize-alist-entry} procedure.
-
-COMBINE is a procedure that takes one or more arguments and combines
-all the alist entries into one value, @code{string-append} or
-@code{append} are usually good candidates for this.
-
-See the @code{serialize-alist} procedure in `@code{(gnu home-services
-version-control}' for an example usage.)}"
-  (apply combine
-         (map (generic-serialize-alist-entry serialize-field) fields)))
diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index 2308371dd0..4e5825962c 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -19,7 +19,6 @@
 
 (define-module (gnu home services shells)
   #:use-module (gnu services configuration)
-  #:use-module (gnu home services configuration)
   #:use-module (gnu home services utils)
   #:use-module (gnu home-services)
   #:use-module (gnu packages shells)
diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm
index 4aed9a5803..c285d126dd 100644
--- a/gnu/home/services/xdg.scm
+++ b/gnu/home/services/xdg.scm
@@ -19,7 +19,6 @@
 
 (define-module (gnu home services xdg)
   #:use-module (gnu services configuration)
-  #:use-module (gnu home services configuration)
   #:use-module (gnu home-services)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu home services utils)
diff --git a/gnu/local.mk b/gnu/local.mk
index 5e8b769ce9..9c3bf44a2b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -77,7 +77,6 @@ GNU_SYSTEM_MODULES =				\
   %D%/home-services.scm			\
   %D%/home/services/symlink-manager.scm		\
   %D%/home/services/fontutils.scm		\
-  %D%/home/services/configuration.scm		\
   %D%/home/services/shells.scm			\
   %D%/home/services/shepherd.scm		\
   %D%/home/services/mcron.scm			\
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index df3d3b6f9b..1829dbd2bf 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2017, 2018 Clément Lassieur <clement <at> lassieur.org>
 ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,10 +26,12 @@
   #:use-module (guix records)
   #:use-module (guix gexp)
   #:use-module ((guix utils) #:select (source-properties->location))
-  #:use-module ((guix diagnostics) #:select (location-file))
+  #:use-module ((guix diagnostics) #:select (formatted-message location-file))
   #:use-module ((guix modules) #:select (file-name->module-name))
+  #:use-module (guix i18n)
   #:autoload   (texinfo) (texi-fragment->stexi)
   #:autoload   (texinfo serialize) (stexi->texi)
+  #:use-module (ice-9 curried-definitions)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-34)
@@ -56,7 +59,21 @@
             generate-documentation
             configuration->documentation
             empty-serializer
-            serialize-package))
+            serialize-package
+
+            filter-configuration-fields
+
+            interpose
+            list-of
+
+            list-of-strings?
+            alist?
+            string-or-gexp?
+	    serialize-string-or-gexp
+	    text-config?
+            serialize-text-config
+            generic-serialize-alist-entry
+            generic-serialize-alist))
 
 ;;; Commentary:
 ;;;
@@ -323,3 +340,77 @@ Texinfo documentation of its fields."
                                                   '-fields))))
     (display (generate-documentation `((,configuration-symbol ,fields-getter))
                                      configuration-symbol))))
+
+(define* (filter-configuration-fields configuration-fields fields
+				      #:optional negate?)
+  "Retrieve the fields listed in FIELDS from CONFIGURATION-FIELDS.
+If NEGATE? is @code{#t}, retrieve all fields except FIELDS."
+  (filter (lambda (field)
+            (let ((member? (member (configuration-field-name field) fields)))
+              (if (not negate?) member? (not member?))))
+          configuration-fields))
+
+
+(define* (interpose ls  #:optional (delimiter "\n") (grammar 'infix))
+  "Same as @code{string-join}, but without join and string, returns an
+DELIMITER interposed LS.  Support 'infix and 'suffix GRAMMAR values."
+  (when (not (member grammar '(infix suffix)))
+    (raise
+     (formatted-message
+      (G_ "The GRAMMAR value must be 'infix or 'suffix, but ~a provided.")
+      grammar)))
+  (fold-right (lambda (e acc)
+                (cons (if (file-like? e)
+                          #~(begin
+                              (use-modules (ice-9 rdelim))
+                              (with-fluids ((%default-port-encoding "UTF-8"))
+                                (with-input-from-file #$e read-string)))
+                          e)
+		      (if (and (null? acc) (eq? grammar 'infix))
+			  acc
+			  (cons delimiter acc))))
+	      '() ls))
+
+(define (list-of pred?)
+  "Return a procedure that takes a list and check if all the elements of
+the list result in @code{#t} when applying PRED? on them."
+    (lambda (x)
+      (if (list? x)
+          (every pred? x)
+          #f)))
+
+
+(define list-of-strings?
+  (list-of string?))
+
+(define alist? list?)
+
+(define (file-like-or-string-or-gexp? fsg)
+  (or (string? fsg) (gexp? fsg) (file-like? fsg)))
+(define serialize-file-like-or-string-or-gexp empty-serializer)
+
+(define (text-config? config)
+  (list-of file-like-or-string-or-gexp?))
+(define (serialize-text-config field-name val)
+  #~(string-append #$@(interpose val "\n" 'suffix)))
+
+(define ((generic-serialize-alist-entry serialize-field) entry)
+  "Apply the SERIALIZE-FIELD procedure on the field and value of ENTRY."
+  (match entry
+    ((field . val) (serialize-field field val))))
+
+(define (generic-serialize-alist combine serialize-field fields)
+  "Generate a configuration from an association list FIELDS.
+
+SERIALIZE-FIELD is a procedure that takes two arguments, it will be
+applied on the fields and values of FIELDS using the
+@code{generic-serialize-alist-entry} procedure.
+
+COMBINE is a procedure that takes one or more arguments and combines
+all the alist entries into one value, @code{string-append} or
+@code{append} are usually good candidates for this.
+
+See the @code{serialize-alist} procedure in `@code{(gnu home-services
+version-control}' for an example usage.)}"
+  (apply combine
+         (map (generic-serialize-alist-entry serialize-field) fields)))
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 02 Oct 2021 20:15:02 GMT) Full text and rfc822 format available.

Message #107 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: Xinglu Chen <public <at> yoctocell.xyz>
Cc: 50967 <at> debbugs.gnu.org
Subject: Re: [bug#50967] [PATCH 14/14] doc: Document guix home import.
Date: Sat, 02 Oct 2021 22:45:47 +0300
[Message part 1 (text/plain, inline)]
Xinglu Chen <public <at> yoctocell.xyz> writes:

> On Sat, Oct 02 2021, Oleg Pykhalov wrote:
>
>> * doc/guix.texi (Invoking guix home): Document guix home import.
>> ---
>>  doc/guix.texi | 4 ++++
>>  1 file changed, 4 insertions(+)
>
> I sent a patch that documents ‘guix home import’ in a separate series
> which also fixes some things about ‘guix home import’[1].
>
> [1]: <https://issues.guix.gnu.org/50873>

OK, then I just remove my commit.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Mon, 04 Oct 2021 13:59:02 GMT) Full text and rfc822 format available.

Message #110 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 50967 <at> debbugs.gnu.org, Andrew Tropin <andrew <at> trop.in>
Subject: Re: bug#50967: [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Mon, 04 Oct 2021 15:58:28 +0200
Hi Oleg,

Oleg Pykhalov <go.wigust <at> gmail.com> skribis:

> From: Andrew Tropin <andrew <at> trop.in>
>
> * tests/guix-home.sh: New file.
> * Makefile.am (SH_TESTS): Add tests/guix-home.sh.
>
> Signed-off-by: Oleg Pykhalov <go.wigust <at> gmail.com>

[...]

> +# Reporting of syntax errors.
> +
> +cat > "$tmpfile"<<EOF
> +;; This is line 1, and the next one is line 2.
> +   (home-environment
> +    (packages))
> +;; The 'T' is at column 3.
> +EOF

This test is more or less copied from guix-system.sh, and I think it’s
not that useful because it’s testing the exact same functionality.

Would it be possible to have a CLI test that really tests ‘guix home’
functionality?

The difficulty is that this would tend to rebuild the world.  This can
be worked around in one of two ways:

  1. Add a ‘--bootstrap’ flag for force the use of the “guile-bootstrap”
     package instead of “guile”, for instance, as is done for
     tests/guix-package.sh.

  2. Run tests only when a “real” daemon is available, using it instead
     of the test daemon, as is done in tests/guix-pack-relocatable.sh.

  3. Run tests in a VM using the (gnu tests …) infrastructure.

I don’t think #1 would work well for Guix Home.  #2 is the easiest; the
downside is that tests would only be run on developer machines, not in
CI.  #3 is the most flexible approach, but the downside is that it’s
more resource-intensive (needs to build a VM image, etc.).

Overall, I’d recommend starting with #2 and eventually add tests as #3,
as far as integration tests are concerned.

Then again, it’s also possible to have focused unit tests for specific
pieces, just like we have tests/union.scm for instance.

WDYT?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Mon, 04 Oct 2021 14:02:02 GMT) Full text and rfc822 format available.

Message #113 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 50967 <at> debbugs.gnu.org
Subject: Re: bug#50967: [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Mon, 04 Oct 2021 16:01:28 +0200
Oleg Pykhalov <go.wigust <at> gmail.com> skribis:

> * gnu/home-services.scm
> (%service-type-path): Search home services in "gnu/services".
> * gnu/home-services.scm: Update documentation string.
> ---
>  gnu/home-services.scm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/home-services.scm b/gnu/home-services.scm
> index 9f1e986616..a244a15511 100644
> --- a/gnu/home-services.scm
> +++ b/gnu/home-services.scm
> @@ -512,10 +512,10 @@ environment, and its configuration file, when available.")))
>  
>  (define %service-type-path
>    ;; Search path for service types.
> -  (make-parameter `((,%guix-home-root-directory . "gnu/home-services"))))
> +  (make-parameter `((,%guix-home-root-directory . "gnu/home/services"))))
>  

I think it would make more sense to squeeze patches 2 to 12 (inclusive)
as a single patch.  That way, both the previous and the next commit
would be in working state, which may not be the case when we rename
things one by one (for example, renamed service modules won’t be
discovered until the hunk above is applied.)

Otherwise LGTM, thanks!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Mon, 04 Oct 2021 14:05:01 GMT) Full text and rfc822 format available.

Message #116 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Xinglu Chen <public <at> yoctocell.xyz>
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, 50967 <at> debbugs.gnu.org
Subject: Re: bug#50967: [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Mon, 04 Oct 2021 16:04:04 +0200
Xinglu Chen <public <at> yoctocell.xyz> skribis:

> On Sat, Oct 02 2021, Oleg Pykhalov wrote:
>
>> * gnu/home/services/configuration.scm (interpose): Include content of files.
>> (string-or-gexp?): Rename to 'file-or-string-or-gexp?' and check for file-like
>> object.
>
> I would call it ‘file-like-or-string-or-gexp?’, just ‘files’ doesn’t
> really make it clear that it should be a “file-like object”.

As a matter of API, I would make it monomorphic: accept a file-like
object, period.  This is what’s done for System services (and
polymorphic APIs are rare in general in Guix).

‘plain-file’ and ‘scheme-file’ allow users to “convert” a string or a
gexp into a file-like object.

WDYT?

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Mon, 04 Oct 2021 23:15:01 GMT) Full text and rfc822 format available.

Message #119 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Xinglu Chen <public <at> yoctocell.xyz>, Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH 2/3] home: services: configuration: Support file-like objects.
Date: Tue,  5 Oct 2021 02:13:30 +0300
* gnu/home/services/configuration.scm (interpose): Operate only with file-like
objects.
(string-or-gexp?): Delete procedure.
(serialize-string-or-gexp): Rename to 'serialize-file-like'.
(text-config?): Call 'file-like' intead of 'string-or-gexp?'.
* guix/scripts/home/import.scm:
(generate-bash-module+configuration): Don't call slurp-file-gexp.
* gnu/home/services/configuration.scm: Move content ...
* gnu/services/configuration.scm: here.
* gnu/home/services/shells.scm: Delete (gnu home services configuration).
* gnu/home/services/xdg.scm: Same.
* gnu/local.mk: Same.
---
 gnu/home/services/configuration.scm | 109 ----------------------------
 gnu/home/services/shells.scm        |   1 -
 gnu/home/services/xdg.scm           |   1 -
 gnu/local.mk                        |   1 -
 gnu/services/configuration.scm      |  90 ++++++++++++++++++++++-
 guix/scripts/home/import.scm        |   8 +-
 6 files changed, 91 insertions(+), 119 deletions(-)
 delete mode 100644 gnu/home/services/configuration.scm

diff --git a/gnu/home/services/configuration.scm b/gnu/home/services/configuration.scm
deleted file mode 100644
index 5e7743e7d6..0000000000
--- a/gnu/home/services/configuration.scm
+++ /dev/null
@@ -1,109 +0,0 @@
-;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
-;;; Copyright © 2021 Xinglu Chen <public <at> 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 configuration)
-  #:use-module (gnu services configuration)
-  #:use-module (guix gexp)
-  #:use-module (srfi srfi-1)
-  #:use-module (ice-9 curried-definitions)
-  #:use-module (ice-9 match)
-  #:use-module (guix i18n)
-  #:use-module (guix diagnostics)
-
-  #:export (filter-configuration-fields
-
-            interpose
-            list-of
-
-            list-of-strings?
-            alist?
-            string-or-gexp?
-	    serialize-string-or-gexp
-	    text-config?
-            serialize-text-config
-            generic-serialize-alist-entry
-            generic-serialize-alist))
-
-(define* (filter-configuration-fields configuration-fields fields
-				      #:optional negate?)
-  "Retrieve the fields listed in FIELDS from CONFIGURATION-FIELDS.
-If NEGATE? is @code{#t}, retrieve all fields except FIELDS."
-  (filter (lambda (field)
-            (let ((member? (member (configuration-field-name field) fields)))
-              (if (not negate?) member? (not member?))))
-          configuration-fields))
-
-
-(define* (interpose ls  #:optional (delimiter "\n") (grammar 'infix))
-  "Same as @code{string-join}, but without join and string, returns an
-DELIMITER interposed LS.  Support 'infix and 'suffix GRAMMAR values."
-  (when (not (member grammar '(infix suffix)))
-    (raise
-     (formatted-message
-      (G_ "The GRAMMAR value must be 'infix or 'suffix, but ~a provided.")
-      grammar)))
-  (fold-right (lambda (e acc)
-		(cons e
-		      (if (and (null? acc) (eq? grammar 'infix))
-			  acc
-			  (cons delimiter acc))))
-	      '() ls))
-
-(define (list-of pred?)
-  "Return a procedure that takes a list and check if all the elements of
-the list result in @code{#t} when applying PRED? on them."
-    (lambda (x)
-      (if (list? x)
-          (every pred? x)
-          #f)))
-
-
-(define list-of-strings?
-  (list-of string?))
-
-(define alist? list?)
-
-(define (string-or-gexp? sg) (or (string? sg) (gexp? sg)))
-(define (serialize-string-or-gexp field-name val) "")
-
-(define (text-config? config)
-  (and (list? config) (every string-or-gexp? config)))
-(define (serialize-text-config field-name val)
-  #~(string-append #$@(interpose val "\n" 'suffix)))
-
-(define ((generic-serialize-alist-entry serialize-field) entry)
-  "Apply the SERIALIZE-FIELD procedure on the field and value of ENTRY."
-  (match entry
-    ((field . val) (serialize-field field val))))
-
-(define (generic-serialize-alist combine serialize-field fields)
-  "Generate a configuration from an association list FIELDS.
-
-SERIALIZE-FIELD is a procedure that takes two arguments, it will be
-applied on the fields and values of FIELDS using the
-@code{generic-serialize-alist-entry} procedure.
-
-COMBINE is a procedure that takes one or more arguments and combines
-all the alist entries into one value, @code{string-append} or
-@code{append} are usually good candidates for this.
-
-See the @code{serialize-alist} procedure in `@code{(gnu home-services
-version-control}' for an example usage.)}"
-  (apply combine
-         (map (generic-serialize-alist-entry serialize-field) fields)))
diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index 2308371dd0..4e5825962c 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -19,7 +19,6 @@
 
 (define-module (gnu home services shells)
   #:use-module (gnu services configuration)
-  #:use-module (gnu home services configuration)
   #:use-module (gnu home services utils)
   #:use-module (gnu home-services)
   #:use-module (gnu packages shells)
diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm
index 4aed9a5803..c285d126dd 100644
--- a/gnu/home/services/xdg.scm
+++ b/gnu/home/services/xdg.scm
@@ -19,7 +19,6 @@
 
 (define-module (gnu home services xdg)
   #:use-module (gnu services configuration)
-  #:use-module (gnu home services configuration)
   #:use-module (gnu home-services)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu home services utils)
diff --git a/gnu/local.mk b/gnu/local.mk
index 5e8b769ce9..9c3bf44a2b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -77,7 +77,6 @@ GNU_SYSTEM_MODULES =				\
   %D%/home-services.scm			\
   %D%/home/services/symlink-manager.scm		\
   %D%/home/services/fontutils.scm		\
-  %D%/home/services/configuration.scm		\
   %D%/home/services/shells.scm			\
   %D%/home/services/shepherd.scm		\
   %D%/home/services/mcron.scm			\
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index df3d3b6f9b..60ab75b0c1 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2017, 2018 Clément Lassieur <clement <at> lassieur.org>
 ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,10 +26,12 @@
   #:use-module (guix records)
   #:use-module (guix gexp)
   #:use-module ((guix utils) #:select (source-properties->location))
-  #:use-module ((guix diagnostics) #:select (location-file))
+  #:use-module ((guix diagnostics) #:select (formatted-message location-file))
   #:use-module ((guix modules) #:select (file-name->module-name))
+  #:use-module (guix i18n)
   #:autoload   (texinfo) (texi-fragment->stexi)
   #:autoload   (texinfo serialize) (stexi->texi)
+  #:use-module (ice-9 curried-definitions)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-34)
@@ -56,7 +59,20 @@
             generate-documentation
             configuration->documentation
             empty-serializer
-            serialize-package))
+            serialize-package
+
+            filter-configuration-fields
+
+            interpose
+            list-of
+
+            list-of-strings?
+            alist?
+	    serialize-file-like
+	    text-config?
+            serialize-text-config
+            generic-serialize-alist-entry
+            generic-serialize-alist))
 
 ;;; Commentary:
 ;;;
@@ -323,3 +339,73 @@ Texinfo documentation of its fields."
                                                   '-fields))))
     (display (generate-documentation `((,configuration-symbol ,fields-getter))
                                      configuration-symbol))))
+
+(define* (filter-configuration-fields configuration-fields fields
+				      #:optional negate?)
+  "Retrieve the fields listed in FIELDS from CONFIGURATION-FIELDS.
+If NEGATE? is @code{#t}, retrieve all fields except FIELDS."
+  (filter (lambda (field)
+            (let ((member? (member (configuration-field-name field) fields)))
+              (if (not negate?) member? (not member?))))
+          configuration-fields))
+
+
+(define* (interpose ls  #:optional (delimiter "\n") (grammar 'infix))
+  "Same as @code{string-join}, but without join and string, returns an
+DELIMITER interposed LS.  Support 'infix and 'suffix GRAMMAR values."
+  (when (not (member grammar '(infix suffix)))
+    (raise
+     (formatted-message
+      (G_ "The GRAMMAR value must be 'infix or 'suffix, but ~a provided.")
+      grammar)))
+  (fold-right (lambda (e acc)
+                (cons #~(begin
+                          (use-modules (ice-9 rdelim))
+                          (with-fluids ((%default-port-encoding "UTF-8"))
+                            (with-input-from-file #$e read-string)))
+		      (if (and (null? acc) (eq? grammar 'infix))
+			  acc
+			  (cons delimiter acc))))
+	      '() ls))
+
+(define (list-of pred?)
+  "Return a procedure that takes a list and check if all the elements of
+the list result in @code{#t} when applying PRED? on them."
+    (lambda (x)
+      (if (list? x)
+          (every pred? x)
+          #f)))
+
+
+(define list-of-strings?
+  (list-of string?))
+
+(define alist? list?)
+
+(define serialize-file-like empty-serializer)
+
+(define (text-config? config)
+  (list-of file-like?))
+(define (serialize-text-config field-name val)
+  #~(string-append #$@(interpose val "\n" 'suffix)))
+
+(define ((generic-serialize-alist-entry serialize-field) entry)
+  "Apply the SERIALIZE-FIELD procedure on the field and value of ENTRY."
+  (match entry
+    ((field . val) (serialize-field field val))))
+
+(define (generic-serialize-alist combine serialize-field fields)
+  "Generate a configuration from an association list FIELDS.
+
+SERIALIZE-FIELD is a procedure that takes two arguments, it will be
+applied on the fields and values of FIELDS using the
+@code{generic-serialize-alist-entry} procedure.
+
+COMBINE is a procedure that takes one or more arguments and combines
+all the alist entries into one value, @code{string-append} or
+@code{append} are usually good candidates for this.
+
+See the @code{serialize-alist} procedure in `@code{(gnu home-services
+version-control}' for an example usage.)}"
+  (apply combine
+         (map (generic-serialize-alist-entry serialize-field) fields)))
diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm
index c977ec3861..611f580e85 100644
--- a/guix/scripts/home/import.scm
+++ b/guix/scripts/home/import.scm
@@ -46,17 +46,15 @@
                  (home-bash-configuration
                   ,@(if (file-exists? rc)
                         `((bashrc
-                           (list (slurp-file-gexp (local-file ,rc)))))
+                           (list (local-file ,rc))))
                         '())
                   ,@(if (file-exists? profile)
                         `((bash-profile
-                           (list (slurp-file-gexp
-                                  (local-file ,profile)))))
+                           (list (local-file ,profile))))
                         '())
                   ,@(if (file-exists? logout)
                         `((bash-logout
-                           (list (slurp-file-gexp
-                                  (local-file ,logout)))))
+                           (list (local-file ,logout))))
                         '()))))))
 
 
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Mon, 04 Oct 2021 23:15:02 GMT) Full text and rfc822 format available.

Message #122 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Xinglu Chen <public <at> yoctocell.xyz>, Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH 1/3] gnu: Move (gnu home-services) to (gnu home services).
Date: Tue,  5 Oct 2021 02:13:29 +0300
* gnu/home-services/configuration.scm: Move the content ...
* gnu/home/services/configuration.scm: ... here.
* gnu/local.mk (GNU_SYSTEM_MODULES): Same.
* gnu/home-services/shells.scm: Replace (gnu home-services configuration)
with (gnu home services configuration).
* gnu/home-services/xdg.scm: Same.
* gnu/home-services/symlink-manager.scm: Rename to
gnu/home/services/symlink-manager.scm.
* gnu/local.mk: Same.
* gnu/home.scm: Replace (gnu home-services symlink-manager) with
(gnu home services symlink-manager).
* gnu/home-services/utils.scm: Rename to gnu/home/services/utils.scm.
* gnu/local.mk: Same.
* gnu/home-services/shells.scm: Replace (gnu home-services utils) with
(gnu home services utils).
* gnu/home-services/xdg.scm: Same.
* gnu/home-services/fontutils.scm: Rename to gnu/services/fontutils.scm.
* gnu/local.mk: Same.
* gnu/home.scm: Replace (gnu home-services fontutils) with
(gnu services fontutils).
* gnu/home-services/shells.scm: Rename to gnu/home/services/shells.scm.
* gnu/local.mk: Same.
* gnu/home.scm: Replace (gnu home-services shells) with (gnu home services shells).
* doc/he-config-bare-bones.scm: Same.
* gnu/home-services/xdg.scm: Rename to gnu/home/services/xdg.scm.
* gnu/local.mk: Same.
* gnu/home.scm: Replace (gnu home-services xdg) with (gnu home services xdg).
* gnu/home-services/shepherd.scm: Move to gnu/home/services/shepherd.scm.
* gnu/local.mk: Same.
* gnu/home-services/mcron.scm: Replace (gnu home-services shepherd) with
(gnu home services shepherd).
* tests/guix-home.sh: Same.
* gnu/home-services/mcron.scm: Move to gnu/home/services/mcron.scm.
* gnu/local.mk: Same.
* doc/guix.texi: Replace (gnu home-services mcron) with
(gnu home services mcron).
* guix/scripts/home/import.scm: Replace (gnu home-services bash) with
(gnu home services bash).
* doc/guix.texi: Replace (gnu home-services) with (gnu home services).
* gnu/home-services.scm
(%service-type-path): Search home services in "gnu/services".
* gnu/home-services.scm: Update documentation string.
---
 doc/guix.texi                                    |  8 ++++----
 doc/he-config-bare-bones.scm                     |  2 +-
 gnu/home-services.scm                            |  4 ++--
 gnu/home.scm                                     |  8 ++++----
 .../services}/configuration.scm                  |  2 +-
 .../services}/fontutils.scm                      |  2 +-
 gnu/{home-services => home/services}/mcron.scm   |  4 ++--
 gnu/{home-services => home/services}/shells.scm  |  6 +++---
 .../services}/shepherd.scm                       |  2 +-
 .../services}/symlink-manager.scm                |  2 +-
 gnu/{home-services => home/services}/utils.scm   |  2 +-
 gnu/{home-services => home/services}/xdg.scm     |  6 +++---
 gnu/local.mk                                     | 16 ++++++++--------
 guix/scripts/home/import.scm                     |  2 +-
 14 files changed, 33 insertions(+), 33 deletions(-)
 rename gnu/{home-services => home/services}/configuration.scm (98%)
 rename gnu/{home-services => home/services}/fontutils.scm (98%)
 rename gnu/{home-services => home/services}/mcron.scm (98%)
 rename gnu/{home-services => home/services}/shells.scm (99%)
 rename gnu/{home-services => home/services}/shepherd.scm (99%)
 rename gnu/{home-services => home/services}/symlink-manager.scm (99%)
 rename gnu/{home-services => home/services}/utils.scm (98%)
 rename gnu/{home-services => home/services}/xdg.scm (99%)

diff --git a/doc/guix.texi b/doc/guix.texi
index a72a726b54..d641935e0f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -35555,9 +35555,9 @@ services)}.
 
 @node Essential Home Services
 @subsection Essential Home Services
-There are a few essential services defined in @code{(gnu
-home-services)}, they are mostly for internal use and are required to
-build a home environment, but some of them will be useful for the end
+There are a few essential home services defined in
+@code{(gnu services)}, they are mostly for internal use and are required
+to build a home environment, but some of them will be useful for the end
 user.
 
 @cindex environment variables
@@ -35810,7 +35810,7 @@ for example).
 @cindex mcron
 @cindex scheduling jobs
 
-The @code{(gnu home-services mcron)} module provides an interface to
+The @code{(gnu home services mcron)} module provides an interface to
 GNU <at> tie{}mcron, a daemon to run jobs at scheduled times (@pxref{Top,,,
 mcron, GNU <at> tie{}mcron}).  The information about system's mcron is
 applicable here (@pxref{Scheduled Job Execution}), the only difference
diff --git a/doc/he-config-bare-bones.scm b/doc/he-config-bare-bones.scm
index 01be46a7b0..1faf75b871 100644
--- a/doc/he-config-bare-bones.scm
+++ b/doc/he-config-bare-bones.scm
@@ -1,6 +1,6 @@
 (use-modules (gnu home)
              (gnu home-services)
-             (gnu home-services shells)
+             (gnu home services shells)
              (gnu services)
              (gnu packages admin)
              (guix gexp))
diff --git a/gnu/home-services.scm b/gnu/home-services.scm
index 9f1e986616..a244a15511 100644
--- a/gnu/home-services.scm
+++ b/gnu/home-services.scm
@@ -512,10 +512,10 @@ environment, and its configuration file, when available.")))
 
 (define %service-type-path
   ;; Search path for service types.
-  (make-parameter `((,%guix-home-root-directory . "gnu/home-services"))))
+  (make-parameter `((,%guix-home-root-directory . "gnu/home/services"))))
 
 (define (all-home-service-modules)
-  "Return the default set of home-service modules."
+  "Return the default set of `home service' modules."
   (cons (resolve-interface '(gnu home-services))
         (all-modules (%service-type-path)
                      #:warn warn-about-load-error)))
diff --git a/gnu/home.scm b/gnu/home.scm
index f4c9359e25..5ac382dc5a 100644
--- a/gnu/home.scm
+++ b/gnu/home.scm
@@ -18,10 +18,10 @@
 
 (define-module (gnu home)
   #:use-module (gnu home-services)
-  #:use-module (gnu home-services symlink-manager)
-  #:use-module (gnu home-services shells)
-  #:use-module (gnu home-services xdg)
-  #:use-module (gnu home-services fontutils)
+  #:use-module (gnu home services symlink-manager)
+  #:use-module (gnu home services shells)
+  #:use-module (gnu home services xdg)
+  #:use-module (gnu home services fontutils)
   #:use-module (gnu services)
   #:use-module (guix records)
   #:use-module (guix diagnostics)
diff --git a/gnu/home-services/configuration.scm b/gnu/home/services/configuration.scm
similarity index 98%
rename from gnu/home-services/configuration.scm
rename to gnu/home/services/configuration.scm
index e8f4bc77ec..5e7743e7d6 100644
--- a/gnu/home-services/configuration.scm
+++ b/gnu/home/services/configuration.scm
@@ -17,7 +17,7 @@
 ;;; 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 configuration)
+(define-module (gnu home services configuration)
   #:use-module (gnu services configuration)
   #:use-module (guix gexp)
   #:use-module (srfi srfi-1)
diff --git a/gnu/home-services/fontutils.scm b/gnu/home/services/fontutils.scm
similarity index 98%
rename from gnu/home-services/fontutils.scm
rename to gnu/home/services/fontutils.scm
index 28bfc3d3f7..72a84fdecd 100644
--- a/gnu/home-services/fontutils.scm
+++ b/gnu/home/services/fontutils.scm
@@ -17,7 +17,7 @@
 ;;; 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)
+(define-module (gnu home services fontutils)
   #:use-module (gnu home-services)
   #:use-module (gnu packages fontutils)
   #:use-module (guix gexp)
diff --git a/gnu/home-services/mcron.scm b/gnu/home/services/mcron.scm
similarity index 98%
rename from gnu/home-services/mcron.scm
rename to gnu/home/services/mcron.scm
index fdfde179a5..cc6faac47f 100644
--- a/gnu/home-services/mcron.scm
+++ b/gnu/home/services/mcron.scm
@@ -17,11 +17,11 @@
 ;;; 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 mcron)
+(define-module (gnu home services mcron)
   #:use-module (gnu packages guile-xyz)
   #:use-module (gnu home-services)
-  #:use-module (gnu home-services shepherd)
   #:use-module (gnu services shepherd)
+  #:use-module (gnu home services shepherd)
   #:use-module (guix records)
   #:use-module (guix gexp)
   #:use-module (srfi srfi-1)
diff --git a/gnu/home-services/shells.scm b/gnu/home/services/shells.scm
similarity index 99%
rename from gnu/home-services/shells.scm
rename to gnu/home/services/shells.scm
index ecb02098f7..2308371dd0 100644
--- a/gnu/home-services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -17,10 +17,10 @@
 ;;; 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 shells)
+(define-module (gnu home services shells)
   #:use-module (gnu services configuration)
-  #:use-module (gnu home-services configuration)
-  #:use-module (gnu home-services utils)
+  #:use-module (gnu home services configuration)
+  #:use-module (gnu home services utils)
   #:use-module (gnu home-services)
   #:use-module (gnu packages shells)
   #:use-module (gnu packages bash)
diff --git a/gnu/home-services/shepherd.scm b/gnu/home/services/shepherd.scm
similarity index 99%
rename from gnu/home-services/shepherd.scm
rename to gnu/home/services/shepherd.scm
index 120cfde1a1..1a3e849bb2 100644
--- a/gnu/home-services/shepherd.scm
+++ b/gnu/home/services/shepherd.scm
@@ -17,7 +17,7 @@
 ;;; 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 shepherd)
+(define-module (gnu home services shepherd)
   #:use-module (gnu home-services)
   #:use-module (gnu packages admin)
   #:use-module (gnu services shepherd)
diff --git a/gnu/home-services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
similarity index 99%
rename from gnu/home-services/symlink-manager.scm
rename to gnu/home/services/symlink-manager.scm
index 11f5d503d4..d53e8f5046 100644
--- a/gnu/home-services/symlink-manager.scm
+++ b/gnu/home/services/symlink-manager.scm
@@ -17,7 +17,7 @@
 ;;; 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 symlink-manager)
+(define-module (gnu home services symlink-manager)
   #:use-module (gnu home-services)
   #:use-module (guix gexp)
 
diff --git a/gnu/home-services/utils.scm b/gnu/home/services/utils.scm
similarity index 98%
rename from gnu/home-services/utils.scm
rename to gnu/home/services/utils.scm
index f13133a7ae..cea75ee896 100644
--- a/gnu/home-services/utils.scm
+++ b/gnu/home/services/utils.scm
@@ -17,7 +17,7 @@
 ;;; 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 utils)
+(define-module (gnu home services utils)
   #:use-module (ice-9 string-fun)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
diff --git a/gnu/home-services/xdg.scm b/gnu/home/services/xdg.scm
similarity index 99%
rename from gnu/home-services/xdg.scm
rename to gnu/home/services/xdg.scm
index 94275f3b65..4aed9a5803 100644
--- a/gnu/home-services/xdg.scm
+++ b/gnu/home/services/xdg.scm
@@ -17,12 +17,12 @@
 ;;; 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 xdg)
+(define-module (gnu home services xdg)
   #:use-module (gnu services configuration)
-  #:use-module (gnu home-services configuration)
+  #:use-module (gnu home services configuration)
   #:use-module (gnu home-services)
   #:use-module (gnu packages freedesktop)
-  #:use-module (gnu home-services utils)
+  #:use-module (gnu home services utils)
   #:use-module (guix gexp)
   #:use-module (guix records)
   #:use-module (guix i18n)
diff --git a/gnu/local.mk b/gnu/local.mk
index d415b892e9..5e8b769ce9 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -75,14 +75,14 @@ GNU_SYSTEM_MODULES =				\
   %D%/ci.scm					\
   %D%/home.scm					\
   %D%/home-services.scm			\
-  %D%/home-services/symlink-manager.scm	\
-  %D%/home-services/fontutils.scm		\
-  %D%/home-services/configuration.scm		\
-  %D%/home-services/shells.scm			\
-  %D%/home-services/shepherd.scm		\
-  %D%/home-services/mcron.scm			\
-  %D%/home-services/utils.scm			\
-  %D%/home-services/xdg.scm			\
+  %D%/home/services/symlink-manager.scm		\
+  %D%/home/services/fontutils.scm		\
+  %D%/home/services/configuration.scm		\
+  %D%/home/services/shells.scm			\
+  %D%/home/services/shepherd.scm		\
+  %D%/home/services/mcron.scm			\
+  %D%/home/services/utils.scm			\
+  %D%/home/services/xdg.scm			\
   %D%/image.scm					\
   %D%/packages.scm				\
   %D%/packages/abduco.scm			\
diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm
index 79fb23a2fd..c977ec3861 100644
--- a/guix/scripts/home/import.scm
+++ b/guix/scripts/home/import.scm
@@ -41,7 +41,7 @@
   (let ((rc (string-append (getenv "HOME") "/.bashrc"))
         (profile (string-append (getenv "HOME") "/.bash_profile"))
         (logout (string-append (getenv "HOME") "/.bash_logout")))
-    `((gnu home-services bash)
+    `((gnu home services bash)
       (service home-bash-service-type
                  (home-bash-configuration
                   ,@(if (file-exists? rc)
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Mon, 04 Oct 2021 23:15:02 GMT) Full text and rfc822 format available.

Message #125 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Xinglu Chen <public <at> yoctocell.xyz>, Andrew Tropin <andrew <at> trop.in>
Subject: [PATCH 3/3] guix: scripts: Make sure profile directory exists.
Date: Tue,  5 Oct 2021 02:13:31 +0300
* guix/scripts/home.scm (process-action): Make sure profile directory exists.
* tests/guix-home.sh: New file.
* Makefile.am (SH_TESTS): Add this.
---
 Makefile.am           |  1 +
 guix/scripts/home.scm |  2 ++
 tests/guix-home.sh    | 73 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 76 insertions(+)
 create mode 100644 tests/guix-home.sh

diff --git a/Makefile.am b/Makefile.am
index b66789fa0b..5bf2567dc8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -546,6 +546,7 @@ SH_TESTS =					\
   tests/guix-package-aliases.sh			\
   tests/guix-package-net.sh			\
   tests/guix-system.sh				\
+  tests/guix-home.sh				\
   tests/guix-archive.sh				\
   tests/guix-authenticate.sh			\
   tests/guix-environment.sh			\
diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm
index 75df6d707d..115dfadb57 100644
--- a/guix/scripts/home.scm
+++ b/guix/scripts/home.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
 ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
+;;; Copyright © 2021 Oleg Pykhalov <go.wigust <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -179,6 +180,7 @@ ACTION must be one of the sub-commands that takes a home environment
 declaration as an argument (a file name.)  OPTS is the raw alist of options
 resulting from command-line parsing."
   (define (ensure-home-environment file-or-exp obj)
+    (ensure-profile-directory)
     (unless (home-environment? obj)
       (leave (G_ "'~a' does not return a home environment ~%")
              file-or-exp))
diff --git a/tests/guix-home.sh b/tests/guix-home.sh
new file mode 100644
index 0000000000..e79982b7f7
--- /dev/null
+++ b/tests/guix-home.sh
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+# GNU Guix --- Functional package management for GNU
+# Copyright © 2021 Oleg Pykhalov <go.wigust <at> gmail.com>
+#
+# 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/>.
+
+#
+# Test the 'guix home' using the external store, if any.
+#
+
+guix home --version
+
+NIX_STORE_DIR="$(guile -c '(use-modules (guix config))(display %storedir)')"
+localstatedir="$(guile -c '(use-modules (guix config))(display %localstatedir)')"
+GUIX_DAEMON_SOCKET="$localstatedir/guix/daemon-socket/socket"
+export NIX_STORE_DIR GUIX_DAEMON_SOCKET
+
+# Run tests only when a "real" daemon is available.
+if ! guile -c '(use-modules (guix)) (exit (false-if-exception (open-connection)))'
+then
+    exit 77
+fi
+
+STORE_PARENT="$(dirname "$NIX_STORE_DIR")"
+export STORE_PARENT
+if test "$STORE_PARENT" = "/"; then exit 77; fi
+
+test_directory="$(mktemp -d)"
+export test_directory
+trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT
+
+(
+    cd "$test_directory" || exit 77
+
+    cat > "dot-bashrc" <<'EOF'
+# dot-bashrc test file for guix home
+EOF
+
+    cat > "home.scm" <<'EOF'
+(use-modules (gnu home)
+             (gnu home-services)
+             (gnu home services shells)
+             (gnu services)
+             (guix gexp))
+
+(home-environment
+ (services
+  (list
+   (service home-bash-service-type
+            (home-bash-configuration
+             (guix-defaults? #t)
+             (bashrc
+              (list
+               (local-file (string-append (dirname (current-filename))
+                                          "/dot-bashrc")))))))))
+EOF
+)
+
+guix home reconfigure "${test_directory}/home.scm"
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Tue, 05 Oct 2021 10:21:02 GMT) Full text and rfc822 format available.

Message #128 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Xinglu Chen <public <at> yoctocell.xyz>, Andrew Tropin <andrew <at> trop.in>
Subject: Re: [PATCH 3/3] guix: scripts: Make sure profile directory exists.
Date: Tue, 05 Oct 2021 13:20:32 +0300
[Message part 1 (text/plain, inline)]
Oleg Pykhalov <go.wigust <at> gmail.com> writes:

> * guix/scripts/home.scm (process-action): Make sure profile directory exists.
> * tests/guix-home.sh: New file.
> * Makefile.am (SH_TESTS): Add this.
> ---
>  Makefile.am           |  1 +
>  guix/scripts/home.scm |  2 ++
>  tests/guix-home.sh    | 73 +++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 76 insertions(+)
>  create mode 100644 tests/guix-home.sh
>
> diff --git a/Makefile.am b/Makefile.am
> index b66789fa0b..5bf2567dc8 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -546,6 +546,7 @@ SH_TESTS =					\
>    tests/guix-package-aliases.sh			\
>    tests/guix-package-net.sh			\
>    tests/guix-system.sh				\
> +  tests/guix-home.sh				\
>    tests/guix-archive.sh				\
>    tests/guix-authenticate.sh			\
>    tests/guix-environment.sh			\
> diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm
> index 75df6d707d..115dfadb57 100644
> --- a/guix/scripts/home.scm
> +++ b/guix/scripts/home.scm
> @@ -1,6 +1,7 @@
>  ;;; GNU Guix --- Functional package management for GNU
>  ;;; Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
>  ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
> +;;; Copyright © 2021 Oleg Pykhalov <go.wigust <at> gmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -179,6 +180,7 @@ ACTION must be one of the sub-commands that takes a home environment
>  declaration as an argument (a file name.)  OPTS is the raw alist of options
>  resulting from command-line parsing."
>    (define (ensure-home-environment file-or-exp obj)
> +    (ensure-profile-directory)
>      (unless (home-environment? obj)
>        (leave (G_ "'~a' does not return a home environment ~%")
>               file-or-exp))
> diff --git a/tests/guix-home.sh b/tests/guix-home.sh
> new file mode 100644
> index 0000000000..e79982b7f7
> --- /dev/null
> +++ b/tests/guix-home.sh
> @@ -0,0 +1,73 @@
> +#!/bin/sh
> +
> +# GNU Guix --- Functional package management for GNU
> +# Copyright © 2021 Oleg Pykhalov <go.wigust <at> gmail.com>
> +#

[…]

Well, guix home reconfigure will break your ~/.bashrc.  Sorry.

Don't use this "test".
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Wed, 06 Oct 2021 08:16:02 GMT) Full text and rfc822 format available.

Message #131 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Ludovic Courtès <ludo <at> gnu.org>, Xinglu Chen
 <public <at> yoctocell.xyz>
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, 50967 <at> debbugs.gnu.org
Subject: [bug#50967] file-like objects instead of gexps
Date: Wed, 06 Oct 2021 11:15:31 +0300
[Message part 1 (text/plain, inline)]
On 2021-10-04 16:04, Ludovic Courtès wrote:

> Xinglu Chen <public <at> yoctocell.xyz> skribis:
>
>> On Sat, Oct 02 2021, Oleg Pykhalov wrote:
>>
>>> * gnu/home/services/configuration.scm (interpose): Include content of files.
>>> (string-or-gexp?): Rename to 'file-or-string-or-gexp?' and check for file-like
>>> object.
>>
>> I would call it ‘file-like-or-string-or-gexp?’, just ‘files’ doesn’t
>> really make it clear that it should be a “file-like object”.
>
> As a matter of API, I would make it monomorphic: accept a file-like
> object, period.  This is what’s done for System services (and
> polymorphic APIs are rare in general in Guix).

At least some of system services are far from ideal, recently I tried to
add rtmp section to nginx configuration using nginx system service.  I
had two options and both does look hacky, I could use extra-content
starting with closing curly bracket:

--8<---------------cut here---------------start------------->8---
(service nginx-service-type
         (nginx-configuration
          (modules
           (list
            (file-append nginx-rtmp-module "\
/etc/nginx/modules/ngx_rtmp_module.so")))
          (extra-content
           (format #f "\
}
rtmp {
        server {
                listen 1935;
                chunk_size 4096;

                application live {
                        live on;
                        record off;
                        push rtmp://a.rtmp.youtube.com/live2/~a;
                        push rtmp://diode.zone:1935/live/~a;
                }
        }
" youtube-key peertube-key))

          (server-blocks
           (list (nginx-server-configuration
                  ;; (locations
                  ;;  (list
                  ;;   (nginx-location-configuration
                  ;;    (uri "/stat")
                  ;;    (body '("rtmp_stat all;"
                  ;;            "rtmp_stat_stylesheet stat.xsl;")))))
                  (server-name `(,ip))
                  (listen '("8088"))
                  (root "/var/www/"))))))
--8<---------------cut here---------------end--------------->8---

or use file field of nginx-configuration record and generate the whole
configuration myself inside computed-file, loosing all the benifits of
other nginx-configuration fields.

Personally, I don't find both of these approaches appealing and
convenient.  Maybe it's an issue of exact system service, but the way
the configuration for this service is implemented is getting in the way
of the user.

>
> ‘plain-file’ and ‘scheme-file’ allow users to “convert” a string or a
> gexp into a file-like object.
>
> WDYT?
>
> Ludo’.
>
>
>

Imagine the following use case: I want to create a home service, which
accepts a package (zsh plugin) and adds a code for loading this package
to zshrc, currently it's implemented like that:

https://git.sr.ht/~abcdw/rde/tree/69dd2baf0384c899a4a4f97bdac8bf0b6e499b82/item/gnu/home-services/shellutils.scm#L18

Exteding the service above with `(list zsh-autosuggestions)` will add
the following line to zshrc:

source /gnu/store/w7d43gk1qszplj9i0rkzqvzz6kp88qfm-zsh-autosuggestions-0.7.0/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh

Or the same thing can be done manually by user:

--8<---------------cut here---------------start------------->8---
(service
 home-zsh-service-type
 (home-zsh-configuration
  (zshrc
   (list
    #~(string-append "source " #$zsh-autosuggestions "/share/zs../..ions.zsh")
    ;; or
    "source \\"
    (file-append zsh-autosuggestions "/share/zs../..ions.zsh")))))
--8<---------------cut here---------------end--------------->8---

gexps returns a string, file-like object returns a path to the file in
the store, kinda expected behavior.  Both implementations looks quite
simple.


Now I'll try to reimplement it with file-like objects.  The code below
is a pseudo code, but should demonstrate the overall concerns I have:

--8<---------------cut here---------------start------------->8---
;; Some generic functions
(define get-file-like-object-path (file-like)
  "Because all file-like object get inserted literally by home services,
we need a function, which returns a file, which contains a path to the
file."
  (computed-file
   "tmp-file"
   #~#$file-like))

(define fl-append-strings (lst)
  "Accepts a list of strings and file-like object, reads the content of
the file-like objects (to be consistent with behavior of home services
configuration)."
  (define file-like->str (mb-file-like)
    (if (string? mb-file-like)
        mb-file-like
        #~(begin
            (use-modules (ice-9 rdelim))
            (with-fluids ((%default-port-encoding "UTF-8"))
              (with-input-from-file #$mb-file-like read-string)))))
  (computed-file
   "tmp-file"
   #~(apply string-append '#$(map file-like->str lst))))


;; A home service, declared in home-environment.
(service
 home-zsh-service-type
 (home-zsh-configuration
  (zshrc
   (list
    (fl-append-strings
     (list
      "source "
      (get-file-like-object-path zsh-autosuggestions)
      "/share/zs../..ions.zsh"))
    ;; or
    "source \\"
    (get-file-like-object-path
     (file-append zsh-autosuggestions "/share/zs../..ions.zsh"))))))
--8<---------------cut here---------------end--------------->8---

Here we don't use gexps inside configuration and all file-like objects
are "expanded" as their content instead of path in the store.

It can work, but looks a little strange and hard to copmose.  Perhaps, I
miss something and doesn't see the whole picture, but for now expanding
file-like objects to their content and throwing out gexps doesn't look
appealing to me.

BTW, I've skimmed through the paper "Code Staging in GNU Guix" and
limitations section, still not sure what your concerns are, I'll try to
re-read the paper and your message <87pmvqckws.fsf <at> gnu.org> one more
time a few days later to better understand it.  If you have a spare
time, please make a simple code snippet, which demonstrates the problem
you've mentioned in the message, which will hit the users of home
services.  It will help me to figure out possible shortcommings and
better understand the problem.

Ludovic, sorry for spending your time on that, but I really need to
understand this thing better.  Thank you in advance for hepling on that.

Oleg, thank you for working on this patch series, much appreciate)


-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Wed, 06 Oct 2021 21:23:02 GMT) Full text and rfc822 format available.

Message #134 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: Xinglu Chen <public <at> yoctocell.xyz>, 50967 <at> debbugs.gnu.org,
 Andrew Tropin <andrew <at> trop.in>
Subject: Re: bug#50967: [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Wed, 06 Oct 2021 23:22:11 +0200
Hi,

Oleg Pykhalov <go.wigust <at> gmail.com> skribis:

> Well, guix home reconfigure will break your ~/.bashrc.  Sorry.

Ah, thanks for letting us know.  :-)

Perhaps you need to set HOME before, or is there another way you could
achieve that?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Wed, 06 Oct 2021 22:07:02 GMT) Full text and rfc822 format available.

Message #137 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 zimoun <zimon.toutoune <at> gmail.com>, Xinglu Chen <public <at> yoctocell.xyz>,
 Andrew Tropin <andrew <at> trop.in>
Subject: Re: [PATCH 3/3] guix: scripts: Make sure profile directory exists.
Date: Thu, 07 Oct 2021 01:05:41 +0300
[Message part 1 (text/plain, inline)]
This patch fixes user's files corruption.  Also, I applied suggestions
about commit message, thanks zimoun!
[0001-scripts-home-Make-sure-profile-directory-exists.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Wed, 06 Oct 2021 22:16:02 GMT) Full text and rfc822 format available.

Message #140 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Andrew Tropin <andrew <at> trop.in>, Xinglu Chen <public <at> yoctocell.xyz>,
 zimoun <zimon.toutoune <at> gmail.com>
Subject: Re: bug#50967: [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Thu, 07 Oct 2021 01:15:37 +0300
[Message part 1 (text/plain, inline)]
Oleg Pykhalov <go.wigust <at> gmail.com> writes:

> This patch fixes user's files corruption.  Also, I applied suggestions
> about commit message, thanks zimoun!

Also, in addion I forget to:

Replace '#!/usr/bin/env bash' with '#!/bin/bash'

Maybe a /bin/sh would be more Guix friendly, but shellcheck warns about
export -f does not exist in posix shell.  Thoughts are welcome ;-)


Remove a unnecessary subshell in run_guix_home_without_home.


[0001-scripts-home-Make-sure-profile-directory-exists.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Thu, 07 Oct 2021 06:38:01 GMT) Full text and rfc822 format available.

Message #143 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Oleg Pykhalov <go.wigust <at> gmail.com>, 50967 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 zimoun <zimon.toutoune <at> gmail.com>, Xinglu Chen <public <at> yoctocell.xyz>,
 Andrew Tropin <andrew <at> trop.in>
Subject: Re: [bug#50967] [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Thu, 07 Oct 2021 08:37:02 +0200
[Message part 1 (text/plain, inline)]
Oleg Pykhalov schreef op do 07-10-2021 om 01:15 [+0300]:
> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
> 
> > This patch fixes user's files corruption.  Also, I applied suggestions
> > about commit message, thanks zimoun!
> 
> Also, in addion I forget to:
> 
> Replace '#!/usr/bin/env bash' with '#!/bin/bash'
> 
> Maybe a /bin/sh would be more Guix friendly, but shellcheck warns about
> export -f does not exist in posix shell.  Thoughts are welcome ;-)

/bin/bash doesn't exist on Guix System, so it seems a bit weird to me
to use that in Guix.  Anyway, I think shellcheck should classify
'#!/usr/bin/env bash' as a bash shell instead of a posix shell?

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Thu, 07 Oct 2021 09:57:02 GMT) Full text and rfc822 format available.

Message #146 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 50967 <at> debbugs.gnu.org
Subject: Re: [bug#50967] [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Thu, 07 Oct 2021 12:56:40 +0300
[Message part 1 (text/plain, inline)]
Maxime Devos <maximedevos <at> telenet.be> writes:

[…]

>> Replace '#!/usr/bin/env bash' with '#!/bin/bash'
>> 
>> Maybe a /bin/sh would be more Guix friendly, but shellcheck warns about
>> export -f does not exist in posix shell.  Thoughts are welcome ;-)
>
> /bin/bash doesn't exist on Guix System, so it seems a bit weird to me
> to use that in Guix.  Anyway, I think shellcheck should classify
> '#!/usr/bin/env bash' as a bash shell instead of a posix shell?

Yes, also /usr/bin/env does not exist on Guix as well.  So in that sense
both /bin/bash and /usr/bin/env bash are equal.

I see special-files-service-type has an example about creating
/usr/bin/env, so probable should use /usr/bin/env bash in test's
shebang line to make shellcheck happy.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Thu, 07 Oct 2021 16:44:01 GMT) Full text and rfc822 format available.

Message #149 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 50967 <at> debbugs.gnu.org
Subject: Re: [bug#50967] [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Thu, 07 Oct 2021 18:43:19 +0200
[Message part 1 (text/plain, inline)]
Oleg Pykhalov schreef op do 07-10-2021 om 12:56 [+0300]:
> Maxime Devos <maximedevos <at> telenet.be> writes:
> 
> […]
> 
> > > Replace '#!/usr/bin/env bash' with '#!/bin/bash'
> > > 
> > > Maybe a /bin/sh would be more Guix friendly, but shellcheck warns about
> > > export -f does not exist in posix shell.  Thoughts are welcome ;-)
> > 
> > /bin/bash doesn't exist on Guix System, so it seems a bit weird to me
> > to use that in Guix.  Anyway, I think shellcheck should classify
> > '#!/usr/bin/env bash' as a bash shell instead of a posix shell?
> 
> Yes, also /usr/bin/env does not exist on Guix as well.  So in that sense
> both /bin/bash and /usr/bin/env bash are equal.

It does exist:

$ ls /usr/bin/env
/usr/bin/env

It's supposed to be possible to do without on Guix System though, by removing it
from %base-services.

FWIW, the shell scripts in tests/*.sh do not have a shebang.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Fri, 08 Oct 2021 07:57:02 GMT) Full text and rfc822 format available.

Message #152 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Andrew Tropin <andrew <at> trop.in>
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, Xinglu Chen <public <at> yoctocell.xyz>,
 50967 <at> debbugs.gnu.org
Subject: Re: [bug#50967] file-like objects instead of gexps
Date: Fri, 08 Oct 2021 09:56:11 +0200
Hi Andrew,

Andrew Tropin <andrew <at> trop.in> skribis:

> On 2021-10-04 16:04, Ludovic Courtès wrote:
>
>> Xinglu Chen <public <at> yoctocell.xyz> skribis:
>>
>>> On Sat, Oct 02 2021, Oleg Pykhalov wrote:
>>>
>>>> * gnu/home/services/configuration.scm (interpose): Include content of files.
>>>> (string-or-gexp?): Rename to 'file-or-string-or-gexp?' and check for file-like
>>>> object.
>>>
>>> I would call it ‘file-like-or-string-or-gexp?’, just ‘files’ doesn’t
>>> really make it clear that it should be a “file-like object”.
>>
>> As a matter of API, I would make it monomorphic: accept a file-like
>> object, period.  This is what’s done for System services (and
>> polymorphic APIs are rare in general in Guix).
>
> At least some of system services are far from ideal, recently I tried to
> add rtmp section to nginx configuration using nginx system service.

I agree that nginx config is problematic:

  https://issues.guix.gnu.org/37388

But IMO that’s off-topic.  :-)

> Imagine the following use case: I want to create a home service, which
> accepts a package (zsh plugin) and adds a code for loading this package
> to zshrc, currently it's implemented like that:
>
> https://git.sr.ht/~abcdw/rde/tree/69dd2baf0384c899a4a4f97bdac8bf0b6e499b82/item/gnu/home-services/shellutils.scm#L18
>
> Exteding the service above with `(list zsh-autosuggestions)` will add
> the following line to zshrc:
>
> source /gnu/store/w7d43gk1qszplj9i0rkzqvzz6kp88qfm-zsh-autosuggestions-0.7.0/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh

OK.

Then that’s fine: you can have special code that emits those “source”
lines in .zshrc while still allowing users to provide their own
file-like object for .zshrc lines they want to add.  Again, see how
‘torrc’ is generated in ‘tor-service-type’.

I’m happy to discuss specific service examples in mode details if you
want.  Overall, I’m confident Home services don’t require any pattern
that’s not already found in one of the many System services.  :-)

HTH,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Fri, 08 Oct 2021 10:01:02 GMT) Full text and rfc822 format available.

Message #155 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, Xinglu Chen <public <at> yoctocell.xyz>,
 50967 <at> debbugs.gnu.org
Subject: Re: [bug#50967] file-like objects instead of gexps
Date: Fri, 08 Oct 2021 13:00:14 +0300
[Message part 1 (text/plain, inline)]
On 2021-10-08 09:56, Ludovic Courtès wrote:

> Hi Andrew,
>
> Andrew Tropin <andrew <at> trop.in> skribis:
>
>> On 2021-10-04 16:04, Ludovic Courtès wrote:
>>
>>> Xinglu Chen <public <at> yoctocell.xyz> skribis:
>>>
>>>> On Sat, Oct 02 2021, Oleg Pykhalov wrote:
>>>>
>>>>> * gnu/home/services/configuration.scm (interpose): Include content of files.
>>>>> (string-or-gexp?): Rename to 'file-or-string-or-gexp?' and check for file-like
>>>>> object.
>>>>
>>>> I would call it ‘file-like-or-string-or-gexp?’, just ‘files’ doesn’t
>>>> really make it clear that it should be a “file-like object”.
>>>
>>> As a matter of API, I would make it monomorphic: accept a file-like
>>> object, period.  This is what’s done for System services (and
>>> polymorphic APIs are rare in general in Guix).
>>
>> At least some of system services are far from ideal, recently I tried to
>> add rtmp section to nginx configuration using nginx system service.
>
> I agree that nginx config is problematic:
>
>   https://issues.guix.gnu.org/37388
>
> But IMO that’s off-topic.  :-)
>

Even not taking into account that ngixn-configuration is not ideally
implemented, probably it still relevant:

1. Highlights the problem of current service configuration
implementation approach with records: we will need to mimic the whole
underlying configuration language with records, for some small languages
it's possible, but in general it's very thankless job, which also force
use to keep an eye on upstream configuration language, possible
extensions to it and keep our implementation in sync.  In addition to
that in most cases provided set of nested records requires destructuring
and custom serialization code.

Other system services also affected by this issue.

2. Usage of separate config-file fields with file-like object values is
problematic:

For nginx service it substitutes the whole file, for tor service it will
be inserted at the end of the file for service X it will be inserted at
the middle.


Using a slightly different approach, implemented in many home services
we get ultimate configuration flexibility, we don't need to handle
existing file as some special case, create a separate field for it and
wonder where it should be inserted, when provided.

I'll provide more details in a separate thread, but for now just take a
look at too implementations of sway services using both approaches:

https://notabug.org/jbranso/guix-config/src/master/sway-service.scm#L110
https://git.sr.ht/~abcdw/rde/tree/master/item/gnu/home-services/wm.scm#L33

>> Imagine the following use case: I want to create a home service, which
>> accepts a package (zsh plugin) and adds a code for loading this package
>> to zshrc, currently it's implemented like that:
>>
>> https://git.sr.ht/~abcdw/rde/tree/69dd2baf0384c899a4a4f97bdac8bf0b6e499b82/item/gnu/home-services/shellutils.scm#L18
>>
>> Exteding the service above with `(list zsh-autosuggestions)` will add
>> the following line to zshrc:
>>
>> source /gnu/store/w7d43gk1qszplj9i0rkzqvzz6kp88qfm-zsh-autosuggestions-0.7.0/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
>
> OK.
>
> Then that’s fine: you can have special code that emits those “source”
> lines in .zshrc while still allowing users to provide their own
> file-like object for .zshrc lines they want to add.  Again, see how
> ‘torrc’ is generated in ‘tor-service-type’.

From what I understand you want a separate bashrc-file,
bash-profile-file and bash-logout-file fields to be present, but where
the content of those files should be inserted?  At the beginning/end or
instead of the rest of configuration?

We already can achieve the same result by providing gexp, which will
read the content of the file-like object, a very small helper for that
(slurp-file-gexp) makes it even easier to do.  Such approach is more
flexible and doesn't seem much harder.

I remember that you had concerns about slurp-file-gexp, but still don't
understand what exactly you are concerned about.

>
> I’m happy to discuss specific service examples in mode details if you
> want.  Overall, I’m confident Home services don’t require any pattern
> that’s not already found in one of the many System services.  :-)
>
> HTH,
> Ludo’.

I'll write a few examples of service configurations and rationale behind
the design descisions for that next week, to make the discussion more
practically oriented.


-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Fri, 08 Oct 2021 11:50:02 GMT) Full text and rfc822 format available.

Message #158 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrewtropin <at> gmail.com>
To: Oleg Pykhalov <go.wigust <at> gmail.com>, 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: Re: [bug#50967] [PATCH 13/14] home: services: configuration:
 Support file-like objects.
Date: Fri, 08 Oct 2021 13:06:02 +0300
[Message part 1 (text/plain, inline)]
On 2021-10-02 19:38, Oleg Pykhalov wrote:

> * gnu/home/services/configuration.scm (interpose): Include content of files.
> (string-or-gexp?): Rename to 'file-or-string-or-gexp?' and check for file-like
> object.
> (serialize-string-or-gexp): Rename to 'serialize-file-or-string-or-gexp'.
> (text-config?): Call 'file-or-string-or-gexp?' intead of 'string-or-gexp?'.
> * guix/scripts/home/import.scm:
> (generate-bash-module+configuration): Don't call slurp-file-gexp.
> ---
>  gnu/home/services/configuration.scm | 14 ++++++++++----
>  guix/scripts/home/import.scm        |  8 +++-----
>  2 files changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/gnu/home/services/configuration.scm b/gnu/home/services/configuration.scm
> index 5e7743e7d6..39db7a5693 100644
> --- a/gnu/home/services/configuration.scm
> +++ b/gnu/home/services/configuration.scm
> @@ -59,7 +59,12 @@ DELIMITER interposed LS.  Support 'infix and 'suffix GRAMMAR values."
>        (G_ "The GRAMMAR value must be 'infix or 'suffix, but ~a provided.")
>        grammar)))
>    (fold-right (lambda (e acc)
> -		(cons e
> +		(cons (if (file-like? e)
> +                          #~(begin
> +                              (use-modules (ice-9 rdelim))
> +                              (with-fluids ((%default-port-encoding "UTF-8"))
> +                                (with-input-from-file #$e read-string)))
> +                          e)
>  		      (if (and (null? acc) (eq? grammar 'infix))
>  			  acc
>  			  (cons delimiter acc))))
> @@ -79,11 +84,12 @@ the list result in @code{#t} when applying PRED? on them."
>  
>  (define alist? list?)
>  
> -(define (string-or-gexp? sg) (or (string? sg) (gexp? sg)))
> -(define (serialize-string-or-gexp field-name val) "")
> +(define (file-or-string-or-gexp? fsg)
> +  (or (string? fsg) (gexp? fsg) (file-like? fsg)))
> +(define (serialize-file-or-string-or-gexp field-name val) "")
>  
>  (define (text-config? config)
> -  (and (list? config) (every string-or-gexp? config)))
> +  (and (list? config) (every file-or-string-or-gexp? config)))
>  (define (serialize-text-config field-name val)
>    #~(string-append #$@(interpose val "\n" 'suffix)))
>  
> diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm
> index c977ec3861..611f580e85 100644
> --- a/guix/scripts/home/import.scm
> +++ b/guix/scripts/home/import.scm
> @@ -46,17 +46,15 @@
>                   (home-bash-configuration
>                    ,@(if (file-exists? rc)
>                          `((bashrc
> -                           (list (slurp-file-gexp (local-file ,rc)))))
> +                           (list (local-file ,rc))))
>                          '())
>                    ,@(if (file-exists? profile)
>                          `((bash-profile
> -                           (list (slurp-file-gexp
> -                                  (local-file ,profile)))))
> +                           (list (local-file ,profile))))
>                          '())
>                    ,@(if (file-exists? logout)
>                          `((bash-logout
> -                           (list (slurp-file-gexp
> -                                  (local-file ,logout)))))
> +                           (list (local-file ,logout))))
>                          '()))))))

I think this patch requires more discussion and better to keep it
outside of this patch series.  Skimmed throught other patches, overall
LGTM.

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Fri, 08 Oct 2021 12:45:02 GMT) Full text and rfc822 format available.

Message #161 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Xinglu Chen <public <at> yoctocell.xyz>, Andrew Tropin <andrew <at> trop.in>
Subject: Re: bug#50967: [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Fri, 08 Oct 2021 15:44:32 +0300
[Message part 1 (text/plain, inline)]
Oleg Pykhalov <go.wigust <at> gmail.com> writes:

> * gnu/home-services/configuration.scm: Move the content ...
> ...
> * gnu/home-services.scm: Update documentation string.
> ---
>  doc/guix.texi                                    |  8 ++++----
>  doc/he-config-bare-bones.scm                     |  2 +-
>  gnu/home-services.scm                            |  4 ++--
>  gnu/home.scm                                     |  8 ++++----
>  .../services}/configuration.scm                  |  2 +-
>  .../services}/fontutils.scm                      |  2 +-
>  gnu/{home-services => home/services}/mcron.scm   |  4 ++--
>  gnu/{home-services => home/services}/shells.scm  |  6 +++---
>  .../services}/shepherd.scm                       |  2 +-
>  .../services}/symlink-manager.scm                |  2 +-
>  gnu/{home-services => home/services}/utils.scm   |  2 +-
>  gnu/{home-services => home/services}/xdg.scm     |  6 +++---
>  gnu/local.mk                                     | 16 ++++++++--------

[…]

I pushed only this patch to master.


[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Fri, 08 Oct 2021 13:47:01 GMT) Full text and rfc822 format available.

Message #164 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Xinglu Chen <public <at> yoctocell.xyz>
To: Andrew Tropin <andrew <at> trop.in>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, 50967 <at> debbugs.gnu.org
Subject: Re: [bug#50967] file-like objects instead of gexps
Date: Fri, 08 Oct 2021 15:45:51 +0200
[Message part 1 (text/plain, inline)]
On Wed, Oct 06 2021, Andrew Tropin wrote:

> Imagine the following use case: I want to create a home service, which
> accepts a package (zsh plugin) and adds a code for loading this package
> to zshrc, currently it's implemented like that:
>
> https://git.sr.ht/~abcdw/rde/tree/69dd2baf0384c899a4a4f97bdac8bf0b6e499b82/item/gnu/home-services/shellutils.scm#L18
>
> Exteding the service above with `(list zsh-autosuggestions)` will add
> the following line to zshrc:
>
> source /gnu/store/w7d43gk1qszplj9i0rkzqvzz6kp88qfm-zsh-autosuggestions-0.7.0/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
>
> Or the same thing can be done manually by user:
>
> --8<---------------cut here---------------start------------->8---
> (service
>  home-zsh-service-type
>  (home-zsh-configuration
>   (zshrc
>    (list
>     #~(string-append "source " #$zsh-autosuggestions "/share/zs../..ions.zsh")
>     ;; or
>     "source \\"
>     (file-append zsh-autosuggestions "/share/zs../..ions.zsh")))))
> --8<---------------cut here---------------end--------------->8---
>
> gexps returns a string, file-like object returns a path to the file in
> the store, kinda expected behavior.  Both implementations looks quite
> simple.
>
>
> Now I'll try to reimplement it with file-like objects.  The code below
> is a pseudo code, but should demonstrate the overall concerns I have:
>
> --8<---------------cut here---------------start------------->8---
> ;; Some generic functions
> (define get-file-like-object-path (file-like)
>   "Because all file-like object get inserted literally by home services,
> we need a function, which returns a file, which contains a path to the
> file."
>   (computed-file
>    "tmp-file"
>    #~#$file-like))
>
> (define fl-append-strings (lst)
>   "Accepts a list of strings and file-like object, reads the content of
> the file-like objects (to be consistent with behavior of home services
> configuration)."
>   (define file-like->str (mb-file-like)
>     (if (string? mb-file-like)
>         mb-file-like
>         #~(begin
>             (use-modules (ice-9 rdelim))
>             (with-fluids ((%default-port-encoding "UTF-8"))
>               (with-input-from-file #$mb-file-like read-string)))))
>   (computed-file
>    "tmp-file"
>    #~(apply string-append '#$(map file-like->str lst))))
>
>
> ;; A home service, declared in home-environment.
> (service
>  home-zsh-service-type
>  (home-zsh-configuration
>   (zshrc
>    (list
>     (fl-append-strings
>      (list
>       "source "
>       (get-file-like-object-path zsh-autosuggestions)
>       "/share/zs../..ions.zsh"))
>     ;; or
>     "source \\"
>     (get-file-like-object-path
>      (file-append zsh-autosuggestions "/share/zs../..ions.zsh"))))))
> --8<---------------cut here---------------end--------------->8---

Wouldn’t something like the following work

--8<---------------cut here---------------start------------->8---
(service home-zsh-service-type
         (home-zsh-configuration
          (zshrc
           (list (mixed-text-file
                  "zshrc"
                  "source "
                  (file-append zsh-autosuggestions "/share/zsh/..."))
                 (local-file "./some-zshrc")))))
--8<---------------cut here---------------end--------------->8---

and since ‘zshrc’ is already a list of file-like objects, we could
implement ‘serialize-text-config’ using something like
‘fl-append-strings’, which would read the contents of the two files and
append them.  That way users don’t have to deal with ‘fl-append-strings’
or ‘slurp-file-gexp’.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Fri, 08 Oct 2021 14:29:01 GMT) Full text and rfc822 format available.

Message #167 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Oleg Pykhalov <go.wigust <at> gmail.com>, 50967 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Xinglu Chen <public <at> yoctocell.xyz>
Subject: Re: bug#50967: [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Fri, 08 Oct 2021 17:27:52 +0300
[Message part 1 (text/plain, inline)]
On 2021-10-08 15:44, Oleg Pykhalov wrote:

> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
>
>> * gnu/home-services/configuration.scm: Move the content ...
>> ...
>> * gnu/home-services.scm: Update documentation string.
>> ---
>>  doc/guix.texi                                    |  8 ++++----
>>  doc/he-config-bare-bones.scm                     |  2 +-
>>  gnu/home-services.scm                            |  4 ++--
>>  gnu/home.scm                                     |  8 ++++----
>>  .../services}/configuration.scm                  |  2 +-
>>  .../services}/fontutils.scm                      |  2 +-
>>  gnu/{home-services => home/services}/mcron.scm   |  4 ++--
>>  gnu/{home-services => home/services}/shells.scm  |  6 +++---
>>  .../services}/shepherd.scm                       |  2 +-
>>  .../services}/symlink-manager.scm                |  2 +-
>>  gnu/{home-services => home/services}/utils.scm   |  2 +-
>>  gnu/{home-services => home/services}/xdg.scm     |  6 +++---
>>  gnu/local.mk                                     | 16 ++++++++--------
>
> […]
>
> I pushed only this patch to master.
>
>

Good.  I'll update rde home services accordingly next week.

It would be cool to notify people about this update, because they
probably already have configurations, which will break.  etc/news.scm,
message in mailing list? What is the best way to do it?

Sorry for the late idea, but don't we want gnu/home-services.scm to be
gnu/home/services.scm?  WDYT?

Also, I completely missed this:
https://git.savannah.gnu.org/cgit/guix.git/tree/guix/self.scm#n965
It should be updated.

Oleg, Thank you for working on this!)

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Fri, 08 Oct 2021 14:35:01 GMT) Full text and rfc822 format available.

Message #170 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Xinglu Chen <public <at> yoctocell.xyz>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, 50967 <at> debbugs.gnu.org
Subject: Re: [bug#50967] file-like objects instead of gexps
Date: Fri, 08 Oct 2021 17:34:04 +0300
[Message part 1 (text/plain, inline)]
On 2021-10-08 15:45, Xinglu Chen wrote:

> On Wed, Oct 06 2021, Andrew Tropin wrote:
>
>> Imagine the following use case: I want to create a home service, which
>> accepts a package (zsh plugin) and adds a code for loading this package
>> to zshrc, currently it's implemented like that:
>>
>> https://git.sr.ht/~abcdw/rde/tree/69dd2baf0384c899a4a4f97bdac8bf0b6e499b82/item/gnu/home-services/shellutils.scm#L18
>>
>> Exteding the service above with `(list zsh-autosuggestions)` will add
>> the following line to zshrc:
>>
>> source /gnu/store/w7d43gk1qszplj9i0rkzqvzz6kp88qfm-zsh-autosuggestions-0.7.0/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
>>
>> Or the same thing can be done manually by user:
>>
>> --8<---------------cut here---------------start------------->8---
>> (service
>>  home-zsh-service-type
>>  (home-zsh-configuration
>>   (zshrc
>>    (list
>>     #~(string-append "source " #$zsh-autosuggestions "/share/zs../..ions.zsh")
>>     ;; or
>>     "source \\"
>>     (file-append zsh-autosuggestions "/share/zs../..ions.zsh")))))
>> --8<---------------cut here---------------end--------------->8---
>>
>> gexps returns a string, file-like object returns a path to the file in
>> the store, kinda expected behavior.  Both implementations looks quite
>> simple.
>>
>>
>> Now I'll try to reimplement it with file-like objects.  The code below
>> is a pseudo code, but should demonstrate the overall concerns I have:
>>
>> --8<---------------cut here---------------start------------->8---
>> ;; Some generic functions
>> (define get-file-like-object-path (file-like)
>>   "Because all file-like object get inserted literally by home services,
>> we need a function, which returns a file, which contains a path to the
>> file."
>>   (computed-file
>>    "tmp-file"
>>    #~#$file-like))
>>
>> (define fl-append-strings (lst)
>>   "Accepts a list of strings and file-like object, reads the content of
>> the file-like objects (to be consistent with behavior of home services
>> configuration)."
>>   (define file-like->str (mb-file-like)
>>     (if (string? mb-file-like)
>>         mb-file-like
>>         #~(begin
>>             (use-modules (ice-9 rdelim))
>>             (with-fluids ((%default-port-encoding "UTF-8"))
>>               (with-input-from-file #$mb-file-like read-string)))))
>>   (computed-file
>>    "tmp-file"
>>    #~(apply string-append '#$(map file-like->str lst))))
>>
>>
>> ;; A home service, declared in home-environment.
>> (service
>>  home-zsh-service-type
>>  (home-zsh-configuration
>>   (zshrc
>>    (list
>>     (fl-append-strings
>>      (list
>>       "source "
>>       (get-file-like-object-path zsh-autosuggestions)
>>       "/share/zs../..ions.zsh"))
>>     ;; or
>>     "source \\"
>>     (get-file-like-object-path
>>      (file-append zsh-autosuggestions "/share/zs../..ions.zsh"))))))
>> --8<---------------cut here---------------end--------------->8---
>
> Wouldn’t something like the following work
>
> --8<---------------cut here---------------start------------->8---
> (service home-zsh-service-type
>          (home-zsh-configuration
>           (zshrc
>            (list (mixed-text-file
>                   "zshrc"
>                   "source "
>                   (file-append zsh-autosuggestions "/share/zsh/..."))
                     ^ place1
>                  (local-file "./some-zshrc")))))
                    ^ place2
> --8<---------------cut here---------------end--------------->8---
>
> and since ‘zshrc’ is already a list of file-like objects, we could
> implement ‘serialize-text-config’ using something like
> ‘fl-append-strings’, which would read the contents of the two files and
> append them.  That way users don’t have to deal with ‘fl-append-strings’
> or ‘slurp-file-gexp’.

Yep, it looks much better than what I was trying to prototype.

Still feels inconsistent that file-like object in place1 will be
evaluated to the path in the store, but in place2 to the content of the
file.

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Fri, 08 Oct 2021 22:45:02 GMT) Full text and rfc822 format available.

Message #173 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, Andrew Tropin <andrew <at> trop.in>,
 Xinglu Chen <public <at> yoctocell.xyz>, 50967 <at> debbugs.gnu.org,
 zimoun <zimon.toutoune <at> gmail.com>
Subject: Re: bug#50967: [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Sat, 09 Oct 2021 00:44:07 +0200
Maxime Devos <maximedevos <at> telenet.be> skribis:

> Oleg Pykhalov schreef op do 07-10-2021 om 01:15 [+0300]:
>> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
>> 
>> > This patch fixes user's files corruption.  Also, I applied suggestions
>> > about commit message, thanks zimoun!
>> 
>> Also, in addion I forget to:
>> 
>> Replace '#!/usr/bin/env bash' with '#!/bin/bash'
>> 
>> Maybe a /bin/sh would be more Guix friendly, but shellcheck warns about
>> export -f does not exist in posix shell.  Thoughts are welcome ;-)
>
> /bin/bash doesn't exist on Guix System,

Also, tests/*.sh are not executable and thus have no shebang; you can do
the same here.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Fri, 08 Oct 2021 22:47:01 GMT) Full text and rfc822 format available.

Message #176 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Andrew Tropin <andrew <at> trop.in>
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, Xinglu Chen <public <at> yoctocell.xyz>,
 50967 <at> debbugs.gnu.org
Subject: Re: bug#50967: [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Sat, 09 Oct 2021 00:46:28 +0200
Hi,

Andrew Tropin <andrew <at> trop.in> skribis:

> It would be cool to notify people about this update, because they
> probably already have configurations, which will break.  etc/news.scm,
> message in mailing list? What is the best way to do it?

A message on the mailing list would be nice, but IMO that’s enough.

> Sorry for the late idea, but don't we want gnu/home-services.scm to be
> gnu/home/services.scm?  WDYT?

I think so, that’d be consistent.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Fri, 08 Oct 2021 22:50:01 GMT) Full text and rfc822 format available.

Message #179 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: Xinglu Chen <public <at> yoctocell.xyz>, 50967 <at> debbugs.gnu.org,
 Andrew Tropin <andrew <at> trop.in>
Subject: Re: bug#50967: [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Sat, 09 Oct 2021 00:49:49 +0200
Hi,

Oleg Pykhalov <go.wigust <at> gmail.com> skribis:

> * gnu/home-services/configuration.scm: Move the content ...
> * gnu/home/services/configuration.scm: ... here.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Same.
> * gnu/home-services/shells.scm: Replace (gnu home-services configuration)
> with (gnu home services configuration).
> * gnu/home-services/xdg.scm: Same.
> * gnu/home-services/symlink-manager.scm: Rename to
> gnu/home/services/symlink-manager.scm.
> * gnu/local.mk: Same.
> * gnu/home.scm: Replace (gnu home-services symlink-manager) with
> (gnu home services symlink-manager).
> * gnu/home-services/utils.scm: Rename to gnu/home/services/utils.scm.
> * gnu/local.mk: Same.
> * gnu/home-services/shells.scm: Replace (gnu home-services utils) with
> (gnu home services utils).
> * gnu/home-services/xdg.scm: Same.
> * gnu/home-services/fontutils.scm: Rename to gnu/services/fontutils.scm.
> * gnu/local.mk: Same.
> * gnu/home.scm: Replace (gnu home-services fontutils) with
> (gnu services fontutils).
> * gnu/home-services/shells.scm: Rename to gnu/home/services/shells.scm.
> * gnu/local.mk: Same.
> * gnu/home.scm: Replace (gnu home-services shells) with (gnu home services shells).
> * doc/he-config-bare-bones.scm: Same.
> * gnu/home-services/xdg.scm: Rename to gnu/home/services/xdg.scm.
> * gnu/local.mk: Same.
> * gnu/home.scm: Replace (gnu home-services xdg) with (gnu home services xdg).
> * gnu/home-services/shepherd.scm: Move to gnu/home/services/shepherd.scm.
> * gnu/local.mk: Same.
> * gnu/home-services/mcron.scm: Replace (gnu home-services shepherd) with
> (gnu home services shepherd).
> * tests/guix-home.sh: Same.
> * gnu/home-services/mcron.scm: Move to gnu/home/services/mcron.scm.
> * gnu/local.mk: Same.
> * doc/guix.texi: Replace (gnu home-services mcron) with
> (gnu home services mcron).
> * guix/scripts/home/import.scm: Replace (gnu home-services bash) with
> (gnu home services bash).
> * doc/guix.texi: Replace (gnu home-services) with (gnu home services).
> * gnu/home-services.scm
> (%service-type-path): Search home services in "gnu/services".
> * gnu/home-services.scm: Update documentation string.

This part LGTM, though as Andrew suggested, I’d also rename
gnu/home-services.scm to gnu/home/services.scm.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Fri, 08 Oct 2021 22:59:02 GMT) Full text and rfc822 format available.

Message #182 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: Andrew Tropin <andrew <at> trop.in>, Xinglu Chen <public <at> yoctocell.xyz>,
 50967 <at> debbugs.gnu.org, zimoun <zimon.toutoune <at> gmail.com>
Subject: Re: bug#50967: [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Sat, 09 Oct 2021 00:57:53 +0200
Oleg Pykhalov <go.wigust <at> gmail.com> skribis:

> From eec2ab5f514ec6e156244898f8a635baf323ab70 Mon Sep 17 00:00:00 2001
> From: Oleg Pykhalov <go.wigust <at> gmail.com>
> Date: Tue, 5 Oct 2021 02:10:25 +0300
> Subject: [PATCH] scripts: home: Make sure profile directory exists.
>
> * guix/scripts/home.scm (process-action): Make sure profile directory exists.
> * tests/guix-home.sh: New file.
> * Makefile.am (SH_TESTS): Add this.

IMO the home.scm change should perhaps be a separate commit because it’s
not strictly what the test exercises.

> +++ b/tests/guix-home.sh
> @@ -0,0 +1,86 @@
> +#!/usr/bin/env bash
> +

You can remove these two lines.

> +run_guix_home_without_home()
> +{
> +    (
> +        # Save current directory (Guix source directory) for later mount
> +        test_directory="$(mktemp -d)"
> +        trap 'umount $test_directory; rmdir $test_directory' EXIT
> +        mount --bind "$PWD" "$test_directory"
> +
> +        # Make $HOME directory empty to preserve user's files
> +        mount --types tmpfs none "$HOME"
> +
> +        # Mount Guix source directory in a clean environment
> +        mkdir -p "$PWD"
> +        mount --bind "$test_directory" "$PWD"
> +        cd "$PWD" || exit 77

How about ‘set -e’ to make sure we abort as soon as things go wrong?

Also, wouldn’t it be easier to set HOME to a new directory?

> +        guix home reconfigure "${test_directory}/home.scm"

Looks like the test is not checking anything after ‘reconfigure’ has
completed.  Should it check for the presence of certain things in
~/.bashrc, for the presence of ~/.guix-home, the output of ‘guix home
describe’ maybe?

> +unshare -mrf bash -c "run_guix_home_without_home"

If we keep this strategy (rather than setting HOME), we need a check for
unprivileged user namespace support.  In
‘tests/guix-pack-relocatable.sh’, this is done by invoking “unshare -r
true” and checking the return value.

Could you send an updated patch?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 09 Oct 2021 12:35:01 GMT) Full text and rfc822 format available.

Message #185 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Andrew Tropin <andrew <at> trop.in>, Xinglu Chen <public <at> yoctocell.xyz>,
 50967 <at> debbugs.gnu.org, zimoun <zimon.toutoune <at> gmail.com>
Subject: Re: bug#50967: [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Sat, 09 Oct 2021 15:34:30 +0300
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

>> From eec2ab5f514ec6e156244898f8a635baf323ab70 Mon Sep 17 00:00:00 2001
>> From: Oleg Pykhalov <go.wigust <at> gmail.com>
>> Date: Tue, 5 Oct 2021 02:10:25 +0300
>> Subject: [PATCH] scripts: home: Make sure profile directory exists.

[…]

> Also, wouldn’t it be easier to set HOME to a new directory?
>
>> +        guix home reconfigure "${test_directory}/home.scm"

We probably should clean temporary $HOME directory with 'rm -rf' or
delete each file with 'rm' and then invoke 'rmdir' inside a Bash's
'trap'.  I fill worry about removing operations on $HOME directories.

Alternative is not to remove $HOME by calling some command and just exit
from a namespace, which will remove $HOME mounted as tmpfs after exiting
a process running the guix-home.sh test.

[…]

> Could you send an updated patch?

Also returned Andrew's 'guix home search' tests.

And 'home-bash-service-type' is replaced with 'simple-service' to not to
block the guix-home.sh test from merging in master until completion of
discussion about file-like objects.

[0001-scripts-home-Make-sure-profile-directory-exists.patch (text/x-patch, attachment)]
[0002-tests-Add-guix-home.sh.patch (text/x-patch, attachment)]
[Message part 4 (text/plain, inline)]
Oleg.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 09 Oct 2021 12:46:02 GMT) Full text and rfc822 format available.

Message #188 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: zimoun <zimon.toutoune <at> gmail.com>, Xinglu Chen <public <at> yoctocell.xyz>,
 50967 <at> debbugs.gnu.org, Andrew Tropin <andrew <at> trop.in>
Subject: Re: [bug#50967] [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Sat, 09 Oct 2021 15:45:36 +0300
[Message part 1 (text/plain, inline)]
Oleg Pykhalov <go.wigust <at> gmail.com> writes:

[…]

> We probably should clean temporary $HOME directory with 'rm -rf' or
> delete each file with 'rm' and then invoke 'rmdir' inside a Bash's
> 'trap'.  I fill worry about removing operations on $HOME directories.
>
> Alternative is not to remove $HOME by calling some command and just exit
> from a namespace, which will remove $HOME mounted as tmpfs after exiting
> a process running the guix-home.sh test.

Actually, we could just point 'rm -rf' on '$test_directory'.  :-)

[0001-tests-Add-guix-home.sh.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
Oleg.


[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 09 Oct 2021 13:36:01 GMT) Full text and rfc822 format available.

Message #191 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Andrew Tropin <andrew <at> trop.in>
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, Xinglu Chen <public <at> yoctocell.xyz>,
 50967 <at> debbugs.gnu.org
Subject: Re: [bug#50967] file-like objects instead of gexps
Date: Sat, 09 Oct 2021 15:34:48 +0200
Hi Andrew,

Preamble: Guix Home is now committed and there are bug reports coming
in.  To me, that means our discussion needs to be focused on addressing
specific issues; we’re not going to redesign Guix services in this
thread.

Andrew Tropin <andrew <at> trop.in> skribis:

[...]

>> Then that’s fine: you can have special code that emits those “source”
>> lines in .zshrc while still allowing users to provide their own
>> file-like object for .zshrc lines they want to add.  Again, see how
>> ‘torrc’ is generated in ‘tor-service-type’.
>
> From what I understand you want a separate bashrc-file,
> bash-profile-file and bash-logout-file fields to be present, but where
> the content of those files should be inserted?  At the beginning/end or
> instead of the rest of configuration?
>
> We already can achieve the same result by providing gexp, which will
> read the content of the file-like object, a very small helper for that
> (slurp-file-gexp) makes it even easier to do.  Such approach is more
> flexible and doesn't seem much harder.
>
> I remember that you had concerns about slurp-file-gexp, but still don't
> understand what exactly you are concerned about.

Let me restate my concerns:

  1. Users are unlikely to fathom what this does, given the name.  It
     will end up in user configurations, yet: “slurp”?  “gexp”?

  2. ‘slurp-file-gexp’ returns code, as a gexp.  Depending on the place
     where that gexp is inserted, it may or may not work.  Consider:

       (define (foo x)
         #~(frob '(#$x)))

       (foo (slurp-file-gexp …))  ;d’oh!

  3. Use of ‘slurp-file-gexp’ and gexps in configuration records is not
     consistent with the rest of the service APIs (and I think we can
     humbly recognize that those APIs have been doing the job for a
     while already.)

Let’s just to the (call-with-input-file file get-string-all) dance in
places where it’s needed rather than let users call ‘slurp-file-gexp’.
This is roughly what the ‘tor-service-type’ example I gave does.

> I'll write a few examples of service configurations and rationale behind
> the design descisions for that next week, to make the discussion more
> practically oriented.

People are starting to use the tool and to report bugs.  So,
unfortunately, we have to sort out interface issues quickly now.

If some of the things being discussed turn out to be too complex to
address under those time constraints, we can consider taking them out
until we have a better idea on how to address them.

How does that sound?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Sat, 09 Oct 2021 14:35:01 GMT) Full text and rfc822 format available.

Message #194 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: zimoun <zimon.toutoune <at> gmail.com>, Xinglu Chen <public <at> yoctocell.xyz>,
 50967 <at> debbugs.gnu.org, Andrew Tropin <andrew <at> trop.in>
Subject: Re: bug#50967: [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Sat, 09 Oct 2021 16:34:32 +0200
Oleg Pykhalov <go.wigust <at> gmail.com> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>>> From eec2ab5f514ec6e156244898f8a635baf323ab70 Mon Sep 17 00:00:00 2001
>>> From: Oleg Pykhalov <go.wigust <at> gmail.com>
>>> Date: Tue, 5 Oct 2021 02:10:25 +0300
>>> Subject: [PATCH] scripts: home: Make sure profile directory exists.
>
> […]
>
>> Also, wouldn’t it be easier to set HOME to a new directory?
>>
>>> +        guix home reconfigure "${test_directory}/home.scm"
>
> We probably should clean temporary $HOME directory with 'rm -rf' or
> delete each file with 'rm' and then invoke 'rmdir' inside a Bash's
> 'trap'.  I fill worry about removing operations on $HOME directories.

Like you wrote, the trap should “rm -rf $test_directory” rather than “rm
-rf $HOME”.  It’s safer.  :-)

> Also returned Andrew's 'guix home search' tests.
>
> And 'home-bash-service-type' is replaced with 'simple-service' to not to
> block the guix-home.sh test from merging in master until completion of
> discussion about file-like objects.

OK.

> From 4b29f7f1592f4256c7cd628624d2225e2d427a9d Mon Sep 17 00:00:00 2001
> From: Oleg Pykhalov <go.wigust <at> gmail.com>
> Date: Sat, 9 Oct 2021 14:52:10 +0300
> Subject: [PATCH 1/2] scripts: home: Make sure profile directory exists.
>
> * guix/scripts/home.scm (process-action): Make sure profile directory exists.

LGTM.

> From 5cc0b064af3f4a6238722fbb451a98b499c8d6d2 Mon Sep 17 00:00:00 2001
> From: Oleg Pykhalov <go.wigust <at> gmail.com>
> Date: Sat, 9 Oct 2021 14:52:13 +0300
> Subject: [PATCH 2/2] tests: Add guix-home.sh.
>
> * tests/guix-home.sh: New file.
> * Makefile.am (SH_TESTS): Add this.

LGTM, thanks!

Ludo’.




Reply sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
You have taken responsibility. (Sat, 09 Oct 2021 19:40:01 GMT) Full text and rfc822 format available.

Notification sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
bug acknowledged by developer. (Sat, 09 Oct 2021 19:40:01 GMT) Full text and rfc822 format available.

Message #199 received at 50967-done <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 50967-done <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Andrew Tropin <andrew <at> trop.in>, Xinglu Chen <public <at> yoctocell.xyz>,
 zimoun <zimon.toutoune <at> gmail.com>
Subject: Re: bug#50967: [PATCH 00/12] Move (gnu home-services XYZ) to (gnu
 services XYZ)
Date: Sat, 09 Oct 2021 22:39:30 +0300
[Message part 1 (text/plain, inline)]
Merged 2 patches from the current issue.

Also:
- Moved (gnu home-services) to (gnu services).
- Added two tests for home-bash-service-type.
- Fixed the documentation.

Oleg.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Thu, 14 Oct 2021 08:34:01 GMT) Full text and rfc822 format available.

Message #202 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>, Xinglu Chen <public <at> yoctocell.xyz>,
 50967 <at> debbugs.gnu.org
Subject: Re: [bug#50967] file-like objects instead of gexps
Date: Thu, 14 Oct 2021 11:32:51 +0300
[Message part 1 (text/plain, inline)]
On 2021-10-09 15:34, Ludovic Courtès wrote:

> Hi Andrew,
>
> Preamble: Guix Home is now committed and there are bug reports coming
> in.  To me, that means our discussion needs to be focused on addressing
> specific issues; we’re not going to redesign Guix services in this
> thread.
>
> Andrew Tropin <andrew <at> trop.in> skribis:
>
> [...]
>
>>> Then that’s fine: you can have special code that emits those “source”
>>> lines in .zshrc while still allowing users to provide their own
>>> file-like object for .zshrc lines they want to add.  Again, see how
>>> ‘torrc’ is generated in ‘tor-service-type’.
>>
>> From what I understand you want a separate bashrc-file,
>> bash-profile-file and bash-logout-file fields to be present, but where
>> the content of those files should be inserted?  At the beginning/end or
>> instead of the rest of configuration?
>>
>> We already can achieve the same result by providing gexp, which will
>> read the content of the file-like object, a very small helper for that
>> (slurp-file-gexp) makes it even easier to do.  Such approach is more
>> flexible and doesn't seem much harder.
>>
>> I remember that you had concerns about slurp-file-gexp, but still don't
>> understand what exactly you are concerned about.
>
> Let me restate my concerns:
>
>   1. Users are unlikely to fathom what this does, given the name.  It
>      will end up in user configurations, yet: “slurp”?  “gexp”?

Sounds like a naming conecrn, I brought "slurp" word from clojure lang,
but we can call it whatever sounds better for guile community
generate-read-whole-file-gexp or anything else.  Actually, we don't even
need to have this wrapper to be present, just allow people to do
#~(call-with-input-file file-like-object get-string-all)

>
>   2. ‘slurp-file-gexp’ returns code, as a gexp.  Depending on the place
>      where that gexp is inserted, it may or may not work.  Consider:
>
>        (define (foo x)
>          #~(frob '(#$x)))
>
>        (foo (slurp-file-gexp …))  ;d’oh!

Yep, users can make mistakes, but it's not a technical problem, also, I
see it quite unlikely to happen according to my experience supporting
Guix Home users.

>
>   3. Use of ‘slurp-file-gexp’ and gexps in configuration records is not
>      consistent with the rest of the service APIs (and I think we can
>      humbly recognize that those APIs have been doing the job for a
>      while already.)

It's not actually true, there are system services, which accept a list
of strings/gexps and state it in the documentation, some of them do it
in a less exlicit way, but still do, I found that trick looking at
system service and made it an explicit pattern for home services.  I
tried to extract and follow patterns from system services, but found
them quite inconsistent, so I took a few of them and wrote a few on my
own.

To name a few:
extra-options @ alsa-configuration
extra-config @ nix-configuration
extra-config @ xorg-configuration
extra-content @ nginx-configuration
extra-config @ httpd-config-file
contents @ httpd-virtualhost

To make guix services configurations consistent (at least new ones) I
think it would be cool to have a `Writing Service Configuration
Guideline` section.  I can share the design descisions I've made for
home services configurations and after a discussion it can end up in a
manual section giving a clean guideline, reducing subjective preferences
and increasing consistency.  If you are interested.

>
> Let’s just to the (call-with-input-file file get-string-all) dance in
> places where it’s needed rather than let users call ‘slurp-file-gexp’.
> This is roughly what the ‘tor-service-type’ example I gave does.
>
>> I'll write a few examples of service configurations and rationale behind
>> the design descisions for that next week, to make the discussion more
>> practically oriented.
>
> People are starting to use the tool and to report bugs.  So,
> unfortunately, we have to sort out interface issues quickly now.
>
> If some of the things being discussed turn out to be too complex to
> address under those time constraints, we can consider taking them out
> until we have a better idea on how to address them.
>
> How does that sound?
>
> Thanks,
> Ludo’.

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50967; Package guix-patches. (Thu, 14 Oct 2021 15:23:02 GMT) Full text and rfc822 format available.

Message #205 received at 50967 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrewtropin <at> gmail.com>
To: Oleg Pykhalov <go.wigust <at> gmail.com>, 50967 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: Re: [bug#50967] [PATCH 13/14] home: services: configuration:
 Support file-like objects.
Date: Thu, 14 Oct 2021 10:08:03 +0300
[Message part 1 (text/plain, inline)]
On 2021-10-02 19:38, Oleg Pykhalov wrote:

> * gnu/home/services/configuration.scm (interpose): Include content of files.
> (string-or-gexp?): Rename to 'file-or-string-or-gexp?' and check for file-like
> object.
> (serialize-string-or-gexp): Rename to 'serialize-file-or-string-or-gexp'.
> (text-config?): Call 'file-or-string-or-gexp?' intead of 'string-or-gexp?'.
> * guix/scripts/home/import.scm:
> (generate-bash-module+configuration): Don't call slurp-file-gexp.
> ---
>  gnu/home/services/configuration.scm | 14 ++++++++++----
>  guix/scripts/home/import.scm        |  8 +++-----
>  2 files changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/gnu/home/services/configuration.scm b/gnu/home/services/configuration.scm
> index 5e7743e7d6..39db7a5693 100644
> --- a/gnu/home/services/configuration.scm
> +++ b/gnu/home/services/configuration.scm
> @@ -59,7 +59,12 @@ DELIMITER interposed LS.  Support 'infix and 'suffix GRAMMAR values."
>        (G_ "The GRAMMAR value must be 'infix or 'suffix, but ~a provided.")
>        grammar)))
>    (fold-right (lambda (e acc)
> -		(cons e
> +		(cons (if (file-like? e)
> +                          #~(begin
> +                              (use-modules (ice-9 rdelim))
> +                              (with-fluids ((%default-port-encoding "UTF-8"))
> +                                (with-input-from-file #$e read-string)))

This transformation should not be a part of interpose function,
interpose does know nothing about elements type and doesn't have to
know.  This addition is semantically incorrect and also contradictionary
to docstring.  It also breaks downstream channels.

The version of change in master is different, it doesn't even check
element type.

I'm strongly against this change.  If it necessary to make
transformation of elements of the list it should be done outside of
interpose.

> +                          e)
>  		      (if (and (null? acc) (eq? grammar 'infix))
>  			  acc
>  			  (cons delimiter acc))))
> @@ -79,11 +84,12 @@ the list result in @code{#t} when applying PRED? on them."
>  
>  (define alist? list?)
>  
> -(define (string-or-gexp? sg) (or (string? sg) (gexp? sg)))
> -(define (serialize-string-or-gexp field-name val) "")
> +(define (file-or-string-or-gexp? fsg)
> +  (or (string? fsg) (gexp? fsg) (file-like? fsg)))
> +(define (serialize-file-or-string-or-gexp field-name val) "")
>  
>  (define (text-config? config)
> -  (and (list? config) (every string-or-gexp? config)))
> +  (and (list? config) (every file-or-string-or-gexp? config)))
>  (define (serialize-text-config field-name val)
>    #~(string-append #$@(interpose val "\n" 'suffix)))
>  
> diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm
> index c977ec3861..611f580e85 100644
> --- a/guix/scripts/home/import.scm
> +++ b/guix/scripts/home/import.scm
> @@ -46,17 +46,15 @@
>                   (home-bash-configuration
>                    ,@(if (file-exists? rc)
>                          `((bashrc
> -                           (list (slurp-file-gexp (local-file ,rc)))))
> +                           (list (local-file ,rc))))
>                          '())
>                    ,@(if (file-exists? profile)
>                          `((bash-profile
> -                           (list (slurp-file-gexp
> -                                  (local-file ,profile)))))
> +                           (list (local-file ,profile))))
>                          '())
>                    ,@(if (file-exists? logout)
>                          `((bash-logout
> -                           (list (slurp-file-gexp
> -                                  (local-file ,logout)))))
> +                           (list (local-file ,logout))))
>                          '()))))))

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 12 Nov 2021 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 137 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.