aboutsummaryrefslogtreecommitdiff
path: root/guix/utils.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-04-26 22:20:57 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-05-31 14:52:14 -0400
commitd7c4e7a0c238fa5e51b32a84e4c244d553f05621 (patch)
tree1d60c24c17cc5a4b3c7be00174456b339fb23aa3 /guix/utils.scm
parent5bc1ede86269b445c14afbf484fd8872c2275d4d (diff)
downloadguix-d7c4e7a0c238fa5e51b32a84e4c244d553f05621.tar
guix-d7c4e7a0c238fa5e51b32a84e4c244d553f05621.tar.gz
utils: Add a %guix-source-root-directory procedure.
* guix/utils.scm (%guix-source-root-directory): New procedure.
Diffstat (limited to 'guix/utils.scm')
-rw-r--r--guix/utils.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/guix/utils.scm b/guix/utils.scm
index e169624ee6..37b2e29800 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -78,6 +78,7 @@
substitute-keyword-arguments
ensure-keyword-arguments
+ %guix-source-root-directory
current-source-directory
nix-system->gnu-triplet
@@ -1031,6 +1032,10 @@ environment variable name like \"XDG_CONFIG_HOME\"; SUFFIX is a suffix like
;;; Source location.
;;;
+(define (%guix-source-root-directory)
+ "Return the source root directory of the Guix found in %load-path."
+ (dirname (absolute-dirname "guix/packages.scm")))
+
(define absolute-dirname
;; Memoize to avoid repeated 'stat' storms from 'search-path'.
(mlambda (file)