gnu: Switch to 'with-imported-modules'.

* gnu/services.scm (directory-union): Use 'with-imported-modules'
instead of the '#:modules' argument of 'computed-file'.
* gnu/services/base.scm (udev-rules-union): Likewise.
* gnu/services/dbus.scm (system-service-directory): Likewise.
* gnu/services/desktop.scm (wrapped-dbus-service):
(polkit-directory): Likewise.
* gnu/services/networking.scm (tor-configuration->torrc): Likewise.
* gnu/services/xorg.scm (xorg-configuration-directory): Likewise.
* gnu/system/install.scm (self-contained-tarball): Likewise.
* gnu/system/linux-container.scm (container-script): Likewise.
* gnu/system/linux-initrd.scm (expression->initrd): Likewise, and
remove #:modules parameter.
(flat-linux-module-directory): Use 'with-imported-modules'.
(base-initrd): Likewise.
* gnu/system/locale.scm (locale-directory): Likewise.
* gnu/system/shadow.scm (default-skeletons): Likewise.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Likewise.
* gnu/tests/base.scm (run-basic-test): Likewise.
* gnu/tests/install.scm (run-install): Likewise.
* doc/guix.texi (Initial RAM Disk): Update 'expression->initrd'
documentation.
This commit is contained in:
Ludovic Courtès 2016-07-03 23:11:40 +02:00
parent 0bb9929eaa
commit 4ee96a7912
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
15 changed files with 600 additions and 605 deletions

View file

@ -10016,15 +10016,11 @@ program. That gives a lot of flexibility. The
program to run in that initrd. program to run in that initrd.
@deffn {Monadic Procedure} expression->initrd @var{exp} @ @deffn {Monadic Procedure} expression->initrd @var{exp} @
[#:guile %guile-static-stripped] [#:name "guile-initrd"] @ [#:guile %guile-static-stripped] [#:name "guile-initrd"]
[#:modules '()]
Return a derivation that builds a Linux initrd (a gzipped cpio archive) Return a derivation that builds a Linux initrd (a gzipped cpio archive)
containing @var{guile} and that evaluates @var{exp}, a G-expression, containing @var{guile} and that evaluates @var{exp}, a G-expression,
upon booting. All the derivations referenced by @var{exp} are upon booting. All the derivations referenced by @var{exp} are
automatically copied to the initrd. automatically copied to the initrd.
@var{modules} is a list of Guile module names to be embedded in the
initrd.
@end deffn @end deffn
@node GRUB Configuration @node GRUB Configuration

View file

@ -309,10 +309,10 @@ file."
one) one)
(_ (_
(computed-file name (computed-file name
(with-imported-modules '((guix build union))
#~(begin #~(begin
(use-modules (guix build union)) (use-modules (guix build union))
(union-build #$output '#$things)) (union-build #$output '#$things)))))))
#:modules '((guix build union))))))
(define* (activation-service->script service) (define* (activation-service->script service)
"Return as a monadic value the activation script for SERVICE, a service of "Return as a monadic value the activation script for SERVICE, a service of

View file

@ -1138,6 +1138,8 @@ archive}). If that is not the case, the service will fail to start."
"Return the union of the @code{lib/udev/rules.d} directories found in each "Return the union of the @code{lib/udev/rules.d} directories found in each
item of @var{packages}." item of @var{packages}."
(define build (define build
(with-imported-modules '((guix build union)
(guix build utils))
#~(begin #~(begin
(use-modules (guix build union) (use-modules (guix build union)
(guix build utils) (guix build utils)
@ -1155,15 +1157,14 @@ item of @var{packages}."
(mkdir-p (string-append #$output "/lib/udev")) (mkdir-p (string-append #$output "/lib/udev"))
(union-build (string-append #$output "/lib/udev/rules.d") (union-build (string-append #$output "/lib/udev/rules.d")
(filter-map rules-sub-directory '#$packages)))) (filter-map rules-sub-directory '#$packages)))))
(computed-file "udev-rules" build (computed-file "udev-rules" build))
#:modules '((guix build union)
(guix build utils))))
(define (udev-rule file-name contents) (define (udev-rule file-name contents)
"Return a directory with a udev rule file FILE-NAME containing CONTENTS." "Return a directory with a udev rule file FILE-NAME containing CONTENTS."
(computed-file file-name (computed-file file-name
(with-imported-modules '((guix build utils))
#~(begin #~(begin
(use-modules (guix build utils)) (use-modules (guix build utils))
@ -1174,8 +1175,7 @@ item of @var{packages}."
(call-with-output-file (call-with-output-file
(string-append rules.d "/" #$file-name) (string-append rules.d "/" #$file-name)
(lambda (port) (lambda (port)
(display #$contents port)))) (display #$contents port)))))))
#:modules '((guix build utils))))
(define kvm-udev-rule (define kvm-udev-rule
;; Return a directory with a udev rule that changes the group of /dev/kvm to ;; Return a directory with a udev rule that changes the group of /dev/kvm to

View file

@ -46,13 +46,15 @@
"Return the system service directory, containing @code{.service} files for "Return the system service directory, containing @code{.service} files for
all the services that may be activated by the daemon." all the services that may be activated by the daemon."
(computed-file "dbus-system-services" (computed-file "dbus-system-services"
(with-imported-modules '((guix build utils))
#~(begin #~(begin
(use-modules (guix build utils) (use-modules (guix build utils)
(srfi srfi-1)) (srfi srfi-1))
(define files (define files
(append-map (lambda (service) (append-map (lambda (service)
(find-files (string-append (find-files
(string-append
service service
"/share/dbus-1/system-services") "/share/dbus-1/system-services")
"\\.service$")) "\\.service$"))
@ -64,8 +66,7 @@ all the services that may be activated by the daemon."
(string-append #$output "/" (string-append #$output "/"
(basename file)))) (basename file))))
files) files)
#t) #t))))
#:modules '((guix build utils))))
(define (dbus-configuration-directory services) (define (dbus-configuration-directory services)
"Return a directory contains the @code{system-local.conf} file for DBUS that "Return a directory contains the @code{system-local.conf} file for DBUS that

View file

@ -91,7 +91,8 @@ is set to @var{value} when the bus daemon launches it."
(string-append #$service "/" #$program) (string-append #$service "/" #$program)
(cdr (command-line)))))) (cdr (command-line))))))
(computed-file (string-append (package-name service) "-wrapper") (define build
(with-imported-modules '((guix build utils))
#~(begin #~(begin
(use-modules (guix build utils)) (use-modules (guix build utils))
@ -113,8 +114,10 @@ is set to @var{value} when the bus daemon launches it."
_ original-program arguments) _ original-program arguments)
(string-append "Exec=" #$wrapper arguments (string-append "Exec=" #$wrapper arguments
"\n")))) "\n"))))
(find-files #$output "\\.service$"))) (find-files #$output "\\.service$")))))
#:modules '((guix build utils))))
(computed-file (string-append (package-name service) "-wrapper")
build))
;;; ;;;
@ -408,6 +411,7 @@ Users need to be in the @code{lp} group to access the D-Bus service.
(define (polkit-directory packages) (define (polkit-directory packages)
"Return a directory containing an @file{actions} and possibly a "Return a directory containing an @file{actions} and possibly a
@file{rules.d} sub-directory, for use as @file{/etc/polkit-1}." @file{rules.d} sub-directory, for use as @file{/etc/polkit-1}."
(with-imported-modules '((guix build union))
(computed-file "etc-polkit-1" (computed-file "etc-polkit-1"
#~(begin #~(begin
(use-modules (guix build union) (srfi srfi-26)) (use-modules (guix build union) (srfi srfi-26))
@ -415,8 +419,7 @@ Users need to be in the @code{lp} group to access the D-Bus service.
(union-build #$output (union-build #$output
(map (cut string-append <> (map (cut string-append <>
"/share/polkit-1") "/share/polkit-1")
(list #$@packages)))) (list #$@packages)))))))
#:modules '((guix build union))))
(define polkit-etc-files (define polkit-etc-files
(match-lambda (match-lambda

View file

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
;;; ;;;
@ -345,6 +345,7 @@ keep the system clock synchronized with that of @var{servers}."
(($ <tor-configuration> tor config-file services) (($ <tor-configuration> tor config-file services)
(computed-file (computed-file
"torrc" "torrc"
(with-imported-modules '((guix build utils))
#~(begin #~(begin
(use-modules (guix build utils) (use-modules (guix build utils)
(ice-9 match)) (ice-9 match))
@ -376,8 +377,7 @@ HiddenServicePort ~a ~a~%"
(call-with-input-file #$config-file (call-with-input-file #$config-file
(lambda (input) (lambda (input)
(dump-port input port))) (dump-port input port)))
#t))) #t))))))))
#:modules '((guix build utils))))))
(define (tor-shepherd-service config) (define (tor-shepherd-service config)
"Return a <shepherd-service> running TOR." "Return a <shepherd-service> running TOR."

View file

@ -158,6 +158,7 @@ EndSection
"Return a directory that contains the @code{.conf} files for X.org that "Return a directory that contains the @code{.conf} files for X.org that
includes the @code{share/X11/xorg.conf.d} directories of each package listed includes the @code{share/X11/xorg.conf.d} directories of each package listed
in @var{modules}." in @var{modules}."
(with-imported-modules '((guix build utils))
(computed-file "xorg.conf.d" (computed-file "xorg.conf.d"
#~(begin #~(begin
(use-modules (guix build utils) (use-modules (guix build utils)
@ -177,8 +178,7 @@ in @var{modules}."
(string-append #$output "/" (string-append #$output "/"
(basename file)))) (basename file))))
files) files)
#t) #t))))
#:modules '((guix build utils))))
(define* (xorg-start-command #:key (define* (xorg-start-command #:key
(guile (canonical-package guile-2.0)) (guile (canonical-package guile-2.0))

View file

@ -55,6 +55,9 @@ under /root/.guix-profile where GUIX is installed."
(manifest (manifest
(list (package->manifest-entry guix)))))) (list (package->manifest-entry guix))))))
(define build (define build
(with-imported-modules '((guix build utils)
(guix build store-copy)
(gnu build install))
#~(begin #~(begin
(use-modules (guix build utils) (use-modules (guix build utils)
(gnu build install)) (gnu build install))
@ -64,8 +67,9 @@ under /root/.guix-profile where GUIX is installed."
(setenv "PATH" (setenv "PATH"
(string-append #$guix "/sbin:" #$tar "/bin:" #$xz "/bin")) (string-append #$guix "/sbin:" #$tar "/bin:" #$xz "/bin"))
;; Note: there is not much to gain here with deduplication and there ;; Note: there is not much to gain here with deduplication and
;; is the overhead of the '.links' directory, so turn it off. ;; there is the overhead of the '.links' directory, so turn it
;; off.
(populate-single-profile-directory %root (populate-single-profile-directory %root
#:profile #$profile #:profile #$profile
#:closure "profile" #:closure "profile"
@ -87,20 +91,17 @@ under /root/.guix-profile where GUIX is installed."
"--check-links" "--check-links"
"-cvf" #$output "-cvf" #$output
;; Avoid adding / and /var to the tarball, ;; Avoid adding / and /var to the tarball, so
;; so that the ownership and permissions of those ;; that the ownership and permissions of those
;; directories will not be overwritten when ;; directories will not be overwritten when
;; extracting the archive. Do not include /root ;; extracting the archive. Do not include /root
;; because the root account might have a different ;; because the root account might have a
;; home directory. ;; different home directory.
"./var/guix" "./var/guix"
(string-append "." (%store-directory))))))) (string-append "." (%store-directory))))))))
(gexp->derivation "guix-tarball.tar.xz" build (gexp->derivation "guix-tarball.tar.xz" build
#:references-graphs `(("profile" ,profile)) #:references-graphs `(("profile" ,profile)))))
#:modules '((guix build utils)
(guix build store-copy)
(gnu build install)))))
(define (log-to-info) (define (log-to-info)
@ -212,6 +213,7 @@ the user's target storage device rather than on the RAM disk."
(define directory (define directory
(computed-file "configuration-templates" (computed-file "configuration-templates"
(with-imported-modules '((guix build utils))
#~(begin #~(begin
(mkdir #$output) (mkdir #$output)
(for-each (lambda (file target) (for-each (lambda (file target)
@ -224,8 +226,7 @@ the user's target storage device rather than on the RAM disk."
'("bare-bones.scm" '("bare-bones.scm"
"desktop.scm" "desktop.scm"
"lightweight-desktop.scm")) "lightweight-desktop.scm"))
#t) #t))))
#:modules '((guix build utils))))
`(("configuration" ,directory))) `(("configuration" ,directory)))

View file

@ -87,6 +87,13 @@ that will be shared with the host system."
#:container? #t))) #:container? #t)))
(define script (define script
(with-imported-modules '((guix config)
(guix utils)
(guix build utils)
(guix build syscalls)
(guix build bournish)
(gnu build file-systems)
(gnu build linux-container))
#~(begin #~(begin
(use-modules (gnu build linux-container) (use-modules (gnu build linux-container)
(guix build utils)) (guix build utils))
@ -102,15 +109,6 @@ that will be shared with the host system."
;; users and groups, which is sufficient for most cases. ;; users and groups, which is sufficient for most cases.
;; ;;
;; See: http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html#--private-users= ;; See: http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html#--private-users=
#:host-uids 65536))) #:host-uids 65536))))
(gexp->script "run-container" script (gexp->script "run-container" script))))
#:modules '((ice-9 match)
(srfi srfi-98)
(guix config)
(guix utils)
(guix build utils)
(guix build syscalls)
(guix build bournish)
(gnu build file-systems)
(gnu build linux-container))))))

View file

@ -55,21 +55,21 @@
(guile %guile-static-stripped) (guile %guile-static-stripped)
(gzip gzip) (gzip gzip)
(name "guile-initrd") (name "guile-initrd")
(system (%current-system)) (system (%current-system)))
(modules '()))
"Return a derivation that builds a Linux initrd (a gzipped cpio archive) "Return a derivation that builds a Linux initrd (a gzipped cpio archive)
containing GUILE and that evaluates EXP, a G-expression, upon booting. All containing GUILE and that evaluates EXP, a G-expression, upon booting. All
the derivations referenced by EXP are automatically copied to the initrd. the derivations referenced by EXP are automatically copied to the initrd."
MODULES is a list of Guile module names to be embedded in the initrd."
;; General Linux overview in `Documentation/early-userspace/README' and ;; General Linux overview in `Documentation/early-userspace/README' and
;; `Documentation/filesystems/ramfs-rootfs-initramfs.txt'. ;; `Documentation/filesystems/ramfs-rootfs-initramfs.txt'.
(mlet %store-monad ((init (gexp->script "init" exp (mlet %store-monad ((init (gexp->script "init" exp
#:modules modules
#:guile guile))) #:guile guile)))
(define builder (define builder
(with-imported-modules '((guix cpio)
(guix build utils)
(guix build store-copy)
(gnu build linux-initrd))
#~(begin #~(begin
(use-modules (gnu build linux-initrd)) (use-modules (gnu build linux-initrd))
@ -79,19 +79,18 @@ MODULES is a list of Guile module names to be embedded in the initrd."
#:init #$init #:init #$init
;; Copy everything INIT refers to into the initrd. ;; Copy everything INIT refers to into the initrd.
#:references-graphs '("closure") #:references-graphs '("closure")
#:gzip (string-append #$gzip "/bin/gzip")))) #:gzip (string-append #$gzip "/bin/gzip")))))
(gexp->derivation name builder (gexp->derivation name builder
#:modules '((guix cpio)
(guix build utils)
(guix build store-copy)
(gnu build linux-initrd))
#:references-graphs `(("closure" ,init))))) #:references-graphs `(("closure" ,init)))))
(define (flat-linux-module-directory linux modules) (define (flat-linux-module-directory linux modules)
"Return a flat directory containing the Linux kernel modules listed in "Return a flat directory containing the Linux kernel modules listed in
MODULES and taken from LINUX." MODULES and taken from LINUX."
(define build-exp (define build-exp
(with-imported-modules '((guix build utils)
(guix elf)
(gnu build linux-modules))
#~(begin #~(begin
(use-modules (ice-9 match) (ice-9 regex) (use-modules (ice-9 match) (ice-9 regex)
(srfi srfi-1) (srfi srfi-1)
@ -128,12 +127,9 @@ MODULES and taken from LINUX."
(copy-file module (copy-file module
(string-append #$output "/" (string-append #$output "/"
(basename module)))) (basename module))))
(delete-duplicates modules)))) (delete-duplicates modules)))))
(gexp->derivation "linux-modules" build-exp (gexp->derivation "linux-modules" build-exp))
#:modules '((guix build utils)
(guix elf)
(gnu build linux-modules))))
(define* (base-initrd file-systems (define* (base-initrd file-systems
#:key #:key
@ -227,6 +223,13 @@ loaded at boot time in the order in which they appear."
(mlet %store-monad ((kodir (flat-linux-module-directory linux (mlet %store-monad ((kodir (flat-linux-module-directory linux
linux-modules))) linux-modules)))
(expression->initrd (expression->initrd
(with-imported-modules '((guix build bournish)
(guix build utils)
(guix build syscalls)
(gnu build linux-boot)
(gnu build linux-modules)
(gnu build file-systems)
(guix elf))
#~(begin #~(begin
(use-modules (gnu build linux-boot) (use-modules (gnu build linux-boot)
(guix build utils) (guix build utils)
@ -251,14 +254,7 @@ loaded at boot time in the order in which they appear."
#:linux-modules '#$linux-modules #:linux-modules '#$linux-modules
#:linux-module-directory '#$kodir #:linux-module-directory '#$kodir
#:qemu-guest-networking? #$qemu-networking? #:qemu-guest-networking? #$qemu-networking?
#:volatile-root? '#$volatile-root?)) #:volatile-root? '#$volatile-root?)))
#:name "base-initrd" #:name "base-initrd")))
#:modules '((guix build bournish)
(guix build utils)
(guix build syscalls)
(gnu build linux-boot)
(gnu build linux-modules)
(gnu build file-systems)
(guix elf)))))
;;; linux-initrd.scm ends here ;;; linux-initrd.scm ends here

View file

@ -154,10 +154,10 @@ data format changes between libc versions."
#:libc libc)) #:libc libc))
libcs))) libcs)))
(gexp->derivation "locale-multiple-versions" (gexp->derivation "locale-multiple-versions"
(with-imported-modules '((guix build union))
#~(begin #~(begin
(use-modules (guix build union)) (use-modules (guix build union))
(union-build #$output (list #$@dirs))) (union-build #$output (list #$@dirs))))
#:modules '((guix build union))
#:local-build? #t #:local-build? #t
#:substitutable? #f))))) #:substitutable? #f)))))

View file

@ -139,10 +139,11 @@
`(fontconfig (dir "/run/current-system/profile/share/fonts"))) `(fontconfig (dir "/run/current-system/profile/share/fonts")))
(define copy-guile-wm (define copy-guile-wm
(with-imported-modules '((guix build utils))
#~(begin #~(begin
(use-modules (guix build utils)) (use-modules (guix build utils))
(copy-file (car (find-files #$guile-wm "wm-init-sample.scm")) (copy-file (car (find-files #$guile-wm "wm-init-sample.scm"))
#$output))) #$output))))
(let ((profile (plain-file "bash_profile" "\ (let ((profile (plain-file "bash_profile" "\
# Honor per-interactive-shell startup file # Honor per-interactive-shell startup file
@ -176,13 +177,13 @@ alias ll='ls -l'\n"))
(zlogin (plain-file "zlogin" "\ (zlogin (plain-file "zlogin" "\
# Honor system-wide environment variables # Honor system-wide environment variables
source /etc/profile\n")) source /etc/profile\n"))
(guile-wm (computed-file "guile-wm" copy-guile-wm (guile-wm (computed-file "guile-wm" copy-guile-wm))
#:modules '((guix build utils))))
(xdefaults (plain-file "Xdefaults" "\ (xdefaults (plain-file "Xdefaults" "\
XTerm*utf8: always XTerm*utf8: always
XTerm*metaSendsEscape: true\n")) XTerm*metaSendsEscape: true\n"))
(fonts.conf (computed-file (fonts.conf (computed-file
"fonts.conf" "fonts.conf"
(with-imported-modules '((guix build utils))
#~(begin #~(begin
(use-modules (guix build utils) (use-modules (guix build utils)
(sxml simple)) (sxml simple))
@ -195,8 +196,7 @@ XTerm*metaSendsEscape: true\n"))
(call-with-output-file (string-append dir (call-with-output-file (string-append dir
"/fonts.conf") "/fonts.conf")
(lambda (port) (lambda (port)
(sxml->xml '#$fonts.conf-content port)))) (sxml->xml '#$fonts.conf-content port)))))))
#:modules '((guix build utils))))
(gdbinit (plain-file "gdbinit" "\ (gdbinit (plain-file "gdbinit" "\
# Tell GDB where to look for separate debugging files. # Tell GDB where to look for separate debugging files.
set debug-file-directory ~/.guix-profile/lib/debug\n"))) set debug-file-directory ~/.guix-profile/lib/debug\n")))
@ -211,6 +211,7 @@ set debug-file-directory ~/.guix-profile/lib/debug\n")))
(define (skeleton-directory skeletons) (define (skeleton-directory skeletons)
"Return a directory containing SKELETONS, a list of name/derivation tuples." "Return a directory containing SKELETONS, a list of name/derivation tuples."
(computed-file "skel" (computed-file "skel"
(with-imported-modules '((guix build utils))
#~(begin #~(begin
(use-modules (ice-9 match) (use-modules (ice-9 match)
(guix build utils)) (guix build utils))
@ -225,8 +226,7 @@ set debug-file-directory ~/.guix-profile/lib/debug\n")))
((target source) ((target source)
(copy-recursively source target))) (copy-recursively source target)))
'#$skeletons) '#$skeletons)
#t) #t))))
#:modules '((guix build utils))))
(define (assert-valid-users/groups users groups) (define (assert-valid-users/groups users groups)
"Raise an error if USERS refer to groups not listed in GROUPS." "Raise an error if USERS refer to groups not listed in GROUPS."

View file

@ -155,6 +155,7 @@ made available under the /xchg CIFS share."
(define builder (define builder
;; Code that launches the VM that evaluates EXP. ;; Code that launches the VM that evaluates EXP.
(with-imported-modules modules
#~(begin #~(begin
(use-modules (guix build utils) (use-modules (guix build utils)
(gnu build vm)) (gnu build vm))
@ -176,13 +177,12 @@ made available under the /xchg CIFS share."
#:make-disk-image? #$make-disk-image? #:make-disk-image? #$make-disk-image?
#:disk-image-format #$disk-image-format #:disk-image-format #$disk-image-format
#:disk-image-size #$disk-image-size #:disk-image-size #$disk-image-size
#:references-graphs graphs)))) #:references-graphs graphs)))))
(gexp->derivation name builder (gexp->derivation name builder
;; TODO: Require the "kvm" feature. ;; TODO: Require the "kvm" feature.
#:system system #:system system
#:env-vars env-vars #:env-vars env-vars
#:modules modules
#:guile-for-build guile-for-build #:guile-for-build guile-for-build
#:references-graphs references-graphs))) #:references-graphs references-graphs)))

View file

@ -70,6 +70,7 @@
using COMMAND, a gexp that evaluates to a list of strings. Compare some using COMMAND, a gexp that evaluates to a list of strings. Compare some
properties of running system to what's declared in OS, an <operating-system>." properties of running system to what's declared in OS, an <operating-system>."
(define test (define test
(with-imported-modules '((gnu build marionette))
#~(begin #~(begin
(use-modules (gnu build marionette) (use-modules (gnu build marionette)
(srfi srfi-1) (srfi srfi-1)
@ -185,10 +186,9 @@ info --version")
(file-exists? "tty1.ppm"))) (file-exists? "tty1.ppm")))
(test-end) (test-end)
(exit (= (test-runner-fail-count (test-runner-current)) 0)))) (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
(gexp->derivation name test (gexp->derivation name test))
#:modules '((gnu build marionette))))
(define %test-basic-os (define %test-basic-os
(system-test (system-test
@ -243,6 +243,7 @@ functionality tests.")
(command (system-qemu-image/shared-store-script (command (system-qemu-image/shared-store-script
os #:graphic? #f))) os #:graphic? #f)))
(define test (define test
(with-imported-modules '((gnu build marionette))
#~(begin #~(begin
(use-modules (gnu build marionette) (use-modules (gnu build marionette)
(srfi srfi-64) (srfi srfi-64)
@ -300,10 +301,9 @@ functionality tests.")
(wait-for-file "/root/witness-touch")) (wait-for-file "/root/witness-touch"))
(test-end) (test-end)
(exit (= (test-runner-fail-count (test-runner-current)) 0)))) (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
(gexp->derivation name test (gexp->derivation name test)))
#:modules '((gnu build marionette)))))
(define %test-mcron (define %test-mcron
(system-test (system-test
@ -355,6 +355,7 @@ functionality tests.")
".local")) ".local"))
(define test (define test
(with-imported-modules '((gnu build marionette))
#~(begin #~(begin
(use-modules (gnu build marionette) (use-modules (gnu build marionette)
(srfi srfi-1) (srfi srfi-1)
@ -435,10 +436,9 @@ functionality tests.")
(test-end) (test-end)
(exit (= (test-runner-fail-count (test-runner-current)) 0)))) (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
(gexp->derivation "nss-mdns" test (gexp->derivation "nss-mdns" test)))
#:modules '((gnu build marionette)))))
(define %test-nss-mdns (define %test-nss-mdns
(system-test (system-test

View file

@ -119,6 +119,8 @@ TARGET-SIZE bytes containing the installed system."
os (list target)) os (list target))
#:disk-image-size (* 1500 MiB)))) #:disk-image-size (* 1500 MiB))))
(define install (define install
(with-imported-modules '((guix build utils)
(gnu build marionette))
#~(begin #~(begin
(use-modules (guix build utils) (use-modules (guix build utils)
(gnu build marionette)) (gnu build marionette))
@ -178,11 +180,9 @@ cp /etc/litl-config.scm /mnt/etc/config.scm
guix system init /mnt/etc/config.scm /mnt --no-substitutes guix system init /mnt/etc/config.scm /mnt --no-substitutes
sync sync
reboot\n")) reboot\n"))
marionette)))) marionette)))))
(gexp->derivation "installation" install (gexp->derivation "installation" install)))
#:modules '((guix build utils)
(gnu build marionette)))))
(define %test-installed-os (define %test-installed-os