diff --git a/guix/gexp.scm b/guix/gexp.scm
index b4d737ecaee2c4eaccd2c3b7a3fddc51bcb445d6..8e604ff7cf53ff5850b4cc42021bb18da8b2ee29 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -202,19 +202,6 @@ (define* (%local-file file promise #:optional (name (basename file))
   ;; %%LOCAL-FILE is not.
   (%%local-file file promise name recursive?))
 
-(define (extract-directory properties)
-  "Extract the directory name from source location PROPERTIES."
-  (match (assq 'filename properties)
-    (('filename . (? string? file-name))
-     (dirname file-name))
-    (_
-     #f)))
-
-(define-syntax-rule (current-source-directory)
-  "Expand to the directory of the current source file or #f if it could not
-be determined."
-  (extract-directory (current-source-location)))
-
 (define (absolute-file-name file directory)
   "Return the canonical absolute file name for FILE, which lives in the
 vicinity of DIRECTORY."
diff --git a/guix/utils.scm b/guix/utils.scm
index 2d8bfd84b0a010b1bc3593aa48fe95e5f0704ca2..19fd0b084446e04aff50a6fe84acae3620875d83 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -53,6 +53,8 @@ (define-module (guix utils)
             substitute-keyword-arguments
             ensure-keyword-arguments
 
+            current-source-directory
+
             <location>
             location
             location?
@@ -700,6 +702,19 @@ (define (read! bv start n)
 ;;; Source location.
 ;;;
 
+(define (extract-directory properties)
+  "Extract the directory name from source location PROPERTIES."
+  (match (assq 'filename properties)
+    (('filename . (? string? file-name))
+     (dirname file-name))
+    (_
+     #f)))
+
+(define-syntax-rule (current-source-directory)
+  "Expand to the directory of the current source file or #f if it could not
+be determined."
+  (extract-directory (current-source-location)))
+
 ;; A source location.
 (define-record-type <location>
   (make-location file line column)