aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix 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 General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu services science)
  #:export (<rshiny-configuration>
            rshiny-configuration
            rshiny-configuration?
            rshiny-configuration-package
            rshiny-configuration-binary
            rshiny-shepherd-service
            rshiny-service-type))

(use-modules (gnu)
             (guix records)
             (ice-9 match))
(use-service-modules shepherd)
(use-package-modules cran)

(define-record-type* <rshiny-configuration>
  rshiny-configuration
  make-rshiny-configuration
  rshiny-configuration?
  (package          rshiny-configuration-package    ; file-like
                    (default r-shiny))
  (binary           rshiny-configuration-binary     ; string
                    (default "rshiny")))

(define rshiny-shepherd-service
  (match-lambda
    (($ <rshiny-configuration> package binary)
     (list
       (shepherd-service
         (documentation (string-append "R-Shiny service for " binary))
         (provision (list (symbol-append 'rshiny- (string->symbol
                                                    (string-take binary 9)))))
         (requirement '(networking))
         (start
           #~(exec-command
               (list
                 #$(string-append "/run/current-system/profile/bin/" binary))
               ;#:log-file #$(string-append "/var/log/" binary ".log") ; kills shepherd
               #:environment-variables
               (list "R_LIBS_USER=/run/current-system/profile/site-library/")))
         (stop #~(make-kill-destructor)))))))

(define rshiny-service-type
  (service-type
    (name 'rshiny)
    (extensions
      (list
        (service-extension shepherd-root-service-type
                           rshiny-shepherd-service)
        (service-extension profile-service-type
                           ;; We want the package installed so that it
                           ;; pulls in the propagated inputs as well.
                           (lambda (config)
                             (list
                               (rshiny-configuration-package config))))))
    (description
     "Run an R-Shiny webapp as a Guix Service.")))
n title='2023-04-14 17:15:08 -0400'>2023-04-14Merge branch 'master' into core-updates....Maxim Cournoyer 2023-04-13Merge staging branch....Maxim Cournoyer 2023-04-12gnu: icecat: Update to 102.10.0-guix0-preview1 [security fixes]....Mark H Weaver 2023-04-12gnu: icedove: Use native notifications when available....SeerLite 2023-04-12gnu: icedove: Update to 102.10.0 [security fixes]....Jonathan Brielmaier 2023-04-11gnu: icecat: Update to 102.10.0-guix0-preview1 [security fixes]....Mark H Weaver 2023-03-31Merge branch 'master' into stagingMaxim Cournoyer 2023-03-31gnu: icedove: Update to 102.9.1 [fixes CVE-2023-28427]....Jonathan Brielmaier 2023-03-28gnu: ffmpeg: Update to 6.0....Maxim Cournoyer 2023-03-20Merge remote-tracking branch 'origin/master' into core-updatesAndreas Enge 2023-03-16gnu: icedove: Update to 102.9.0....Jonathan Brielmaier 2023-03-14gnu: icecat: Update to 102.9.0-guix0-preview1 [security fixes]....Mark H Weaver 2023-03-04gnu: nss: Update to 3.88.1....Ludovic Courtès 2023-03-02Merge remote-tracking branch 'savannah/master' into core-updates...Christopher Baines 2023-03-01gnu: icecat: Remove unsupported --disable-eme option on aarch64....r0man 2023-03-02gnu: make-mozilla-with-l10n: Use the copy-build-system....Maxim Cournoyer 2023-02-20gnu: icedove: Truly prevent it from generating a new profile on every upgrade....Maxim Cournoyer 2023-02-20gnu: icedove: Install the icons of the 'comm' component....Maxim Cournoyer 2023-02-19gnu: icecat: Unbundle nss and nspr....Maxim Cournoyer 2023-02-19gnu: icecat: Remove gtk+-2 input....Maxim Cournoyer 2023-02-19gnu: icedove: Use the locale of the system....Maxim Cournoyer 2023-02-19gnu: Add language packs to icecat and icedove....Maxim Cournoyer 2023-02-19gnu: icedove: Automatically load system-provided extensions....Maxim Cournoyer 2023-02-19gnu: Add icecat-l10n and icedove-l10n....Maxim Cournoyer 2023-02-19gnu: icecat-source: Update gnuzilla to f23f8b609....Maxim Cournoyer 2023-02-19gnu: Define %icecat-base-version at the top level....Maxim Cournoyer 2023-02-19gnu: icedove: Compute a self-contained source....Maxim Cournoyer 2023-02-19gnu: Add a 'update-mozilla-locales' helper for maintenance....Maxim Cournoyer 2023-02-15gnu: icecat: Update to 102.8.0-guix0-preview1 [security fixes]....Mark H Weaver 2023-02-15gnu: icecat: Update the "ach" locale....Maxim Cournoyer 2023-02-13gnu: icedove: Install icons....Maxim Cournoyer 2023-02-13gnu: icedove: Use more gexps....Maxim Cournoyer 2023-02-13gnu: icedove: Unbundle NSS....Maxim Cournoyer 2023-02-13gnu: icedove-wayland: Use gexps....Maxim Cournoyer 2023-02-13gnu: icedove: Update to 102.7.2....Josselin Poiret 2023-01-30Merge remote-tracking branch 'origin/master' into core-updates...Efraim Flashner 2023-01-29gnu: icedove: Update to 102.7.0....Jonathan Brielmaier 2023-01-17gnu: icecat: Update to 102.7.0-guix0-preview1 [security fixes]....Mark H Weaver 2023-01-04gnu: hunspell: Move hunspell and dictionaries to hunspell module....Brian Cully