aboutsummaryrefslogtreecommitdiff
path: root/gnu/installer/user.scm
diff options
context:
space:
mode:
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))))