aboutsummaryrefslogtreecommitdiff
path: root/guix.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2016-09-11 21:22:39 +0300
committerEfraim Flashner <efraim@flashner.co.il>2016-09-18 23:19:44 +0300
commit4d98bfaf23852766e923e017f4334f4219c1d142 (patch)
treec94ec7bf7c7a3a5e4be9f1f13ebdc3a01aad018a /guix.scm
parent4d3fa5a4215c6daa3fbd5ef96e55a7aa96211ee6 (diff)
downloadguix-4d98bfaf23852766e923e017f4334f4219c1d142.tar.gz
guix-4d98bfaf23852766e923e017f4334f4219c1d142.zip
gnu: Add python-peewee.
* gnu/packages/databases.scm (python-peewee): New variable.
Diffstat (limited to 'guix.scm')
0 files changed, 0 insertions, 0 deletions
uot;/share/gcide") #~(string-append "idxdir=" #$%dicod-gcide-index))))) (define %dicod-accounts (list (user-group (name "dicod") (system? #t)) (user-account (name "dicod") (group "dicod") (system? #t) (home-directory "/var/empty") (shell (file-append shadow "/sbin/nologin"))))) (define (dicod-configuration-file config) (define handler->text (match-lambda (($ <dicod-handler> name #f '()) `(" load-module " ,name ";")) (($ <dicod-handler> name #f options) (handler->text (dicod-handler (name name) (module name) (options options)))) (($ <dicod-handler> name module options) `(" load-module " ,name " { command \"" ,module (string-join (list ,@options) " " 'prefix) "\"; }\n")))) (define database->text (match-lambda (($ <dicod-database> name handler #f options) (append (handler->text (dicod-handler (name handler))) (database->text (dicod-database (name name) (handler handler) (complex? #t) (options options))))) (($ <dicod-database> name handler complex? options) `(" database { name \"" ,name "\"; handler \"" ,handler (string-join (list ,@options) " " 'prefix) "\"; }\n")))) (define configuration->text (match-lambda (($ <dicod-configuration> dico (interfaces ...) handlers databases) (append `("listen (" ,(string-join interfaces ", ") ");\n") (append-map handler->text handlers) (append-map database->text databases))))) (apply mixed-text-file "dicod.conf" (configuration->text config))) (define (dicod-shepherd-service config) (let* ((dicod.conf (dicod-configuration-file config)) (interfaces (dicod-configuration-interfaces config)) (home-service? (dicod-configuration-home-service? config)) (mappings `(,@(if home-service? '() (list (file-system-mapping (source "/dev/log") (target source)))) ,(file-system-mapping (source dicod.conf) (target source)))) (dicod (least-authority-wrapper (file-append (dicod-configuration-dico config) "/bin/dicod") #:name "dicod" #:mappings mappings #:namespaces (delq 'net %namespaces)))) (list (shepherd-service (provision '(dicod)) (requirement (if home-service? '() '(user-processes))) (documentation "Run the dicod daemon.") (start #~(make-inetd-constructor (list #$dicod "--inetd" "--foreground" (string-append "--config=" #$dicod.conf)) (map (lambda (interface) (endpoint (addrinfo:addr (car (getaddrinfo interface "dict"))))) '#$interfaces) #:requirements '#$requirement #:user #$(and (not home-service?) "dicod") #:group #$(and (not home-service?) "dicod") #:service-name-stem "dicod")) (stop #~(make-inetd-destructor)) (actions (list (shepherd-configuration-action dicod.conf))))))) (define dicod-service-type (service-type (name 'dict) (extensions (list (service-extension account-service-type (const %dicod-accounts)) (service-extension shepherd-root-service-type dicod-shepherd-service))) (default-value (dicod-configuration)) (description "Run @command{dicod}, the dictionary server of @uref{https://www.gnu.org/software/dico, GNU Dico}. @command{dicod} implements the standard DICT protocol supported by clients such as @command{dico} and GNOME Dictionary."))) (define-deprecated (dicod-service #:key (config (dicod-configuration))) dicod-service-type "Return a service that runs the @command{dicod} daemon, an implementation of DICT server (@pxref{Dicod,,, dico, GNU Dico Manual}). The optional @var{config} argument specifies the configuration for @command{dicod}, which should be a @code{<dicod-configuration>} object, by default it serves the GNU Collaborative International Dictionary of English. You can add @command{open localhost} to your @file{~/.dico} file to make @code{localhost} the default server for @command{dico} client (@pxref{Initialization File,,, dico, GNU Dico Manual})." (service dicod-service-type config))