1
0
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:
Sughosha
2026-03-03 23:48:41 +05:30
parent a7365acd99
commit 2746e07180
2 changed files with 17 additions and 7 deletions

View File

@@ -47045,7 +47045,8 @@ folder.
@table @asis @table @asis
@item @code{path} (type: string) @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) @item @code{types} (default: @code{'()}) (type: list)
A list indicating the types of file included in the media folder. A list indicating the types of file included in the media folder.

View File

@@ -224,12 +224,21 @@
(use-modules (gnu build activation)) (use-modules (gnu build activation))
(for-each (lambda (directory) (for-each (lambda (directory)
(unless (file-exists? directory) (let ((directory
(mkdir-p/perms directory (if #$home-service?
(getpw #$(if home-service? (if (absolute-file-name? directory)
#~(getuid) directory
%readymedia-user-account)) (string-append (or (getenv "HOME")
#$(if home-service? #o755 #o775)))) (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 (list #$@(map readymedia-media-directory-path
media-directories))) media-directories)))
(for-each (lambda (directory) (for-each (lambda (directory)