aboutsummaryrefslogtreecommitdiff
path: root/gnu/system/shadow.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-12-12 11:42:12 +0100
committerLudovic Courtès <ludo@gnu.org>2015-12-12 11:48:46 +0100
commite82e55e58c67b0215e768c4612ca542bc670f633 (patch)
tree856c4512fa1fbde59c1d9845c5a763ef8c4a14b4 /gnu/system/shadow.scm
parent98bd851ee891ca4a84e061fe1e78ba78c292b096 (diff)
parente35dff973375266db253747140ddf25084ecddc2 (diff)
downloadpatches-e82e55e58c67b0215e768c4612ca542bc670f633.tar
patches-e82e55e58c67b0215e768c4612ca542bc670f633.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/system/shadow.scm')
-rw-r--r--gnu/system/shadow.scm30
1 files changed, 26 insertions, 4 deletions
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index 3f49c1fc9f..7f3a1dfac2 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -280,11 +280,33 @@ group."
(activate-users+groups (list #$@user-specs)
(list #$@group-specs))))
-(define (etc-skel arguments)
+(define (shells-file shells)
+ "Return a file-like object that builds a shell list for use as /etc/shells
+based on SHELLS. /etc/shells is used by xterm, polkit, and other programs."
+ (computed-file "shells"
+ #~(begin
+ (use-modules (srfi srfi-1))
+
+ (define shells
+ (delete-duplicates (list #$@shells)))
+
+ (call-with-output-file #$output
+ (lambda (port)
+ (display "\
+/bin/sh
+/run/current-system/profile/bin/sh
+/run/current-system/profile/bin/bash\n" port)
+ (for-each (lambda (shell)
+ (display shell port)
+ (newline port))
+ shells))))))
+(define (etc-files arguments)
"Filter out among ARGUMENTS things corresponding to skeletons, and return
the /etc/skel directory for those."
- (let ((skels (filter pair? arguments)))
- `(("skel" ,(skeleton-directory skels)))))
+ (let ((skels (filter pair? arguments))
+ (users (filter user-account? arguments)))
+ `(("skel" ,(skeleton-directory skels))
+ ("shells" ,(shells-file (map user-account-shell users))))))
(define account-service-type
(service-type (name 'account)
@@ -298,7 +320,7 @@ the /etc/skel directory for those."
(list (service-extension activation-service-type
account-activation)
(service-extension etc-service-type
- etc-skel)))))
+ etc-files)))))
(define (account-service accounts+groups skeletons)
"Return a <service> that takes care of user accounts and user groups, with