aboutsummaryrefslogtreecommitdiff
path: root/gnu/system/vm.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-12-07 15:01:40 +0100
committerLudovic Courtès <ludo@gnu.org>2013-12-07 15:01:40 +0100
commit18fb40e414d000b5f342b009a9fbfdc69afb704e (patch)
tree9776d038ebab98ac4f950f2a53cc7c9cbbecbb46 /gnu/system/vm.scm
parent25ed6edb6c17e0c7817cb8b29a549b10c8654eba (diff)
downloadguix-18fb40e414d000b5f342b009a9fbfdc69afb704e.tar
guix-18fb40e414d000b5f342b009a9fbfdc69afb704e.tar.gz
gnu: dmd: Add 'user-accounts' and 'user-groups' fields to <service>.
* gnu/system/shadow.scm (guix-build-accounts): Move to... * gnu/system/dmd.scm (guix-build-accounts): ... here. (<service>)[user-accounts, user-groups]: New fields. (guix-service): New #:build-user-id and #:build-accounts parameters. Use 'guix-build-accounts' and set the 'user-accounts' and 'user-groups' fields accordingly. * gnu/system/vm.scm (system-qemu-image): Remove use of 'guix-build-accounts'. Augment ACCOUNTS and GROUPS from what SERVICES demand.
Diffstat (limited to 'gnu/system/vm.scm')
-rw-r--r--gnu/system/vm.scm34
1 files changed, 17 insertions, 17 deletions
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 502c13b973..16be5ac59a 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -535,8 +535,6 @@ alias ll='ls -l'
(define (system-qemu-image)
"Return the derivation of a QEMU image of the GNU system."
- (define build-user-gid 30000)
-
(mlet* %store-monad
((services (listm %store-monad
(host-name-service "gnu")
@@ -565,8 +563,6 @@ Happy birthday, GNU! http://www.gnu.org/gnu30
#:allow-empty-passwords? #t
#:motd motd)))
- (build-accounts (guix-build-accounts 10 #:gid build-user-gid))
-
(bash-file (package-file bash "bin/bash"))
(dmd-file (package-file dmd "bin/dmd"))
(dmd-conf (dmd-configuration-file services))
@@ -584,19 +580,23 @@ Happy birthday, GNU! http://www.gnu.org/gnu30
(comment "Guest of GNU")
(home-directory "/home/guest")
(shell bash-file))
- build-accounts))
- (groups -> (list (user-group
- (name "root")
- (id 0))
- (user-group
- (name "users")
- (id 100)
- (members '("guest")))
- (user-group
- (name "guixbuild")
- (id build-user-gid)
- (members (map user-account-name
- build-accounts)))))
+ (append-map service-user-accounts
+ services)))
+ (groups -> (cons* (user-group
+ (name "root")
+ (id 0))
+ (user-group
+ (name "users")
+ (id 100)
+ (members '("guest")))
+ (append-map service-user-groups services)))
+ (build-user-gid -> (any (lambda (service)
+ (and (equal? '(guix-daemon)
+ (service-provision service))
+ (match (service-user-groups service)
+ ((group)
+ (user-group-id group)))))
+ services))
(packages -> `(("coreutils" ,coreutils)
("bash" ,bash)
("guile" ,guile-2.0)