summary refs log tree commit diff
path: root/gnu/installer/user.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-04-24 21:54:28 +0200
committerLudovic Courtès <ludo@gnu.org>2019-04-25 00:45:35 +0200
commit91a7c4998fe4f5a2a63f2ddb4bfeeef81c68b6d7 (patch)
treeb74d2da50fa8cf33a87f9db9be645f593a7e57ec /gnu/installer/user.scm
parent399c31d40a918343c5513c3c4a0351f60ec5797b (diff)
downloadguix-91a7c4998fe4f5a2a63f2ddb4bfeeef81c68b6d7.tar.gz
installer: Ask for the root account password.
Fixes <https://bugs.gnu.org/35399>.

* gnu/installer/newt/user.scm (run-root-password-page): New procedure.
* gnu/installer/user.scm (users->configuration): Filter out the "root"
account.
* gnu/installer/final.scm (create-user-database): Set 'uid' field in
'user-account' form.
Diffstat (limited to 'gnu/installer/user.scm')
-rw-r--r--gnu/installer/user.scm25
1 files changed, 15 insertions, 10 deletions
diff --git a/gnu/installer/user.scm b/gnu/installer/user.scm
index fe755ad2c6..29fab6414e 100644
--- a/gnu/installer/user.scm
+++ b/gnu/installer/user.scm
@@ -18,6 +18,7 @@
 
 (define-module (gnu installer user)
   #:use-module (guix records)
+  #:use-module (srfi srfi-1)
   #:export (<user>
             user
             make-user
@@ -39,14 +40,18 @@
 
 (define (users->configuration users)
   "Return the configuration field for USERS."
+  (define (user->sexp user)
+    `(user-account
+      (name ,(user-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))))