2014-05-31 22:13:33 +02:00
|
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2019-01-16 13:39:16 +01:00
|
|
|
|
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
|
2015-05-20 18:57:50 +02:00
|
|
|
|
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
2016-07-14 15:07:49 +02:00
|
|
|
|
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
|
2017-04-17 22:49:23 +02:00
|
|
|
|
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
|
2017-09-03 01:19:38 +02:00
|
|
|
|
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
|
2014-05-31 22:13:33 +02:00
|
|
|
|
;;;
|
|
|
|
|
;;; 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 system install)
|
|
|
|
|
#:use-module (gnu)
|
2018-11-16 12:43:55 +01:00
|
|
|
|
#:use-module (gnu system)
|
2017-12-12 16:41:56 +01:00
|
|
|
|
#:use-module (gnu bootloader u-boot)
|
2014-05-31 22:13:33 +02:00
|
|
|
|
#:use-module (guix gexp)
|
monads: Move '%store-monad' and related procedures where they belong.
This turns (guix monads) into a generic module for monads, and moves the
store monad and related monadic procedures in their corresponding
module.
* guix/monads.scm (store-return, store-bind, %store-monad, store-lift,
text-file, interned-file, package-file, package->derivation,
package->cross-derivation, origin->derivation, imported-modules,
compiled, modules, built-derivations, run-with-store): Move to...
* guix/store.scm (store-return, store-bind, %store-monad, store-lift,
text-file, interned-file): ... here.
(%guile-for-build): New variable.
(run-with-store): Moved from monads.scm. Remove default value for
#:guile-for-build.
* guix/packages.scm (default-guile): Export.
(set-guile-for-build): New procedure.
(package-file, package->derivation, package->cross-derivation,
origin->derivation): Moved from monads.scm.
* guix/derivations.scm (%guile-for-build): Remove.
(imported-modules): Rename to...
(%imported-modules): ... this.
(compiled-modules): Rename to...
(%compiled-modules): ... this.
(built-derivations, imported-modules, compiled-modules): New
procedures.
* gnu/services/avahi.scm, gnu/services/base.scm, gnu/services/dbus.scm,
gnu/services/dmd.scm, gnu/services/networking.scm,
gnu/services/ssh.scm, gnu/services/xorg.scm, gnu/system/install.scm,
gnu/system/linux-initrd.scm, gnu/system/shadow.scm, guix/download.scm,
guix/gexp.scm, guix/git-download.scm, guix/profiles.scm,
guix/svn-download.scm, tests/monads.scm: Adjust imports accordingly.
* guix/monad-repl.scm (default-guile-derivation): New procedure.
(store-monad-language, run-in-store): Use it.
* build-aux/hydra/gnu-system.scm (qemu-jobs): Add explicit
'set-guile-for-build' call.
* guix/scripts/archive.scm (derivation-from-expression): Likewise.
* guix/scripts/build.scm (options/resolve-packages): Likewise.
* guix/scripts/environment.scm (guix-environment): Likewise.
* guix/scripts/system.scm (guix-system): Likewise.
* doc/guix.texi (The Store Monad): Adjust module names accordingly.
2015-01-14 13:34:52 +01:00
|
|
|
|
#:use-module (guix store)
|
2014-05-31 22:13:33 +02:00
|
|
|
|
#:use-module (guix monads)
|
2014-07-22 22:12:05 +02:00
|
|
|
|
#:use-module ((guix store) #:select (%store-prefix))
|
2018-11-24 04:25:03 +01:00
|
|
|
|
#:use-module (gnu installer)
|
2018-11-16 12:43:55 +01:00
|
|
|
|
#:use-module (gnu services dbus)
|
|
|
|
|
#:use-module (gnu services networking)
|
2016-01-27 13:45:01 +01:00
|
|
|
|
#:use-module (gnu services shepherd)
|
2017-04-17 22:49:23 +02:00
|
|
|
|
#:use-module (gnu services ssh)
|
2014-11-25 15:39:24 +01:00
|
|
|
|
#:use-module (gnu packages admin)
|
2015-05-03 00:08:37 +02:00
|
|
|
|
#:use-module (gnu packages bash)
|
2017-02-09 19:46:47 +01:00
|
|
|
|
#:use-module (gnu packages bootloaders)
|
2019-02-10 15:30:35 +01:00
|
|
|
|
#:use-module (gnu packages certs)
|
2018-11-16 12:43:55 +01:00
|
|
|
|
#:use-module (gnu packages fonts)
|
|
|
|
|
#:use-module (gnu packages fontutils)
|
2017-12-03 17:29:10 +01:00
|
|
|
|
#:use-module (gnu packages guile)
|
2014-05-31 22:13:33 +02:00
|
|
|
|
#:use-module (gnu packages linux)
|
2017-09-10 21:45:12 +02:00
|
|
|
|
#:use-module (gnu packages ssh)
|
2014-11-23 21:53:24 +01:00
|
|
|
|
#:use-module (gnu packages cryptsetup)
|
2014-05-31 22:13:33 +02:00
|
|
|
|
#:use-module (gnu packages package-management)
|
2014-06-03 22:12:05 +02:00
|
|
|
|
#:use-module (gnu packages disk)
|
2014-05-31 22:13:33 +02:00
|
|
|
|
#:use-module (gnu packages texinfo)
|
2015-01-23 10:37:01 +01:00
|
|
|
|
#:use-module (gnu packages compression)
|
2016-08-01 23:08:48 +02:00
|
|
|
|
#:use-module (gnu packages nvi)
|
2015-05-09 23:34:01 +02:00
|
|
|
|
#:use-module (ice-9 match)
|
|
|
|
|
#:use-module (srfi srfi-26)
|
2017-12-12 16:41:56 +01:00
|
|
|
|
#:export (installation-os
|
2018-01-22 22:35:06 +01:00
|
|
|
|
a20-olinuxino-lime-installation-os
|
2018-01-20 20:46:00 +01:00
|
|
|
|
a20-olinuxino-lime2-emmc-installation-os
|
2018-01-20 20:55:52 +01:00
|
|
|
|
a20-olinuxino-micro-installation-os
|
2018-09-14 21:31:24 +02:00
|
|
|
|
bananapi-m2-ultra-installation-os
|
2018-01-20 22:05:16 +01:00
|
|
|
|
beaglebone-black-installation-os
|
2018-05-07 16:32:02 +02:00
|
|
|
|
mx6cuboxi-installation-os
|
2018-05-07 16:34:43 +02:00
|
|
|
|
nintendo-nes-classic-edition-installation-os
|
2018-05-09 08:59:10 +02:00
|
|
|
|
novena-installation-os
|
2018-05-18 00:16:09 +02:00
|
|
|
|
pine64-plus-installation-os
|
2018-11-21 01:32:16 +01:00
|
|
|
|
pinebook-installation-os
|
2018-05-29 06:10:15 +02:00
|
|
|
|
rk3399-puma-installation-os
|
2018-06-15 09:52:42 +02:00
|
|
|
|
wandboard-installation-os
|
|
|
|
|
os-with-u-boot))
|
2014-05-31 22:13:33 +02:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
;;;
|
|
|
|
|
;;; This module provides an 'operating-system' definition for use on images
|
|
|
|
|
;;; for USB sticks etc., for the installation of the GNU system.
|
|
|
|
|
;;;
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2015-04-14 23:19:01 +02:00
|
|
|
|
|
2019-04-12 14:15:59 +02:00
|
|
|
|
;;;
|
|
|
|
|
;;; Documentation service.
|
|
|
|
|
;;;
|
|
|
|
|
|
2019-04-12 17:13:26 +02:00
|
|
|
|
(define %installation-node-names
|
|
|
|
|
;; Translated name of the "System Installation" node of the manual. Ideally
|
|
|
|
|
;; we'd extract it from the 'guix-manual' gettext domain, but that one is
|
|
|
|
|
;; usually not available at run time, hence this hack.
|
|
|
|
|
'(("de" . "Systeminstallation")
|
|
|
|
|
("en" . "System Installation")
|
|
|
|
|
("fr" . "Installation du système")))
|
|
|
|
|
|
2019-04-12 14:15:59 +02:00
|
|
|
|
(define (log-to-info tty user)
|
2014-05-31 22:13:33 +02:00
|
|
|
|
"Return a script that spawns the Info reader on the right section of the
|
|
|
|
|
manual."
|
2015-09-07 22:44:26 +02:00
|
|
|
|
(program-file "log-to-info"
|
2019-04-12 17:13:26 +02:00
|
|
|
|
#~(let* ((tty (open-file #$(string-append "/dev/" tty)
|
|
|
|
|
"r0+"))
|
|
|
|
|
(locale (cadr (command-line)))
|
|
|
|
|
(language (string-take locale
|
|
|
|
|
(string-index locale #\_)))
|
|
|
|
|
(infodir "/run/current-system/profile/share/info")
|
|
|
|
|
(per-lang (string-append infodir "/guix." language
|
|
|
|
|
".info.gz"))
|
|
|
|
|
(file (if (file-exists? per-lang)
|
|
|
|
|
per-lang
|
|
|
|
|
(string-append infodir "/guix.info")))
|
|
|
|
|
(node (or (assoc-ref '#$%installation-node-names
|
|
|
|
|
language)
|
|
|
|
|
"System Installation")))
|
2019-04-12 14:15:59 +02:00
|
|
|
|
(redirect-port tty (current-output-port))
|
|
|
|
|
(redirect-port tty (current-error-port))
|
|
|
|
|
(redirect-port tty (current-input-port))
|
|
|
|
|
|
|
|
|
|
(let ((pw (getpwnam #$user)))
|
|
|
|
|
(setgid (passwd:gid pw))
|
|
|
|
|
(setuid (passwd:uid pw)))
|
|
|
|
|
|
2015-01-23 10:37:01 +01:00
|
|
|
|
;; 'gunzip' is needed to decompress the doc.
|
|
|
|
|
(setenv "PATH" (string-append #$gzip "/bin"))
|
|
|
|
|
|
2019-04-12 17:13:26 +02:00
|
|
|
|
;; Change this process' locale so that command-line
|
|
|
|
|
;; arguments to 'info' are properly encoded.
|
|
|
|
|
(catch #t
|
|
|
|
|
(lambda ()
|
|
|
|
|
(setlocale LC_ALL locale)
|
|
|
|
|
(setenv "LC_ALL" locale))
|
|
|
|
|
(lambda _
|
|
|
|
|
;; Sometimes LOCALE itself is not available. In that
|
|
|
|
|
;; case pick the one UTF-8 locale that's known to work
|
|
|
|
|
;; instead of failing.
|
|
|
|
|
(setlocale LC_ALL "en_US.utf8")
|
|
|
|
|
(setenv "LC_ALL" "en_US.utf8")))
|
|
|
|
|
|
|
|
|
|
(execl #$(file-append info-reader "/bin/info")
|
|
|
|
|
"info" "-d" infodir "-f" file "-n" node))))
|
2014-05-31 22:13:33 +02:00
|
|
|
|
|
2019-04-12 14:15:59 +02:00
|
|
|
|
(define (documentation-shepherd-service tty)
|
|
|
|
|
(list (shepherd-service
|
|
|
|
|
(provision (list (symbol-append 'term- (string->symbol tty))))
|
|
|
|
|
(requirement '(user-processes host-name udev virtual-terminal))
|
2019-04-12 17:13:26 +02:00
|
|
|
|
(start #~(lambda* (#:optional (locale "en_US.utf8"))
|
|
|
|
|
(fork+exec-command
|
|
|
|
|
(list #$(log-to-info tty "documentation") locale)
|
|
|
|
|
#:environment-variables
|
|
|
|
|
`("GUIX_LOCPATH=/run/current-system/locale"
|
|
|
|
|
"TERM=linux"))))
|
2019-04-12 14:15:59 +02:00
|
|
|
|
(stop #~(make-kill-destructor)))))
|
|
|
|
|
|
|
|
|
|
(define %documentation-users
|
|
|
|
|
;; User account for the Info viewer.
|
|
|
|
|
(list (user-account (name "documentation")
|
|
|
|
|
(system? #t)
|
|
|
|
|
(group "nogroup")
|
|
|
|
|
(home-directory "/var/empty"))))
|
|
|
|
|
|
|
|
|
|
(define documentation-service-type
|
|
|
|
|
;; Documentation viewer service.
|
|
|
|
|
(service-type (name 'documentation)
|
|
|
|
|
(extensions
|
|
|
|
|
(list (service-extension shepherd-root-service-type
|
|
|
|
|
documentation-shepherd-service)
|
|
|
|
|
(service-extension account-service-type
|
|
|
|
|
(const %documentation-users))))
|
|
|
|
|
(description "Run the Info reader on a tty.")))
|
|
|
|
|
|
|
|
|
|
|
2014-07-22 22:12:05 +02:00
|
|
|
|
(define %backing-directory
|
|
|
|
|
;; Sub-directory used as the backing store for copy-on-write.
|
|
|
|
|
"/tmp/guix-inst")
|
|
|
|
|
|
|
|
|
|
(define (make-cow-store target)
|
|
|
|
|
"Return a gexp that makes the store copy-on-write, using TARGET as the
|
|
|
|
|
backing store. This is useful when TARGET is on a hard disk, whereas the
|
|
|
|
|
current store is on a RAM disk."
|
|
|
|
|
|
|
|
|
|
(define (set-store-permissions directory)
|
|
|
|
|
;; Set the right perms on DIRECTORY to use it as the store.
|
|
|
|
|
#~(begin
|
|
|
|
|
(chown #$directory 0 30000) ;use the fixed 'guixbuild' GID
|
|
|
|
|
(chmod #$directory #o1775)))
|
|
|
|
|
|
|
|
|
|
#~(begin
|
2016-05-31 22:51:07 +02:00
|
|
|
|
;; Bind-mount TARGET's /tmp in case we need space to build things.
|
|
|
|
|
(let ((tmpdir (string-append #$target "/tmp")))
|
|
|
|
|
(mkdir-p tmpdir)
|
|
|
|
|
(mount tmpdir "/tmp" "none" MS_BIND))
|
|
|
|
|
|
2017-10-27 15:33:38 +02:00
|
|
|
|
(let* ((rw-dir (string-append target #$%backing-directory))
|
|
|
|
|
(work-dir (string-append rw-dir "/../.overlayfs-workdir")))
|
2014-07-22 22:12:05 +02:00
|
|
|
|
(mkdir-p rw-dir)
|
2017-10-27 15:33:38 +02:00
|
|
|
|
(mkdir-p work-dir)
|
2014-07-22 22:12:05 +02:00
|
|
|
|
(mkdir-p "/.rw-store")
|
|
|
|
|
#$(set-store-permissions #~rw-dir)
|
|
|
|
|
#$(set-store-permissions "/.rw-store")
|
|
|
|
|
|
2017-10-27 15:33:38 +02:00
|
|
|
|
;; Mount the overlay, then atomically make it the store.
|
|
|
|
|
(mount "none" "/.rw-store" "overlay" 0
|
|
|
|
|
(string-append "lowerdir=" #$(%store-prefix) ","
|
|
|
|
|
"upperdir=" rw-dir ","
|
|
|
|
|
"workdir=" work-dir))
|
|
|
|
|
(mount "/.rw-store" #$(%store-prefix) "" MS_MOVE)
|
|
|
|
|
(rmdir "/.rw-store"))))
|
2014-07-22 22:12:05 +02:00
|
|
|
|
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 23:44:26 +02:00
|
|
|
|
(define cow-store-service-type
|
services: Rename 'dmd' services to 'shepherd'.
* gnu/services/shepherd.scm (dmd-root-service-type, %dmd-root-service)
(dmd-service-type, <dmd-service>, dmd-service, dmd-service?)
(make-dmd-service, dmd-service-documentation, dmd-service-provision)
(dmd-service-requirement, dmd-service-respawn, dmd-service-start)
(dmd-service-stop, dmd-service-auto-start?, dmd-service-modules)
(dmd-service-imported-modules, dmd-service-file-name, dmd-service-file)
(dmd-service-back-edges): Rename to...
(shepherd-root-service-type, %shepherd-root-service, shepherd-service-type)
(<shepherd-service>, shepherd-service, shepherd-service?)
(make-shepherd-service, shepherd-service-documentation)
(shepherd-service-provision, shepherd-service-requirement)
(shepherd-service-respawn, shepherd-service-start)
(shepherd-service-stop, shepherd-service-auto-start?)
(shepherd-service-modules, shepherd-service-imported-modules)
(shepherd-service-file-name, shepherd-service-file)
(shepherd-service-back-edges): ...this
* gnu/services.scm: Adjust comments.
* gnu/services/avahi.scm (avahi-dmd-service): Rename to...
(avahi-shepherd-service): ... this.
* gnu/services/base.scm (%root-file-system-dmd-service)
(file-system->dmd-service-name, mapped-device->dmd-service-name)
(dependency->dmd-service-name, file-system-dmd-service)
(mingetty-dmd-service, nscd-dmd-service, guix-dmd-service)
(guix-publish-dmd-service, udev-dmd-service, gpm-dmd-service): Rename to...
(%root-file-system-shepherd-service)
(file-system->shepherd-service-name, mapped-device->shepherd-service-name)
(dependency->shepherd-service-name, file-system-shepherd-service)
(mingetty-shepherd-service, nscd-shepherd-service, guix-shepherd-service)
(guix-publish-shepherd-service, udev-shepherd-service)
(gpm-shepherd-service): ... this.
* gnu/services/databases.scm (postgresql-dmd-service): Rename to...
(postgresql-shepherd-service): ... this.
* gnu/services/desktop.scm (upower-dmd-service, elogind-dmd-service):
Rename to...
(upower-shepherd-service, elogind-shepherd-service): ... this.
* gnu/services/dbus.scm (dbus-dmd-service): Rename to...
(dbus-shepherd-service): ... this.
* gnu/services/lirc.scm (lirc-dmd-service): Rename to...
(lirc-shepherd-service): ... this.
* gnu/services/mail.scm (dovecot-dmd-service): Rename to...
(dovecot-shepherd-service): ... this.
* gnu/services/networking.scm (ntp-dmd-service, tor-dmd-service)
(bitlbee-dmd-service, wicd-dmd-service, network-manager-dmd-service): Rename to...
(dbus-shepherd-service): ... this.
* gnu/services/ssh.scm (lsh-dmd-service): Rename to...
(lsh-shepherd-service): ... this.
* gnu/services/web.scm (nginx-dmd-service): Rename to...
(nginx-shepherd-service): ... this.
* gnu/services/xorg.scm (slim-dmd-service): Rename to...
(slim-shepherd-service): ... this.
* gnu/system.scm (essential-services): Use '%shepherd-root-service'.
* gnu/system/install.scm (cow-store-service-type): Adjust accordingly.
* guix/scripts/system.scm (dmd-service-node-label, dmd-service-node-type)
(export-dmd-graph): Likewise.
* tests/guix-system.sh: Likewise.
* tests/services.scm ("dmd-service-back-edges"): Rename to...
("shepherd-service-back-edges"): Adjust accordingly.
* doc/guix.texi: Likewise.
* doc/images/service-graph.dot: Use 'shepherd' service name.
2016-01-27 21:02:31 +01:00
|
|
|
|
(shepherd-service-type
|
2015-10-14 15:09:18 +02:00
|
|
|
|
'cow-store
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 23:44:26 +02:00
|
|
|
|
(lambda _
|
services: Rename 'dmd' services to 'shepherd'.
* gnu/services/shepherd.scm (dmd-root-service-type, %dmd-root-service)
(dmd-service-type, <dmd-service>, dmd-service, dmd-service?)
(make-dmd-service, dmd-service-documentation, dmd-service-provision)
(dmd-service-requirement, dmd-service-respawn, dmd-service-start)
(dmd-service-stop, dmd-service-auto-start?, dmd-service-modules)
(dmd-service-imported-modules, dmd-service-file-name, dmd-service-file)
(dmd-service-back-edges): Rename to...
(shepherd-root-service-type, %shepherd-root-service, shepherd-service-type)
(<shepherd-service>, shepherd-service, shepherd-service?)
(make-shepherd-service, shepherd-service-documentation)
(shepherd-service-provision, shepherd-service-requirement)
(shepherd-service-respawn, shepherd-service-start)
(shepherd-service-stop, shepherd-service-auto-start?)
(shepherd-service-modules, shepherd-service-imported-modules)
(shepherd-service-file-name, shepherd-service-file)
(shepherd-service-back-edges): ...this
* gnu/services.scm: Adjust comments.
* gnu/services/avahi.scm (avahi-dmd-service): Rename to...
(avahi-shepherd-service): ... this.
* gnu/services/base.scm (%root-file-system-dmd-service)
(file-system->dmd-service-name, mapped-device->dmd-service-name)
(dependency->dmd-service-name, file-system-dmd-service)
(mingetty-dmd-service, nscd-dmd-service, guix-dmd-service)
(guix-publish-dmd-service, udev-dmd-service, gpm-dmd-service): Rename to...
(%root-file-system-shepherd-service)
(file-system->shepherd-service-name, mapped-device->shepherd-service-name)
(dependency->shepherd-service-name, file-system-shepherd-service)
(mingetty-shepherd-service, nscd-shepherd-service, guix-shepherd-service)
(guix-publish-shepherd-service, udev-shepherd-service)
(gpm-shepherd-service): ... this.
* gnu/services/databases.scm (postgresql-dmd-service): Rename to...
(postgresql-shepherd-service): ... this.
* gnu/services/desktop.scm (upower-dmd-service, elogind-dmd-service):
Rename to...
(upower-shepherd-service, elogind-shepherd-service): ... this.
* gnu/services/dbus.scm (dbus-dmd-service): Rename to...
(dbus-shepherd-service): ... this.
* gnu/services/lirc.scm (lirc-dmd-service): Rename to...
(lirc-shepherd-service): ... this.
* gnu/services/mail.scm (dovecot-dmd-service): Rename to...
(dovecot-shepherd-service): ... this.
* gnu/services/networking.scm (ntp-dmd-service, tor-dmd-service)
(bitlbee-dmd-service, wicd-dmd-service, network-manager-dmd-service): Rename to...
(dbus-shepherd-service): ... this.
* gnu/services/ssh.scm (lsh-dmd-service): Rename to...
(lsh-shepherd-service): ... this.
* gnu/services/web.scm (nginx-dmd-service): Rename to...
(nginx-shepherd-service): ... this.
* gnu/services/xorg.scm (slim-dmd-service): Rename to...
(slim-shepherd-service): ... this.
* gnu/system.scm (essential-services): Use '%shepherd-root-service'.
* gnu/system/install.scm (cow-store-service-type): Adjust accordingly.
* guix/scripts/system.scm (dmd-service-node-label, dmd-service-node-type)
(export-dmd-graph): Likewise.
* tests/guix-system.sh: Likewise.
* tests/services.scm ("dmd-service-back-edges"): Rename to...
("shepherd-service-back-edges"): Adjust accordingly.
* doc/guix.texi: Likewise.
* doc/images/service-graph.dot: Use 'shepherd' service name.
2016-01-27 21:02:31 +01:00
|
|
|
|
(shepherd-service
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 23:44:26 +02:00
|
|
|
|
(requirement '(root-file-system user-processes))
|
|
|
|
|
(provision '(cow-store))
|
|
|
|
|
(documentation
|
|
|
|
|
"Make the store copy-on-write, with writes going to \
|
|
|
|
|
the given target.")
|
|
|
|
|
|
|
|
|
|
;; This is meant to be explicitly started by the user.
|
|
|
|
|
(auto-start? #f)
|
|
|
|
|
|
|
|
|
|
(start #~(case-lambda
|
|
|
|
|
((target)
|
|
|
|
|
#$(make-cow-store #~target)
|
|
|
|
|
target)
|
|
|
|
|
(else
|
|
|
|
|
;; Do nothing, and mark the service as stopped.
|
|
|
|
|
#f)))
|
|
|
|
|
(stop #~(lambda (target)
|
|
|
|
|
;; Delete the temporary directory, but leave everything
|
|
|
|
|
;; mounted as there may still be processes using it since
|
2018-03-07 10:00:07 +01:00
|
|
|
|
;; 'user-processes' doesn't depend on us. The 'user-file-systems'
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 23:44:26 +02:00
|
|
|
|
;; service will unmount TARGET eventually.
|
|
|
|
|
(delete-file-recursively
|
|
|
|
|
(string-append target #$%backing-directory))))))))
|
|
|
|
|
|
2014-07-22 22:12:05 +02:00
|
|
|
|
(define (cow-store-service)
|
|
|
|
|
"Return a service that makes the store copy-on-write, such that writes go to
|
|
|
|
|
the user's target storage device rather than on the RAM disk."
|
|
|
|
|
;; See <http://bugs.gnu.org/18061> for the initial report.
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 23:44:26 +02:00
|
|
|
|
(service cow-store-service-type 'mooooh!))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define (/etc/configuration-files _)
|
|
|
|
|
"Return a list of tuples representing configuration templates to add to
|
|
|
|
|
/etc."
|
|
|
|
|
(define (file f)
|
2016-06-21 12:13:30 +02:00
|
|
|
|
(local-file (string-append "examples/" f)))
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 23:44:26 +02:00
|
|
|
|
|
|
|
|
|
(define directory
|
|
|
|
|
(computed-file "configuration-templates"
|
2016-07-03 23:11:40 +02:00
|
|
|
|
(with-imported-modules '((guix build utils))
|
|
|
|
|
#~(begin
|
|
|
|
|
(mkdir #$output)
|
|
|
|
|
(for-each (lambda (file target)
|
|
|
|
|
(copy-file file
|
|
|
|
|
(string-append #$output "/"
|
|
|
|
|
target)))
|
|
|
|
|
'(#$(file "bare-bones.tmpl")
|
2017-12-18 14:47:44 +01:00
|
|
|
|
#$(file "beaglebone-black.tmpl")
|
2016-07-03 23:11:40 +02:00
|
|
|
|
#$(file "desktop.tmpl")
|
|
|
|
|
#$(file "lightweight-desktop.tmpl"))
|
|
|
|
|
'("bare-bones.scm"
|
2017-12-18 14:47:44 +01:00
|
|
|
|
"beaglebone-black.scm"
|
2016-07-03 23:11:40 +02:00
|
|
|
|
"desktop.scm"
|
|
|
|
|
"lightweight-desktop.scm"))
|
|
|
|
|
#t))))
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 23:44:26 +02:00
|
|
|
|
|
|
|
|
|
`(("configuration" ,directory)))
|
|
|
|
|
|
|
|
|
|
(define configuration-template-service-type
|
|
|
|
|
(service-type (name 'configuration-template)
|
|
|
|
|
(extensions
|
|
|
|
|
(list (service-extension etc-service-type
|
|
|
|
|
/etc/configuration-files)))))
|
|
|
|
|
|
|
|
|
|
(define %configuration-template-service
|
|
|
|
|
(service configuration-template-service-type #t))
|
system: Make service procedures non-monadic.
* gnu/services/avahi.scm (configuration-file): Use 'plain-file' instead
of 'text-file'.
(avahi-service): Turn into a regular procedure that returns a <service>.
* gnu/services/base.scm (root-file-system-service, file-system-service,
user-unmount-service, user-processes-service, host-name-service,
console-keymap-service, console-font-service, mingetty-service,
nscd.conf-file, nscd-service): Likewise.
(%default-syslog.conf): New variable.
(syslog-service): Use it. Turn into a regular procedure.
(guix-service, udev-rules-union, kvm-udev-rule, udev-service,
device-mapping-service, swap-service): Likewise.
* gnu/services/databases.scm (%default-postgres-hba,
%default-postgres-ident): Use 'plain-file' instead of 'text-file'.
(%default-postgres-config): Use 'mixed-text-file' instead of
'text-file*'.
(postgresql-service): Use 'program-file' instead of 'gexp->script'.
Turn into a regular procedure.
* gnu/services/desktop.scm (dbus-configuration-directory): Use
'computed-file' instead of 'gexp->derivation'.
(upower-configuration-file, geoclue-configuration-file,
elogind-configuration-file): Use 'plain-file' instead of 'text-file'.
(dbus-service, upower-service, colord-service, geoclue-service,
polkit-service, elogind-service): Turn into regular procedures.
(%desktop-services): Remove use of 'mlet' when iterating on
%BASE-SERVICES.
* gnu/services/lirc.scm (lirc-service): Turn into a regular procedure.
* gnu/services/networking.scm (static-networking-service,
dhcp-client-service, ntp-service, tor-service, bitlbee-service,
wicd-service): Likewise.
* gnu/services/ssh.scm (lsh-service): Likewise.
* gnu/services/web.scm (nginx-service): Likewise.
* gnu/services/xorg.scm (xorg-configuration-file): Use 'mixed-text-file'
instead of 'text-file*'.
(xorg-start-command, slim-service): Turn into regular procedures.
(xinitrc): Use 'program-file' instead of 'gexp->script'.
* gnu/system/install.scm (cow-store-service,
configuration-template-service): Turn into regular procedures.
* gnu/system.scm (other-file-system-services, device-mapping-services,
swap-services, essential-services, operating-system-services,
user-shells, operating-system-accounts): Remove now unnecessary
'mlet' and turn into regular procedures.
(operating-system-etc-directory, operating-system-activation-script,
operating-system-boot-script): Adjust accordingly.
* doc/guix.texi (Base Services, Networking Services, X Window, Desktop
Services, Database Services, Web Services, Various Services, Name
Service Switch): Adjust accordingly.
2015-09-09 09:17:31 +02:00
|
|
|
|
|
2014-07-24 22:45:24 +02:00
|
|
|
|
|
2014-12-14 17:26:03 +01:00
|
|
|
|
(define %nscd-minimal-caches
|
|
|
|
|
;; Minimal in-memory caching policy for nscd.
|
|
|
|
|
(list (nscd-cache (database 'hosts)
|
|
|
|
|
(positive-time-to-live (* 3600 12))
|
2016-02-10 21:21:38 +01:00
|
|
|
|
|
|
|
|
|
;; Do not cache lookup failures at all since they are
|
|
|
|
|
;; quite likely (for instance when someone tries to ping a
|
|
|
|
|
;; host before networking is functional.)
|
|
|
|
|
(negative-time-to-live 0)
|
|
|
|
|
|
2014-12-14 17:26:03 +01:00
|
|
|
|
(persistent? #f)
|
|
|
|
|
(max-database-size (* 5 (expt 2 20)))))) ;5 MiB
|
|
|
|
|
|
2016-12-19 18:35:54 +01:00
|
|
|
|
(define %installation-services
|
|
|
|
|
;; List of services of the installation system.
|
2018-11-23 15:18:59 +01:00
|
|
|
|
(let ((motd (plain-file "motd" "
|
2019-04-07 22:01:04 +02:00
|
|
|
|
\x1b[1;37mWelcome to the installation of GNU Guix!\x1b[0m
|
2018-11-23 15:18:59 +01:00
|
|
|
|
|
2019-04-07 22:09:41 +02:00
|
|
|
|
\x1b[2m\
|
|
|
|
|
Using this shell, you can carry out the installation process \"manually.\"
|
|
|
|
|
Access documentation at any time by pressing Alt-F2.\x1b[0m
|
2018-11-23 15:18:59 +01:00
|
|
|
|
")))
|
|
|
|
|
(define (normal-tty tty)
|
|
|
|
|
(mingetty-service (mingetty-configuration (tty tty)
|
|
|
|
|
(auto-login "root")
|
|
|
|
|
(login-pause? #t))))
|
|
|
|
|
|
|
|
|
|
(define bare-bones-os
|
|
|
|
|
(load "examples/bare-bones.tmpl"))
|
|
|
|
|
|
|
|
|
|
(list (service virtual-terminal-service-type)
|
|
|
|
|
|
|
|
|
|
(service kmscon-service-type
|
|
|
|
|
(kmscon-configuration
|
|
|
|
|
(virtual-terminal "tty1")
|
2018-11-24 04:25:03 +01:00
|
|
|
|
(login-program (installer-program))))
|
2018-11-23 15:18:59 +01:00
|
|
|
|
|
|
|
|
|
(login-service (login-configuration
|
|
|
|
|
(motd motd)))
|
|
|
|
|
|
|
|
|
|
;; Documentation. The manual is in UTF-8, but
|
|
|
|
|
;; 'console-font-service' sets up Unicode support and loads a font
|
|
|
|
|
;; with all the useful glyphs like em dash and quotation marks.
|
2019-04-12 14:15:59 +02:00
|
|
|
|
(service documentation-service-type "tty2")
|
2018-11-23 15:18:59 +01:00
|
|
|
|
|
|
|
|
|
;; Documentation add-on.
|
|
|
|
|
%configuration-template-service
|
|
|
|
|
|
|
|
|
|
;; A bunch of 'root' ttys.
|
|
|
|
|
(normal-tty "tty3")
|
|
|
|
|
(normal-tty "tty4")
|
|
|
|
|
(normal-tty "tty5")
|
|
|
|
|
(normal-tty "tty6")
|
|
|
|
|
|
|
|
|
|
;; The usual services.
|
|
|
|
|
(syslog-service)
|
|
|
|
|
|
|
|
|
|
;; The build daemon. Register the hydra.gnu.org key as trusted.
|
|
|
|
|
;; This allows the installation process to use substitutes by
|
|
|
|
|
;; default.
|
|
|
|
|
(service guix-service-type
|
|
|
|
|
(guix-configuration (authorize-key? #t)))
|
|
|
|
|
|
|
|
|
|
;; Start udev so that useful device nodes are available.
|
|
|
|
|
;; Use device-mapper rules for cryptsetup & co; enable the CRDA for
|
|
|
|
|
;; regulations-compliant WiFi access.
|
|
|
|
|
(udev-service #:rules (list lvm2 crda))
|
|
|
|
|
|
|
|
|
|
;; Add the 'cow-store' service, which users have to start manually
|
|
|
|
|
;; since it takes the installation directory as an argument.
|
|
|
|
|
(cow-store-service)
|
|
|
|
|
|
2019-04-12 17:19:31 +02:00
|
|
|
|
;; Install Unicode support and a suitable font.
|
2018-11-23 15:18:59 +01:00
|
|
|
|
(service console-font-service-type
|
2019-04-12 17:19:31 +02:00
|
|
|
|
(map (match-lambda
|
|
|
|
|
("tty2"
|
|
|
|
|
;; Use a font that contains characters such as
|
|
|
|
|
;; curly quotes as found in the manual.
|
|
|
|
|
'("tty2" . "LatGrkCyr-8x16"))
|
|
|
|
|
(tty
|
|
|
|
|
;; Use a font that doesn't have more than 256
|
|
|
|
|
;; glyphs so that we can use colors with varying
|
|
|
|
|
;; brightness levels (see note in setfont(8)).
|
|
|
|
|
`(,tty . "lat9u-16")))
|
2018-11-23 15:18:59 +01:00
|
|
|
|
'("tty1" "tty2" "tty3" "tty4" "tty5" "tty6")))
|
|
|
|
|
|
|
|
|
|
;; To facilitate copy/paste.
|
|
|
|
|
(service gpm-service-type)
|
|
|
|
|
|
|
|
|
|
;; Add an SSH server to facilitate remote installs.
|
|
|
|
|
(service openssh-service-type
|
|
|
|
|
(openssh-configuration
|
|
|
|
|
(port-number 22)
|
|
|
|
|
(permit-root-login #t)
|
|
|
|
|
;; The root account is passwordless, so make sure
|
|
|
|
|
;; a password is set before allowing logins.
|
|
|
|
|
(allow-empty-passwords? #f)
|
|
|
|
|
(password-authentication? #t)
|
|
|
|
|
|
|
|
|
|
;; Don't start it upfront.
|
|
|
|
|
(%auto-start? #f)))
|
|
|
|
|
|
|
|
|
|
;; Since this is running on a USB stick with a overlayfs as the root
|
|
|
|
|
;; file system, use an appropriate cache configuration.
|
|
|
|
|
(nscd-service (nscd-configuration
|
|
|
|
|
(caches %nscd-minimal-caches)))
|
|
|
|
|
|
|
|
|
|
;; Having /bin/sh is a good idea. In particular it allows Tramp
|
|
|
|
|
;; connections to this system to work.
|
|
|
|
|
(service special-files-service-type
|
|
|
|
|
`(("/bin/sh" ,(file-append (canonical-package bash)
|
|
|
|
|
"/bin/sh"))))
|
|
|
|
|
|
|
|
|
|
;; Loopback device, needed by OpenSSH notably.
|
|
|
|
|
(service static-networking-service-type
|
|
|
|
|
(list (static-networking (interface "lo")
|
|
|
|
|
(ip "127.0.0.1")
|
|
|
|
|
(requirement '())
|
|
|
|
|
(provision '(loopback)))))
|
|
|
|
|
|
|
|
|
|
(service wpa-supplicant-service-type)
|
|
|
|
|
(dbus-service)
|
|
|
|
|
(service connman-service-type
|
|
|
|
|
(connman-configuration
|
|
|
|
|
(disable-vpn? #t)))
|
|
|
|
|
|
|
|
|
|
;; Keep a reference to BARE-BONES-OS to make sure it can be
|
|
|
|
|
;; installed without downloading/building anything. Also keep the
|
|
|
|
|
;; things needed by 'profile-derivation' to minimize the amount of
|
|
|
|
|
;; download.
|
|
|
|
|
(service gc-root-service-type
|
|
|
|
|
(list bare-bones-os
|
|
|
|
|
glibc-utf8-locales
|
|
|
|
|
texinfo
|
|
|
|
|
(canonical-package guile-2.2))))))
|
2014-05-31 22:13:33 +02:00
|
|
|
|
|
|
|
|
|
(define %issue
|
|
|
|
|
;; Greeting.
|
|
|
|
|
"
|
2017-12-03 17:44:38 +01:00
|
|
|
|
\x1b[1;37mThis is an installation image of the GNU system. Welcome.\x1b[0m
|
2014-05-31 22:13:33 +02:00
|
|
|
|
|
2017-12-03 17:44:38 +01:00
|
|
|
|
\x1b[1;33mUse Alt-F2 for documentation.\x1b[0m
|
2014-05-31 22:13:33 +02:00
|
|
|
|
")
|
|
|
|
|
|
|
|
|
|
(define installation-os
|
|
|
|
|
;; The operating system used on installation images for USB sticks etc.
|
|
|
|
|
(operating-system
|
|
|
|
|
(host-name "gnu")
|
|
|
|
|
(timezone "Europe/Paris")
|
2014-11-29 11:37:53 +01:00
|
|
|
|
(locale "en_US.utf8")
|
2017-09-03 01:19:38 +02:00
|
|
|
|
(bootloader (bootloader-configuration
|
|
|
|
|
(bootloader grub-bootloader)
|
|
|
|
|
(target "/dev/sda")))
|
2014-05-31 22:13:33 +02:00
|
|
|
|
(file-systems
|
|
|
|
|
;; Note: the disk image build code overrides this root file system with
|
|
|
|
|
;; the appropriate one.
|
2016-03-24 21:22:56 +01:00
|
|
|
|
(cons* (file-system
|
|
|
|
|
(mount-point "/")
|
2019-03-13 16:44:02 +01:00
|
|
|
|
(device (file-system-label "Guix_image"))
|
2016-03-24 21:22:56 +01:00
|
|
|
|
(type "ext4"))
|
|
|
|
|
|
2017-10-27 15:33:38 +02:00
|
|
|
|
;; Make /tmp a tmpfs instead of keeping the overlayfs. This
|
|
|
|
|
;; originally was used for unionfs because FUSE creates
|
|
|
|
|
;; '.fuse_hiddenXYZ' files for each open file, and this confuses
|
|
|
|
|
;; Guix's test suite, for instance (see
|
|
|
|
|
;; <http://bugs.gnu.org/23056>). We keep this for overlayfs to be
|
2017-11-10 20:36:15 +01:00
|
|
|
|
;; on the safe side.
|
2016-03-24 21:22:56 +01:00
|
|
|
|
(file-system
|
|
|
|
|
(mount-point "/tmp")
|
|
|
|
|
(device "none")
|
|
|
|
|
(type "tmpfs")
|
|
|
|
|
(check? #f))
|
|
|
|
|
|
2016-03-24 21:48:21 +01:00
|
|
|
|
;; XXX: This should be %BASE-FILE-SYSTEMS but we don't need
|
|
|
|
|
;; elogind's cgroup file systems.
|
|
|
|
|
(list %pseudo-terminal-file-system
|
|
|
|
|
%shared-memory-file-system
|
|
|
|
|
%immutable-store)))
|
2014-05-31 22:13:33 +02:00
|
|
|
|
|
2018-11-23 15:18:59 +01:00
|
|
|
|
(users (list (user-account
|
|
|
|
|
(name "guest")
|
|
|
|
|
(group "users")
|
|
|
|
|
(supplementary-groups '("wheel")) ; allow use of sudo
|
|
|
|
|
(password "")
|
2019-03-22 14:06:54 +01:00
|
|
|
|
(comment "Guest of GNU"))))
|
2014-05-31 22:13:33 +02:00
|
|
|
|
|
|
|
|
|
(issue %issue)
|
2016-12-19 18:35:54 +01:00
|
|
|
|
(services %installation-services)
|
2014-05-31 22:13:33 +02:00
|
|
|
|
|
2017-09-10 21:40:46 +02:00
|
|
|
|
;; We don't need setuid programs, except for 'passwd', which can be handy
|
|
|
|
|
;; if one is to allow remote SSH login to the machine being installed.
|
|
|
|
|
(setuid-programs (list (file-append shadow "/bin/passwd")))
|
2014-05-31 22:13:33 +02:00
|
|
|
|
|
|
|
|
|
(pam-services
|
|
|
|
|
;; Explicitly allow for empty passwords.
|
|
|
|
|
(base-pam-services #:allow-empty-passwords? #t))
|
|
|
|
|
|
2016-02-04 12:11:50 +01:00
|
|
|
|
(packages (cons* (canonical-package glibc) ;for 'tzselect' & co.
|
2017-01-30 20:52:00 +01:00
|
|
|
|
parted gptfdisk ddrescue
|
2018-11-16 12:43:55 +01:00
|
|
|
|
fontconfig
|
|
|
|
|
font-dejavu font-gnu-unifont
|
2014-11-10 15:52:39 +01:00
|
|
|
|
grub ;mostly so xrefs to its manual work
|
2014-11-23 21:53:24 +01:00
|
|
|
|
cryptsetup
|
2016-07-14 15:07:49 +02:00
|
|
|
|
mdadm
|
2016-12-16 17:35:44 +01:00
|
|
|
|
dosfstools ;mkfs.fat, for the UEFI boot partition
|
2016-02-10 05:01:47 +01:00
|
|
|
|
btrfs-progs
|
2017-09-10 21:45:12 +02:00
|
|
|
|
openssh ;we already have sshd, having ssh/scp can help
|
2015-09-03 10:23:30 +02:00
|
|
|
|
wireless-tools iw wpa-supplicant-minimal iproute
|
2014-07-14 18:06:35 +02:00
|
|
|
|
;; XXX: We used to have GNU fdisk here, but as of version
|
|
|
|
|
;; 2.0.0a, that pulls Guile 1.8, which takes unreasonable
|
|
|
|
|
;; space; furthermore util-linux's fdisk is already
|
|
|
|
|
;; available here, so we keep that.
|
2015-05-03 00:08:37 +02:00
|
|
|
|
bash-completion
|
2016-08-01 23:08:48 +02:00
|
|
|
|
nvi ;:wq!
|
2019-02-08 15:30:08 +01:00
|
|
|
|
nss-certs ; To access HTTPS, use git, etc.
|
2014-06-04 14:59:24 +02:00
|
|
|
|
%base-packages))))
|
2014-05-31 22:13:33 +02:00
|
|
|
|
|
2018-06-15 09:52:42 +02:00
|
|
|
|
(define* (os-with-u-boot os board #:key (bootloader-target "/dev/mmcblk0")
|
|
|
|
|
(triplet "arm-linux-gnueabihf"))
|
|
|
|
|
"Given OS, amend it with the u-boot bootloader for BOARD,
|
|
|
|
|
installed to BOOTLOADER-TARGET (a drive), compiled for TRIPLET.
|
|
|
|
|
|
|
|
|
|
If you want a serial console, make sure to specify one in your
|
|
|
|
|
operating-system's kernel-arguments (\"console=ttyS0\" or similar)."
|
|
|
|
|
(operating-system (inherit os)
|
|
|
|
|
(bootloader (bootloader-configuration
|
|
|
|
|
(bootloader (bootloader (inherit u-boot-bootloader)
|
|
|
|
|
(package (make-u-boot-package board triplet))))
|
|
|
|
|
(target bootloader-target)))))
|
|
|
|
|
|
2018-01-20 21:11:34 +01:00
|
|
|
|
(define* (embedded-installation-os bootloader bootloader-target tty
|
|
|
|
|
#:key (extra-modules '()))
|
|
|
|
|
"Return an installation os for embedded systems.
|
|
|
|
|
The initrd gets the extra modules EXTRA-MODULES.
|
|
|
|
|
A getty is provided on TTY.
|
|
|
|
|
The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
|
2017-12-12 16:41:56 +01:00
|
|
|
|
(operating-system
|
|
|
|
|
(inherit installation-os)
|
|
|
|
|
(bootloader (bootloader-configuration
|
2018-01-20 21:11:34 +01:00
|
|
|
|
(bootloader bootloader)
|
|
|
|
|
(target bootloader-target)))
|
2017-12-12 16:41:56 +01:00
|
|
|
|
(kernel linux-libre)
|
2018-02-09 17:07:25 +01:00
|
|
|
|
(kernel-arguments
|
|
|
|
|
(cons (string-append "console=" tty)
|
|
|
|
|
(operating-system-user-kernel-arguments installation-os)))
|
2018-02-27 11:42:09 +01:00
|
|
|
|
(initrd-modules (append extra-modules %base-initrd-modules))))
|
2017-12-12 16:41:56 +01:00
|
|
|
|
|
2018-01-20 21:11:34 +01:00
|
|
|
|
(define beaglebone-black-installation-os
|
|
|
|
|
(embedded-installation-os u-boot-beaglebone-black-bootloader
|
|
|
|
|
"/dev/sda"
|
|
|
|
|
"ttyO0"
|
|
|
|
|
#:extra-modules
|
|
|
|
|
;; This module is required to mount the sd card.
|
|
|
|
|
'("omap_hsmmc")))
|
|
|
|
|
|
|
|
|
|
|
2018-01-23 12:00:14 +01:00
|
|
|
|
(define a20-olinuxino-lime-installation-os
|
2018-01-22 22:35:06 +01:00
|
|
|
|
(embedded-installation-os u-boot-a20-olinuxino-lime-bootloader
|
|
|
|
|
"/dev/mmcblk0" ; SD card storage
|
|
|
|
|
"ttyS0"))
|
|
|
|
|
|
2018-01-20 20:46:00 +01:00
|
|
|
|
(define a20-olinuxino-lime2-emmc-installation-os
|
2018-01-20 21:11:34 +01:00
|
|
|
|
(embedded-installation-os u-boot-a20-olinuxino-lime2-bootloader
|
|
|
|
|
"/dev/mmcblk1" ; eMMC storage
|
|
|
|
|
"ttyS0"))
|
2018-01-20 20:55:52 +01:00
|
|
|
|
|
|
|
|
|
(define a20-olinuxino-micro-installation-os
|
2018-01-20 21:11:34 +01:00
|
|
|
|
(embedded-installation-os u-boot-a20-olinuxino-micro-bootloader
|
|
|
|
|
"/dev/mmcblk0" ; SD card storage
|
|
|
|
|
"ttyS0"))
|
2018-01-20 20:46:00 +01:00
|
|
|
|
|
2018-09-14 21:31:24 +02:00
|
|
|
|
(define bananapi-m2-ultra-installation-os
|
|
|
|
|
(embedded-installation-os u-boot-bananapi-m2-ultra-bootloader
|
2018-01-20 21:11:34 +01:00
|
|
|
|
"/dev/mmcblk1" ; eMMC storage
|
|
|
|
|
"ttyS0"))
|
2018-01-19 00:25:13 +01:00
|
|
|
|
|
2018-05-07 16:32:02 +02:00
|
|
|
|
(define mx6cuboxi-installation-os
|
|
|
|
|
(embedded-installation-os u-boot-mx6cuboxi-bootloader
|
|
|
|
|
"/dev/mmcblk0" ; SD card storage
|
|
|
|
|
"ttymxc0"))
|
|
|
|
|
|
2018-05-09 08:59:10 +02:00
|
|
|
|
(define novena-installation-os
|
|
|
|
|
(embedded-installation-os u-boot-novena-bootloader
|
|
|
|
|
"/dev/mmcblk1" ; SD card storage
|
|
|
|
|
"ttymxc1"))
|
|
|
|
|
|
2018-01-20 22:05:16 +01:00
|
|
|
|
(define nintendo-nes-classic-edition-installation-os
|
|
|
|
|
(embedded-installation-os u-boot-nintendo-nes-classic-edition-bootloader
|
|
|
|
|
"/dev/mmcblk0" ; SD card (solder it yourself)
|
|
|
|
|
"ttyS0"))
|
|
|
|
|
|
2018-05-18 00:16:09 +02:00
|
|
|
|
(define pine64-plus-installation-os
|
|
|
|
|
(embedded-installation-os u-boot-pine64-plus-bootloader
|
|
|
|
|
"/dev/mmcblk0" ; SD card storage
|
|
|
|
|
"ttyS0"))
|
|
|
|
|
|
2018-11-21 01:32:16 +01:00
|
|
|
|
(define pinebook-installation-os
|
|
|
|
|
(embedded-installation-os u-boot-pinebook-bootloader
|
|
|
|
|
"/dev/mmcblk0" ; SD card storage
|
|
|
|
|
"ttyS0"))
|
|
|
|
|
|
2018-05-29 06:10:15 +02:00
|
|
|
|
(define rk3399-puma-installation-os
|
|
|
|
|
(embedded-installation-os u-boot-puma-rk3399-bootloader
|
|
|
|
|
"/dev/mmcblk0" ; SD card storage
|
|
|
|
|
"ttyS0"))
|
|
|
|
|
|
2018-05-07 16:34:43 +02:00
|
|
|
|
(define wandboard-installation-os
|
|
|
|
|
(embedded-installation-os u-boot-wandboard-bootloader
|
|
|
|
|
"/dev/mmcblk0" ; SD card storage
|
|
|
|
|
"ttymxc0"))
|
|
|
|
|
|
2017-12-12 16:41:56 +01:00
|
|
|
|
;; Return the default os here so 'guix system' can consume it directly.
|
2014-05-31 22:13:33 +02:00
|
|
|
|
installation-os
|
|
|
|
|
|
|
|
|
|
;;; install.scm ends here
|