aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Sou Bunnbu <iyzsong@member.fsf.org>
;;;
;;; 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 sysctl)
  #:use-module (gnu services)
  #:use-module (gnu services shepherd)
  #:use-module (gnu packages linux)
  #:use-module (guix gexp)
  #:use-module (guix records)
  #:use-module (srfi srfi-1)
  #:use-module (ice-9 match)
  #:export (sysctl-configuration
            sysctl-configuration-sysctl
            sysctl-configuration-settings
            sysctl-service-type
            %default-sysctl-settings))


;;;
;;; System Control Service.
;;;

(define %default-sysctl-settings
  ;; Default kernel parameters enabled with sysctl.
  '(("fs.protected_hardlinks" . "1")
    ("fs.protected_symlinks" . "1")))

(define-record-type* <sysctl-configuration>
  sysctl-configuration make-sysctl-configuration
  sysctl-configuration?
  (sysctl   sysctl-configuration-sysctl    ; path of the 'sysctl' command
            (default (file-append procps "/sbin/sysctl")))
  (settings sysctl-configuration-settings  ; alist of string pairs
            (default %default-sysctl-settings)))

(define (sysctl-configuration-settings->sysctl.conf settings)
  "Return a file for @command{sysctl} to set kernel parameters as specified by
@var{settings}."
  (apply mixed-text-file "sysctl.conf"
         (append-map (match-lambda
                       ((key . value)
                        (list key "=" value "\n")))
                     settings)))

(define sysctl-shepherd-service
  (match-lambda
    (($ <sysctl-configuration> sysctl settings)
     (let ((sysctl.conf
            (sysctl-configuration-settings->sysctl.conf settings)))
       (shepherd-service
        (documentation "Configure kernel parameters at boot.")
        (provision '(sysctl))
        (start #~(lambda _
                   (zero? (system* #$sysctl "--load" #$sysctl.conf))))
        (one-shot? #t))))))

(define sysctl-service-type
  (service-type
   (name 'sysctl)
   (extensions
    (list (service-extension shepherd-root-service-type
                             (compose list sysctl-shepherd-service))))
   (compose concatenate)
   (extend (lambda (config settings)
             (sysctl-configuration
              (inherit config)
              (settings (append (sysctl-configuration-settings config)
                                settings)))))
   (default-value (sysctl-configuration))
   (description "Set Linux kernel parameters under @file{/proc/sys} at system
startup time.")))
d>gnu: Add elm-justinmimbs-time-extra....* gnu/packages/elm.scm (elm-justinmimbs-time-extra): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-justinmimbs-date....* gnu/packages/elm.scm (elm-justinmimbs-date): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-danhandrea-elm-time-extra....* gnu/packages/elm.scm (elm-danhandrea-elm-time-extra): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-danhandrea-elm-date-format....* gnu/packages/elm.scm (elm-danhandrea-elm-date-format): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-explorations-test....* gnu/packages/elm.scm (elm-explorations-test): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-random....* gnu/packages/elm.scm (elm-random): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-debois-elm-dom....* gnu/packages/elm.scm (elm-debois-elm-dom): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-todomvc....* gnu/packages/elm.scm (elm-todomvc): New variable. * doc/guix.texi (Build Systems)[elm-build-system]: Mention it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: elm: Support 'elm reactor'....* gnu/packages/elm.scm (elm): Rename to ... (elm-sans-reactor): ... this new variable. [synopsis, description]: Tweak. (elm): New variable. * guix/build-system/elm.scm (default-elm): Use elm-sans-reactor. * doc/guix.texi (Build Systems)[elm-build-system]: Update accordingly. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-explorations-markdown....* gnu/packages/elm.scm (elm-explorations-markdown): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-project-metadata-utils....* gnu/packages/elm.scm (elm-project-metadata-utils): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-parser....* gnu/packages/elm.scm (elm-parser): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-http....* gnu/packages/elm.scm (elm-http): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-file....* gnu/packages/elm.scm (elm-file): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-bytes....* gnu/packages/elm.scm (elm-bytes): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-browser....* gnu/packages/elm.scm (elm-browser): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-url....* gnu/packages/elm.scm (elm-url): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-time....* gnu/packages/elm.scm (elm-time): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-svg....* gnu/packages/elm.scm (elm-svg): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-html....* gnu/packages/elm.scm (elm-html): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-virtual-dom....* gnu/packages/elm.scm (elm-virtual-dom): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: Add elm-core and elm-json....Both of these packages are needed for 'elm-build-system' to work. * gnu/packages/elm.scm (elm-core, elm-json, elm-json-bootstrap): New variables. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22guix: Add elm-build-system....* gnu/packages/patches/elm-offline-package-registry.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/elm.scm (elm): Use it. * guix/build-system/elm.scm, guix/build/elm-build-system.scm, tests/elm.scm: New files. * Makefile.scm (MODULES, SCM_TESTS): Add them. * doc/guix.texi (Build Systems): Document 'elm-build-system'. * doc/contributing.texi (Elm Packages): New section. Document naming conventions and utilities. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: elm: Rename package to match the command....* gnu/packages/elm.scm (elm-compiler): Rename to ... (elm): ... this variable, leaving 'elm-compiler' as a deprecated alias. [description]: Tweak. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2022-05-22gnu: elm-compiler: Update to 0.19.1....* gnu/packages/patches/elm-compiler-disable-reactor.patch, gnu/packages/patches/elm-compiler-fix-map-key.patch: Delete files. * gnu/packages/patches/elm-reactor-static-files.patch: New file. * gnu/local.mk (dist_patch_DATA): Update accordingly. * gnu/packages/elm.scm (elm-compiler): Update to 0.19.1. [origin]<patches>: Remove stale patches. Add new patch. [arguments]: Use G-expressions. Add #:configure-flags for new patch. [inputs]: Remove ghc-file-embed. Add ghc-filelock. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Philip McGrath 2021-12-13gnu: Simplify package inputs....This commit was obtained by running: ./pre-inst-env guix style without any additional argument. Ludovic Courtès 2021-10-08gnu: Update Haskell ecosystem....Bump packages’ versions to the lastest Stackage or Hackage release. Since packages are interdependent, do so in a single commit. 525 packages have been updated. These packages have been removed, because they fail to build, have no newer version available and no dependencies: corrode ghc-easytest ghc-edisonapi ghc-edisoncore ghc-pandoc-types ghc-regex-tdfa-text These have been removed, because they are no longer required: ghc-happy-1.19.9 ghc-prettyprinter-1.6 ghc-protolude-0.3 ghc-pandoc-citeproc and pandoc-citeproc have been removed, because pandoc does not use them any more. Co-authored-by: Xinglu Chen <public@yoctocell.xyz> Lars-Dominik Braun 2019-11-20gnu: elm-compiler: Fix Cabal dependency constraints....This package used a patch to update the Cabal version constraints for 'language-glsl'. This is now done in a phase for consistency with other Haskell packages. * gnu/packages/elm.scm (elm-compiler): Add a phase that updates the Cabal file to allow for newer versions of 'ansi-terminal', 'containers', 'http-client', 'language-glsl', and 'network'. [source]: Remove 'elm-compiler-relax-glsl-bound.patch'. * gnu/packages/patches/elm-compiler-relax-glsl-bound.patch: Delete file. * gnu/local.mk: Remove it. Timothy Sample 2019-08-17gnu: Add elm-compiler 0.19.0...This adds the elm compiler, version 0.19.0. This provides the `elm` command, with the exception of the `elm reactor` subcommand. Named `elm-compiler`, to leave space for `elm` as the full elm including reactor. * gnu/packages/elm.scm: New module. (elm-compiler): New package. * gnu/packages/patches/elm-disable-reactor.patch: New patch. * gnu/packages/patches/elm-fix-map-key.patch: New patch. * gnu/packages/patches/elm-relax-glsl-bound.patch: New patch. * gnu/local.mk: Add new files. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Robert Vollmert