From c94a2ab00834214c85be6d9221a598aea4ca8cce Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 3 Nov 2019 02:52:13 -0600 Subject: gn: Add secondary gitea systemd service --- gn/services/gitea-container.scm | 16 ++++++++-------- gn/services/gitea-nocontainer.service | 10 ++++++++++ gn/services/gitea.service | 3 ++- 3 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 gn/services/gitea-nocontainer.service diff --git a/gn/services/gitea-container.scm b/gn/services/gitea-container.scm index bc861c0..2deb7bf 100644 --- a/gn/services/gitea-container.scm +++ b/gn/services/gitea-container.scm @@ -6,7 +6,7 @@ (ice-9 match)) (use-service-modules base networking shepherd) -(define %GITEA_WORK_DIR "/var/lib/gitea") +(define %GITEA_WORK_DIR "/var/lib/git/gitea") (define-record-type* gitea-configuration make-gitea-configuration @@ -16,7 +16,7 @@ (work-dir gitea-configuration-work-dir ; string (default %GITEA_WORK_DIR)) (port gitea-configuration-port ; number - (default 3001))) + (default 3300))) (define gitea-activation (match-lambda @@ -47,7 +47,7 @@ (list (string-append "GITEA_WORK_DIR=" #$work-dir) (string-append "HOME=" #$work-dir)) #:user "gitea" - #:group "gitea")) + #:group "git")) (stop #~(make-kill-destructor))))))) (define gitea-service-type @@ -80,14 +80,14 @@ (users (cons (user-account (name "gitea") (group "gitea") - (system? #t) - (uid 1009)) + ;(system? #t) + (uid 1021)) %base-user-accounts)) (groups (cons (user-group - (name "gitea") - (system? #t) - (id 1009)) + (name "git") + ;(system? #t) + (id 998)) %base-groups)) (services (list (service dhcp-client-service-type) diff --git a/gn/services/gitea-nocontainer.service b/gn/services/gitea-nocontainer.service new file mode 100644 index 0000000..b18e235 --- /dev/null +++ b/gn/services/gitea-nocontainer.service @@ -0,0 +1,10 @@ +[Unit] +Description=Gitea git server and web ui +Wants=guix-daemon.service + +[Service] +Environment="GITEA_COMMAND=$(GUIX_PACKAGE_PATH=/home/efraimf/workspace/guix-bioinformatics /var/guix/profiles/per-user/efraimf/current-guix/bin/guix build gitea)/bin/gitea" +ExecStart=/bin/su -l gitea -c 'GITEA_WORK_DIR=/var/lib/git/gitea HOME=/var/lib/git/gitea ${GITEA_COMMAND} --port 3300' + +[Install] +WantedBy=multi-user.target diff --git a/gn/services/gitea.service b/gn/services/gitea.service index 3b54f85..ee596dc 100644 --- a/gn/services/gitea.service +++ b/gn/services/gitea.service @@ -3,7 +3,8 @@ Description=Gitea git server and web ui Wants=guix-daemon.service [Service] -ExecStart=$(/var/guix/profiles/per-user/efraim/current-guix/bin/guix system container /home/efraimf/workspace/guix-bioinformatics/gn/services/gitea-container.scm --share=/home/efraimf/tmp=/var/lib --network) +Environment="GITEA_COMMAND=$(/var/guix/profiles/per-user/efraimf/current-guix/bin/guix system container /home/efraimf/workspace/guix-bioinformatics/gn/services/gitea-container.scm --share=/var/lib/git=/var/lib/git --network)" +ExecStart=/bin/bash -c '${GITEA_COMMAND}' [Install] WantedBy=multi-user.target -- cgit v1.2.3