mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02:00
services: readymedia: Allow relative paths to media directories.
* gnu/services/upnp.scm (readymedia-activation): For home services, if the media directory paths are relative, create it in the user's home directory. * doc/guix.texi (Miscellaneous Services)[DLNA/UPnP Services]: Update doc. Change-Id: I39176320d6c33c56c5b80ad9e67e989ee41565da
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user