From dbeef44f3c520816251bde74c1005915a637e1ef Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Wed, 22 May 2024 13:49:37 +0400 Subject: services: home: Use pairs instead of lists. * gnu/services/guix.scm: Use pairs instead of lists. * doc/guix.texi: Update accordingly. * gnu/tests/guix.scm: Update accordingly. Change-Id: I0b8d3fa5b214add89bdb84a11fa20d1b319435f0 --- doc/guix.texi | 4 ++-- gnu/services/guix.scm | 6 ++++-- gnu/tests/guix.scm | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 1224104038..ea8ac24443 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -39607,7 +39607,7 @@ the value is a home-environment configuration. (operating-system (services (append (list (service guix-home-service-type - `(("alice" ,my-home)))) + `(("alice" . ,my-home)))) %base-services))) @end lisp @@ -39616,7 +39616,7 @@ environments, as in this example: @lisp (simple-service 'my-extra-home home-service-type - `(("bob" ,my-extra-home)))) + `(("bob" . ,my-extra-home)))) @end lisp @end defvar diff --git a/gnu/services/guix.scm b/gnu/services/guix.scm index 96f5ecaac0..3818749baa 100644 --- a/gnu/services/guix.scm +++ b/gnu/services/guix.scm @@ -696,7 +696,7 @@ (define guix-data-service-type (define (guix-home-shepherd-service config) (map (match-lambda - ((user he) + (((? string? user) . (? home-environment? he)) (shepherd-service (documentation "Activate Guix Home.") (requirement '(user-processes)) @@ -710,7 +710,9 @@ (define (guix-home-shepherd-service config) (list (string-append "HOME=" (passwd:dir (getpw #$user))) "GUIX_SYSTEM_IS_RUNNING_HOME_ACTIVATE=t") #:group (group:name (getgrgid (passwd:gid (getpw #$user)))))) - (stop #~(make-kill-destructor))))) + (stop #~(make-kill-destructor)))) + (e (error "Invalid value for guix-home, it should be in a form of +(\"user-name\" . home-environment), but the following value is provided:\n" e))) config)) (define guix-home-service-type diff --git a/gnu/tests/guix.scm b/gnu/tests/guix.scm index 12ad1bf255..6071cb018e 100644 --- a/gnu/tests/guix.scm +++ b/gnu/tests/guix.scm @@ -271,7 +271,7 @@ (define %guix-home-service-he (define %guix-home-service-os (simple-operating-system (service guix-home-service-type - `(("alice" ,%guix-home-service-he))))) + `(("alice" . ,%guix-home-service-he))))) (define (run-guix-home-service-test) (define os -- cgit v1.2.3