diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 05c77fe3e85134c3e64ac11acc29c2802aa7a40f..cbaca88e15561ced577382d1bf35313594a1fa46 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -52,7 +52,16 @@ (define-module (gnu system file-systems) mapped-device-kind mapped-device-kind? mapped-device-kind-open - mapped-device-kind-close)) + mapped-device-kind-close + + <file-system-mapping> + file-system-mapping + file-system-mapping? + file-system-mapping-source + file-system-mapping-target + file-system-mapping-writable? + + %store-mapping)) ;;; Commentary: ;;; @@ -199,4 +208,25 @@ (define-record-type* <mapped-device-type> mapped-device-kind (close mapped-device-kind-close ;source target -> gexp (default (const #~(const #f))))) + +;;; +;;; Shared file systems, for VMs/containers. +;;; + +;; Mapping of host file system SOURCE to mount point TARGET in the guest. +(define-record-type* <file-system-mapping> file-system-mapping + make-file-system-mapping + file-system-mapping? + (source file-system-mapping-source) ;string + (target file-system-mapping-target) ;string + (writable? file-system-mapping-writable? ;Boolean + (default #f))) + +(define %store-mapping + ;; Mapping of the host's store into the guest. + (file-system-mapping + (source (%store-prefix)) + (target (%store-prefix)) + (writable? #f))) + ;;; file-systems.scm ends here diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index e194ed6cf1866119743fe7e51c2471488d0db07a..690022dcd8dec0af1353e22d695d2d5848e2b5d9 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -58,12 +58,6 @@ (define-module (gnu system vm) qemu-image system-qemu-image - file-system-mapping - file-system-mapping? - file-system-mapping-source - file-system-mapping-target - file-system-mapping-writable? - system-qemu-image/shared-store system-qemu-image/shared-store-script system-disk-image)) @@ -354,22 +348,6 @@ (define file-systems-to-keep ;;; VMs that share file systems with the host. ;;; -;; Mapping of host file system SOURCE to mount point TARGET in the guest. -(define-record-type* <file-system-mapping> file-system-mapping - make-file-system-mapping - file-system-mapping? - (source file-system-mapping-source) ;string - (target file-system-mapping-target) ;string - (writable? file-system-mapping-writable? ;Boolean - (default #f))) - -(define %store-mapping - ;; Mapping of the host's store into the guest. - (file-system-mapping - (source (%store-prefix)) - (target (%store-prefix)) - (writable? #f))) - (define (file-system->mount-tag fs) "Return a 9p mount tag for host file system FS." ;; QEMU mount tags cannot contain slashes and cannot start with '_'. diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index aa9b3f838ae84115a32a19ffaf3dd669a5a6d4ee..6084ab8a372c5ced08748391912167dc4b0b1575 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -30,6 +30,7 @@ (define-module (guix scripts system) #:use-module (guix build utils) #:use-module (gnu build install) #:use-module (gnu system) + #:use-module (gnu system file-systems) #:use-module (gnu system vm) #:use-module (gnu system grub) #:use-module (gnu packages grub)