@@ -45726,6 +45726,24 @@ Guix Home Services
@end lisp
@end defvar
+@defvar home-shell-authorized-directories-service-type
+This is the service type for managing
+@file{$XDG_CONFIG_HOME/guix/shell-authorized-directories}, the file that
+controls the loading of @file{manifest.scm} and @file{guix.scm} files by
+@command{guix shell} (@pxref{Invoking guix shell}). Its associated
+value is a list of strings, each of which corresponds to the path of a
+directory @command{guix shell} is authorized to load @file{manifest.scm}
+and @file{guix.scm} files in.
+
+A typical extension for authorizing a directory might look like this:
+
+@lisp
+(simple-service 'authorised-direcotries
+ home-shell-authorized-directories-service-type
+ (list "~/guix" "some/other/project/"))
+@end lisp
+@end defvar
+
@node Fonts Home Services
@subsection Fonts Home Services
@@ -22,7 +22,9 @@ (define-module (gnu home services guix)
#:use-module (guix gexp)
#:use-module (ice-9 pretty-print)
#:use-module (srfi srfi-1)
- #:export (home-channels-service-type))
+ #:use-module (srfi srfi-26)
+ #:export (home-channels-service-type
+ home-shell-authorized-directories-service-type))
(define (channels-xdg-files channels)
`(("guix/channels.scm"
@@ -42,3 +44,22 @@ (define home-channels-service-type
(list (service-extension home-xdg-configuration-files-service-type
channels-xdg-files)))
(description "Manages the per-user Guix channels specification.")))
+
+(define (shell-authorized-directories-files directories)
+ `(("guix/shell-authorized-directories"
+ ,(plain-file
+ "shell-authorized-directories"
+ (call-with-output-string
+ (lambda (port)
+ (map (cut format port "~a~%" <>) directories)))))))
+
+(define home-shell-authorized-directories-service-type
+ (service-type
+ (name 'shell-authorized-directories)
+ (default-value '())
+ (compose concatenate)
+ (extend append)
+ (extensions
+ (list (service-extension home-xdg-configuration-files-service-type
+ shell-authorized-directories-files)))
+ (description "Manages guix shell authorized directories.")))