Giacomo Leidi 4 years ago
parent
commit
d0cd8e0db2
1 changed files with 11 additions and 9 deletions
  1. 11 9
      mastostart-gnu/services/mastostart.scm

+ 11 - 9
mastostart-gnu/services/mastostart.scm

@@ -77,15 +77,17 @@
       (one-shot? #t)
       (requirement '(httpd mysql))
       (documentation "Start serving the MastodonStartpage.")
-      (start #~(lambda _
-                 (if (equal? #$(scandir webroot) '("." ".."))
-                     (begin
-                       (invoke #$(file-append coreutils "/bin/rm") "-rf"
-                               #$webroot)
-                       (invoke #$(file-append coreutils "/bin/ln") "-s"
-                               #$(file-append mastostart "/web")
-                               #$webroot))
-                     #t)))
+      (start (with-imported-modules '((ice-9 ftw))
+               #~(lambda _
+                   (use-modules (ice-9 ftw))
+                   (if (equal? (scandir #$webroot) '("." ".."))
+                       (begin
+                         (invoke #$(file-append coreutils "/bin/rm") "-rf"
+                                 #$webroot)
+                         (invoke #$(file-append coreutils "/bin/ln") "-s"
+                                 #$(file-append mastostart "/web")
+                                 #$webroot))
+                       #t))))
       (stop #~(make-kill-destructor))))))
 
 (define mastostart-service-type