summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-12-03 17:13:20 +0100
committerFlorian Dold <florian.dold@gmail.com>2018-12-03 17:13:20 +0100
commit6eac1d1eb203c693ee918594fd237f0598c28e72 (patch)
treee2fd46ed3d2ca43ec9c01d5cfbfbd2e7e1af7485 /guix
parent8dcecc10545b50eadca87903aee141e7a370f817 (diff)
downloaddeployment-6eac1d1eb203c693ee918594fd237f0598c28e72.tar.gz
deployment-6eac1d1eb203c693ee918594fd237f0598c28e72.tar.bz2
deployment-6eac1d1eb203c693ee918594fd237f0598c28e72.zip
modularization
Diffstat (limited to 'guix')
-rw-r--r--guix/config.scm76
1 files changed, 55 insertions, 21 deletions
diff --git a/guix/config.scm b/guix/config.scm
index 2f59806..b9f4f2c 100644
--- a/guix/config.scm
+++ b/guix/config.scm
@@ -1,33 +1,67 @@
+;;; This file is part of GNU Taler.
+;;; Copyright © 2018 GNUnet e.V.
+;;;
+;;; GNU Taler is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU Affero General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Taler is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU Affero General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU Affero General Public License
+;;; along with GNU Taler. If not, see <http://www.gnu.org/licenses/>.
+
+;; Load modules relative to the script name.
+(set! %load-path (cons (current-source-directory) %load-path))
+
(use-modules
(srfi srfi-1)
(ice-9 textual-ports)
(gnu)
(guix)
- (guix gexp))
+ (guix gexp)
+ (taler-helpers))
+
(use-system-modules nss)
(use-service-modules networking ssh version-control cgit databases admin web)
(use-package-modules base bash shells web tls)
+;;; Commentary:
+;;;
+;;; The GNU/Linux system that runs on gv.taler.net is defined here.
+
+
+;;;
+;;; Our definition of the fcgiwrap-service,
+;;; this should eventually go upstream.
+;;;
+
+(define my-fcgiwrap-shepherd-service
+ (match-lambda
+ (($ <fcgiwrap-configuration> package socket user group)
+ (list (shepherd-service
+ (provision '(fcgiwrap))
+ (documentation "Run the fcgiwrap daemon.")
+ (requirement '(networking))
+ (start #~(make-forkexec-constructor
+ '(#$(file-append package "/sbin/fcgiwrap")
+ "-s" #$socket)
+ #:user #$user #:group #$group))
+ (stop #~(make-kill-destructor)))))))
-(define (absolute-file-name file directory)
- "Return the canonical absolute file name for FILE, which lives in the
-vicinity of DIRECTORY."
- (canonicalize-path
- (cond ((string-prefix? "/" file) file)
- ((not directory) file)
- ((string-prefix? "/" directory)
- (string-append directory "/" file))
- (else file))))
+(define my-fcgiwrap-service-type
+ (service-type (name 'fcgiwrap)
+ (extensions
+ (list (service-extension shepherd-root-service-type
+ my-fcgiwrap-shepherd-service)
+ (service-extension account-service-type
+ fcgiwrap-accounts)))
+ (default-value (fcgiwrap-configuration))))
-(define (deployment-file-name file)
- (absolute-file-name file (current-source-directory)))
-(define (concat-local-files outname files)
- (define (slurp f)
- (call-with-input-file (deployment-file-name f) get-string-all))
- (define (file-concat files)
- (string-concatenate (map slurp files)))
- (plain-file outname (file-concat files)))
;;; --- cron jobs start
@@ -247,9 +281,9 @@ vicinity of DIRECTORY."
(service fcgiwrap-service-type
(fcgiwrap-configuration
(socket "unix:/var/run/fcgiwrap.socket")))
- ;(service cgit-service-type
- ; (opaque-cgit-configuration
- ; (cgitrc "/etc/deployment/guix/etc/cgitrc")))
+ ;(service cgit-service-type
+ ; (opaque-cgit-configuration
+ ; (cgitrc "/etc/deployment/guix/etc/cgitrc")))
(service nginx-service-type
(nginx-configuration
(file (file-append %nginx-config