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.")))
12.0. [source](patches): Remove 'pulseaudio-glibc-2.27.patch'. [arguments]: Remove related 'bootstrap' phase. [native-inputs]: Remove AUTOCONF, AUTOMAKE and LIBTOOL. Add GLIB:BIN. Marius Bakke 2018-03-25gnu: pulseaudio: Fix build with glibc-2.27....* gnu/packages/patches/pulseaudio-glibc-2.27.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/pulseaudio.scm (pulseaudio)[source]: Add the patch. [arguments]: Replace 'bootstrap' phase. [native-inputs]: Add autoconf, automake, and libtool. Mark H Weaver 2018-03-17gnu: libsndfile: Ungraft....* gnu/packages/pulseaudio.scm (libsndfile)[replacement]: Remove field. [source]: Add patch from former replacement. (libsndfile/fixed): Remove variable. Mark H Weaver 2018-03-16gnu: All snippets report errors using exceptions, else return #t....* gnu/packages/admin.scm, gnu/packages/algebra.scm, gnu/packages/audio.scm, gnu/packages/backup.scm, gnu/packages/base.scm, gnu/packages/bioinformatics.scm, gnu/packages/cdrom.scm, gnu/packages/chez.scm, gnu/packages/code.scm, gnu/packages/compression.scm, gnu/packages/cross-base.scm, gnu/packages/crypto.scm, gnu/packages/cups.scm, gnu/packages/databases.scm, gnu/packages/dns.scm, gnu/packages/emacs.scm, gnu/packages/emulators.scm, gnu/packages/engineering.scm, gnu/packages/enlightenment.scm, gnu/packages/fpga.scm, gnu/packages/freedesktop.scm, gnu/packages/ftp.scm, gnu/packages/games.scm, gnu/packages/gcc.scm, gnu/packages/geo.scm, gnu/packages/ghostscript.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnuzilla.scm, gnu/packages/graphics.scm, gnu/packages/gtk.scm, gnu/packages/guile.scm, gnu/packages/irc.scm, gnu/packages/java.scm, gnu/packages/kerberos.scm, gnu/packages/linux.scm, gnu/packages/lisp.scm, gnu/packages/lxde.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/maths.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mp3.scm, gnu/packages/music.scm, gnu/packages/netpbm.scm, gnu/packages/networking.scm, gnu/packages/node.scm, gnu/packages/nvi.scm, gnu/packages/ocaml.scm, gnu/packages/pdf.scm, gnu/packages/perl.scm, gnu/packages/php.scm, gnu/packages/plotutils.scm, gnu/packages/pretty-print.scm, gnu/packages/profiling.scm, gnu/packages/pulseaudio.scm, gnu/packages/python-crypto.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/robotics.scm, gnu/packages/sawfish.scm, gnu/packages/scanner.scm, gnu/packages/scheme.scm, gnu/packages/scribus.scm, gnu/packages/sdl.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/slang.scm, gnu/packages/smalltalk.scm, gnu/packages/ssh.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/tbb.scm, gnu/packages/terminals.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/tls.scm, gnu/packages/unrtf.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vpn.scm, gnu/packages/web.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xorg.scm: In all snippets, report errors using exceptions, or else return #t. Mark H Weaver 2018-03-13gnu: pulsemixer: Declare a source file-name....* gnu/packages/pulseaudio.scm (pulsemixer)[source]: Declare a source file-name. Efraim Flashner 2018-02-26gnu: Use HTTPS for supported freedesktop.org home pages....* gnu/packages/fontutils.scm (fontconfig)[home-page]: Use HTTPS. * gnu/packages/freedesktop.scm (python-pyxdg, accountsservice) (modem-manager, telepathy-mission-control, telepathy-mission-control) (colord-gtk, desktop-file-utils)[home-page]: Likewise. * gnu/packages/ghostscript.scm (libspectre)[home-page]: Likewise. * gnu/packages/glib.scm (dbus, dbus-glib, telepathy-glib)[home-page]: Likewise. * gnu/packages/gnome.scm (shared-mime-info, hicolor-icon-theme) (libxklavier, colord, upower)[home-page]: Likewise. * gnu/packages/gstreamer.scm (orc, python-gst)[home-page]: Likewise. * gnu/packages/libcanberra.scm (sound-theme-freedesktop)[home-page]: Likewise. * gnu/packages/libreoffice.scm (libexttextcat)[home-page]: Likewise. * gnu/packages/polkit.scm (polkit-gnome, polkit-gnome)[home-page]: Likewise. * gnu/packages/pulseaudio.scm (pavucontrol)[home-page]: Likewise. * gnu/packages/python.scm (python-dbus)[home-page]: Likewise. * gnu/packages/xdisorg.scm (startup-notification)[home-page]: Likewise. Tobias Geerinckx-Rice 2018-01-23Merge branch 'master' into core-updatesMark H Weaver 2018-01-23gnu: libsndfile: Fix CVE-2017-12562....* gnu/packages/patches/libsndfile-CVE-2017-12562.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/pulseaudio.scm (libsndfile)[replacement]: New field. (libsndfile/fixed): New variable. Leo Famulari 2017-12-31Merge remote-tracking branch 'origin/master' into core-updatesEfraim Flashner 2017-12-24gnu: pulsemixer: Update to 1.4.0....* gnu/packages/pulseaudio.scm (pulsemixer): Update to 1.4.0 Tobias Geerinckx-Rice 2017-12-18gnu: pulseaudio: Use 'modify-phases' syntax....* gnu/packages/pulseaudio.scm (pulseaudio)[arguments]: Use 'modify-phases'. Marius Bakke 2017-12-18gnu: pulseaudio: Update to 11.1....* gnu/packages/pulseaudio.scm (pulseaudio): Update to 11.1. Marius Bakke 2017-10-05Merge branch 'master' into stagingMarius Bakke 2017-10-03gnu: Add pulsemixer....* gnu/packages/pulseaudio.scm (pulsemixer): New variable. Leo Famulari 2017-09-07gnu: pulseaudio: Update to 11.0....From af245f3289d14a6f6cc6e5454e64a47241517cf1 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov <go.wigust@gmail.com> Date: Thu, 7 Sep 2017 08:23:43 +0300 Subject: [PATCH] gnu: pulseaudio: Update to 11.0. * gnu/packages/pulseaudio.scm (pulseaudio): Update to 11.0. Oleg Pykhalov