gnu: vm: Add a service for the Guix daemon.

* gnu/system/dmd.scm (guix-service): New procedure.
* gnu/system/vm.scm (system-qemu-image): Use it.
This commit is contained in:
Ludovic Courtès 2013-09-24 23:15:09 +02:00
parent 30f25b033c
commit 9fcc355529
2 changed files with 16 additions and 1 deletions

View File

@ -23,6 +23,8 @@
#:use-module (guix records) #:use-module (guix records)
#:use-module ((gnu packages system) #:use-module ((gnu packages system)
#:select (mingetty inetutils)) #:select (mingetty inetutils))
#:use-module ((gnu packages package-management)
#:select (guix))
#:use-module (ice-9 match) #:use-module (ice-9 match)
#:use-module (srfi srfi-1) #:use-module (srfi srfi-1)
#:export (service? #:export (service?
@ -36,6 +38,7 @@
syslog-service syslog-service
mingetty-service mingetty-service
guix-service
dmd-configuration-file)) dmd-configuration-file))
;;; Commentary: ;;; Commentary:
@ -104,6 +107,17 @@
(inputs `(("inetutils" ,inetutils) (inputs `(("inetutils" ,inetutils)
("syslog.conf" ,syslog.conf)))))) ("syslog.conf" ,syslog.conf))))))
(define* (guix-service store #:key (guix guix))
"Return a service that runs the build daemon from GUIX."
(let* ((drv (package-derivation store guix))
(daemon (string-append (derivation->output-path drv)
"/bin/guix-daemon")))
(service
(provision '(guix-daemon))
(start `(make-forkexec-constructor ,daemon))
(inputs `(("guix" ,guix))))))
(define (dmd-configuration-file store services) (define (dmd-configuration-file store services)
"Return the dmd configuration file for SERVICES." "Return the dmd configuration file for SERVICES."
(define config (define config

View File

@ -382,7 +382,8 @@ It can be used to provide additional files, such as /etc files."
(list (mingetty-service store "tty1") (list (mingetty-service store "tty1")
(mingetty-service store "tty2") (mingetty-service store "tty2")
(mingetty-service store "tty3") (mingetty-service store "tty3")
(syslog-service store))) (syslog-service store)
(guix-service store #:guix guix-0.4)))
(parameterize ((%guile-for-build (package-derivation store guile-final))) (parameterize ((%guile-for-build (package-derivation store guile-final)))
(let* ((bash-drv (package-derivation store bash)) (let* ((bash-drv (package-derivation store bash))