summaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorSughosha <sughosha@disroot.org>2026-03-03 23:48:41 +0530
committerSughosha <sughosha@disroot.org>2026-03-03 23:53:40 +0530
commit2746e071801c5ca037479191f865c91a5373f5cb (patch)
tree3af5f202a21c8302f4e8d7a7ce05252c4b2e0956 /gnu/services
parenta7365acd996079b7c56fce915ae38b2679f33a1c (diff)
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
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/upnp.scm21
1 files changed, 15 insertions, 6 deletions
diff --git a/gnu/services/upnp.scm b/gnu/services/upnp.scm
index 8ae6c2f928e..16c32463534 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)