aboutsummaryrefslogtreecommitdiff
path: root/guix/forge
diff options
context:
space:
mode:
Diffstat (limited to 'guix/forge')
-rw-r--r--guix/forge/laminar.scm44
1 files changed, 21 insertions, 23 deletions
diff --git a/guix/forge/laminar.scm b/guix/forge/laminar.scm
index eb9bc87..8819a2f 100644
--- a/guix/forge/laminar.scm
+++ b/guix/forge/laminar.scm
@@ -101,29 +101,27 @@ of @var{<forge-laminar-job>} objects."
(configuration-directory (string-append state-directory "/cfg"))
(groups-configuration (string-append configuration-directory "/groups.conf"))
(jobs-directory (string-append configuration-directory "/jobs")))
- #~(begin
- ;; Ensure configuration directory exists.
- (mkdir-p #$configuration-directory)
- ;; Configure groups.
- (when (file-exists? #$groups-configuration)
- (delete-file #$groups-configuration))
- (symlink #$(laminar-groups (forge-laminar-configuration-groups config))
- #$groups-configuration)
- ;; Create jobs directory and populate with job scripts.
- (mkdir-p #$(dirname jobs-directory))
- (when (file-exists? #$jobs-directory)
- (delete-file #$jobs-directory))
- (symlink #$(laminar-jobs (forge-laminar-configuration-jobs config))
- #$jobs-directory)
- ;; Set permissions for laminar directory.
- (for-each (lambda (file)
- (let ((user (getpw "laminar")))
- (chown file (passwd:uid user) (passwd:gid user))))
- (find-files #$state-directory
- (lambda (file stat)
- (memq (stat:type stat)
- '(regular directory)))
- #:directories? #t)))))
+ (with-imported-modules '((guix build utils))
+ #~(begin
+ (use-modules (guix build utils))
+
+ ;; Ensure configuration directory exists.
+ (mkdir-p #$configuration-directory)
+ ;; Configure groups.
+ (switch-symlinks #$groups-configuration
+ #$(laminar-groups (forge-laminar-configuration-groups config)))
+ ;; Create jobs directory and populate with job scripts.
+ (switch-symlinks #$jobs-directory
+ #$(laminar-jobs (forge-laminar-configuration-jobs config)))
+ ;; Set permissions for laminar directory.
+ (for-each (lambda (file)
+ (let ((user (getpw "laminar")))
+ (chown file (passwd:uid user) (passwd:gid user))))
+ (find-files #$state-directory
+ (lambda (file stat)
+ (memq (stat:type stat)
+ '(regular directory)))
+ #:directories? #t))))))
(define forge-laminar-service-type
(service-type