From 18fb40e414d000b5f342b009a9fbfdc69afb704e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 7 Dec 2013 15:01:40 +0100 Subject: gnu: dmd: Add 'user-accounts' and 'user-groups' fields to . * gnu/system/shadow.scm (guix-build-accounts): Move to... * gnu/system/dmd.scm (guix-build-accounts): ... here. ()[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. --- gnu/system/vm.scm | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'gnu/system/vm.scm') 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) -- cgit 1.4.1