summary refs log tree commit diff
path: root/gnu/installer/user.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-05-01 23:11:41 +0200
committerMarius Bakke <mbakke@fastmail.com>2019-05-01 23:11:41 +0200
commit3b458d5462e6bbd852c2dc5c6670d5655abf53f5 (patch)
tree4f3ccec0de1c355134369333c17e948e3258d546 /gnu/installer/user.scm
parent2ca3fdc2db1aef96fbf702a2f26f5e18ce832038 (diff)
parent14da3daafc8dd92fdabd3367694c930440fd72cb (diff)
downloadguix-3b458d5462e6bbd852c2dc5c6670d5655abf53f5.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/installer/user.scm')
-rw-r--r--gnu/installer/user.scm31
1 files changed, 21 insertions, 10 deletions
diff --git a/gnu/installer/user.scm b/gnu/installer/user.scm
index 1f8d40a011..4e701e64ce 100644
--- a/gnu/installer/user.scm
+++ b/gnu/installer/user.scm
@@ -18,12 +18,15 @@
 
 (define-module (gnu installer user)
   #:use-module (guix records)
+  #:use-module (srfi srfi-1)
   #:export (<user>
             user
             make-user
             user-name
+            user-real-name
             user-group
             user-home-directory
+            user-password
 
             users->configuration))
 
@@ -31,20 +34,28 @@
   user make-user
   user?
   (name            user-name)
+  (real-name       user-real-name
+                   (default ""))
   (group           user-group
                    (default "users"))
+  (password        user-password)
   (home-directory  user-home-directory))
 
 (define (users->configuration users)
   "Return the configuration field for USERS."
+  (define (user->sexp user)
+    `(user-account
+      (name ,(user-name user))
+      (comment ,(user-real-name user))
+      (group ,(user-group user))
+      (home-directory ,(user-home-directory user))
+      (supplementary-groups '("wheel" "netdev"
+                              "audio" "video"))))
+
   `((users (cons*
-             ,@(map (lambda (user)
-                      `(user-account
-                        (name ,(user-name user))
-                        (group ,(user-group user))
-                        (home-directory ,(user-home-directory user))
-                        (supplementary-groups
-                         (quote ("wheel" "netdev"
-                                 "audio" "video")))))
-                    users)
-             %base-user-accounts))))
+            ,@(filter-map (lambda (user)
+                            ;; Do not emit a 'user-account' form for "root".
+                            (and (not (string=? (user-name user) "root"))
+                                 (user->sexp user)))
+                          users)
+            %base-user-accounts))))