diff --git a/doc/guix.texi b/doc/guix.texi index 4c113518fa..15ed74ed0c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -47045,7 +47045,8 @@ folder. @table @asis @item @code{path} (type: string) -The media folder location. +The media folder location. For Guix Home services, if the path is +relative, it will be looked up in the user's home directory. @item @code{types} (default: @code{'()}) (type: list) A list indicating the types of file included in the media folder. diff --git a/gnu/services/upnp.scm b/gnu/services/upnp.scm index 8ae6c2f928..16c3246353 100644 --- a/gnu/services/upnp.scm +++ b/gnu/services/upnp.scm @@ -224,12 +224,21 @@ (use-modules (gnu build activation)) (for-each (lambda (directory) - (unless (file-exists? directory) - (mkdir-p/perms directory - (getpw #$(if home-service? - #~(getuid) - %readymedia-user-account)) - #$(if home-service? #o755 #o775)))) + (let ((directory + (if #$home-service? + (if (absolute-file-name? directory) + directory + (string-append (or (getenv "HOME") + (passwd:dir + (getpwuid (getuid)))) + "/" directory)) + directory))) + (unless (file-exists? directory) + (mkdir-p/perms directory + (getpw #$(if home-service? + #~(getuid) + %readymedia-user-account)) + #$(if home-service? #o755 #o775))))) (list #$@(map readymedia-media-directory-path media-directories))) (for-each (lambda (directory)