diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index 9caa110463..dfb1465fd5 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -363,14 +363,18 @@ (define* (root-partition-initializer #:key (closures '()) copy-closures? (register-closures? #t) system-directory - (deduplicate? #t)) + (deduplicate? #t) + (extra-directives '())) "Return a procedure to initialize a root partition. If REGISTER-CLOSURES? is true, register all of CLOSURES in the partition's store. If DEDUPLICATE? is true, then also deduplicate files common to CLOSURES and the rest of the store when registering the closures. If COPY-CLOSURES? is true, copy all of CLOSURES to the partition. -SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation." +SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation. + +EXTRA-DIRECTIVES is an optional list of directives to populate the root file +system that is passed to 'populate-root-file-system'." (lambda (target) (define target-store (string-append target (%store-directory))) @@ -403,7 +407,8 @@ (define target-store ;; Add the non-store directories and files. (display "populating...\n") - (populate-root-file-system system-directory target) + (populate-root-file-system system-directory target + #:extras extra-directives) ;; 'register-closure' resets timestamps and everything, so no need to do it ;; once more in that case. diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 04d84b5220..8baed372cb 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -368,6 +368,7 @@ (define* (qemu-image #:key (disk-image-size 'guess) (disk-image-format "qcow2") (file-system-type "ext4") + (extra-directives '()) file-system-label file-system-uuid os @@ -392,7 +393,10 @@ (define* (qemu-image #:key register INPUTS in the store database of the image so that Guix can be used in the image. By default, REGISTER-CLOSURES? is set to true only if a service of type GUIX-SERVICE-TYPE is present in the services definition of the operating -system." +system. + +EXTRA-DIRECTIVES is an optional list of directives to populate the root file +system that is passed to 'populate-root-file-system'." (define schema (and register-closures? (local-file (search-path %load-path @@ -441,6 +445,7 @@ (define schema (((names . _) ...) names))) (initialize (root-partition-initializer + #:extra-directives '#$extra-directives #:closures graphs #:copy-closures? #$copy-inputs? #:register-closures? #$register-closures?