From d0c66871b12c491eca6a80c09b836f893c1d4234 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 26 Sep 2013 23:28:17 +0200 Subject: gnu: vm: Add build users. * gnu/system/shadow.scm (guix-build-accounts): New procedure. * gnu/system/vm.scm (system-qemu-image): Use it. Add the "guixbuild" group. * gnu/system/dmd.scm (guix-service): Add 'builder-group' parameter. Pass 'guix-daemon' the '--build-users-group' option. --- gnu/system/vm.scm | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'gnu/system/vm.scm') diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 52beb18108..daa023458e 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -462,6 +462,9 @@ Happy birthday, GNU! http://www.gnu.org/gnu30 (static-networking-service store "eth0" "10.0.2.10" #:gateway "10.0.2.2"))) + (define build-accounts + (guix-build-accounts store 10)) + (define resolv.conf ;; Name resolution for default QEMU settings. (add-text-to-store store "resolv.conf" @@ -482,20 +485,21 @@ Happy birthday, GNU! http://www.gnu.org/gnu30 (dmd-file (string-append (derivation->output-path dmd-drv) "/bin/dmd")) (dmd-conf (dmd-configuration-file store %dmd-services)) - (accounts (list (user-account - (name "root") - (password "") - (uid 0) (gid 0) - (comment "System administrator") - (home-directory "/") - (shell bash-file)) - (user-account - (name "guest") - (password "") - (uid 1000) (gid 100) - (comment "Guest of GNU") - (home-directory "/home/guest") - (shell bash-file)))) + (accounts (cons* (user-account + (name "root") + (password "") + (uid 0) (gid 0) + (comment "System administrator") + (home-directory "/") + (shell bash-file)) + (user-account + (name "guest") + (password "") + (uid 1000) (gid 100) + (comment "Guest of GNU") + (home-directory "/home/guest") + (shell bash-file)) + build-accounts)) (passwd (passwd-file store accounts)) (shadow (passwd-file store accounts #:shadow? #t)) (group (group-file store @@ -505,7 +509,12 @@ Happy birthday, GNU! http://www.gnu.org/gnu30 (user-group (name "users") (id 100) - (members '("guest")))))) + (members '("guest"))) + (user-group + (name "guixbuild") + (id 30000) + (members (map user-account-name + build-accounts)))))) (pam.d-drv (pam-services->directory store %pam-services)) (pam.d (derivation->output-path pam.d-drv)) -- cgit 1.4.1