From 65a67bf711b14bc7200f6730c0f173375ca12974 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 10 Jan 2019 14:50:09 +0100 Subject: services: Use 'define-deprecated' for service procedures. * gnu/services/base.scm (urandom-seed-service, gpm-service): Define using 'define-deprecated'. * gnu/services/messaging.scm (bitlbee-service): Likewise. * gnu/services/networking.scm (dhcp-client-service): Likewise. (ntp-service): Likewise. * gnu/services/xorg.scm (slim-service): Likewise. (gdm-service): Likewise. --- gnu/services/base.scm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'gnu/services/base.scm') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 67bdaef18c1..6e99cbfec45 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2015, 2016 Alex Kost ;;; Copyright © 2015, 2016 Mark H Weaver ;;; Copyright © 2015 Sou Bunnbu @@ -25,6 +25,7 @@ (define-module (gnu services base) #:use-module (guix store) + #:use-module (guix deprecation) #:use-module (gnu services) #:use-module (gnu services shepherd) #:use-module (gnu system pam) @@ -614,8 +615,9 @@ file systems, as well as corresponding @file{/etc/fstab} entries."))) generator (RNG) with the value recorded when the system was last shut down."))) -(define (urandom-seed-service) ;deprecated - (service urandom-seed-service-type #f)) +(define-deprecated (urandom-seed-service) + urandom-seed-service-type + (service urandom-seed-service-type)) ;;; @@ -2078,8 +2080,9 @@ command-line options. GPM allows users to use the mouse in the console, notably to select, copy, and paste text. The default options use the @code{ps2} protocol, which works for both USB and PS/2 mice."))) -(define* (gpm-service #:key (gpm gpm) ;deprecated - (options %default-gpm-options)) +(define-deprecated (gpm-service #:key (gpm gpm) + (options %default-gpm-options)) + gpm-service-type "Run @var{gpm}, the general-purpose mouse daemon, with the given command-line @var{options}. GPM allows users to use the mouse in the console, notably to select, copy, and paste text. The default value of @var{options} -- cgit v1.3 From 84a2de36a10dc2ab80f86e16721cbd228c85279e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 10 Jan 2019 23:33:36 +0100 Subject: services: Deprecate a few more service procedures. These procedures were already either undocumented (and de facto deprecated) or documented as deprecated or redundant. * gnu/services/base.scm (guix-service, guix-publish-service): Mark as deprecated. * gnu/services/mcron.scm (mcron-service): Likewise. * gnu/services/networking.scm (tor-service): Likewise. * doc/guix.texi (Scheduled Job Execution): Remove 'mcron-service' and adjust example. (Networking Services): Remove 'tor-service'. * gnu/tests/base.scm (%mcron-os): Use 'mcron-service-type' instead of 'mcron-service'. * gnu/tests/networking.scm (%tor-os): Use 'tor-service-type' instead of 'tor-service'. * tests/guix-system.sh: Likewise. --- doc/guix.texi | 25 +++++-------------------- gnu/services/base.scm | 8 ++++++-- gnu/services/mcron.scm | 6 ++++-- gnu/services/networking.scm | 7 ++++--- gnu/system/install.scm | 3 ++- gnu/tests/base.scm | 5 +++-- gnu/tests/networking.scm | 2 +- tests/guix-system.sh | 6 ++++-- 8 files changed, 29 insertions(+), 33 deletions(-) (limited to 'gnu/services/base.scm') diff --git a/doc/guix.texi b/doc/guix.texi index c0cc8d4169c..ed7723c00bc 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11684,9 +11684,11 @@ gexps to introduce job definitions that are passed to mcron (operating-system ;; @dots{} - (services (cons (mcron-service (list garbage-collector-job - updatedb-job - idutils-job)) + (services (cons (service mcron-service-type + (mcron-configuration + (jobs (list garbage-collector-job + updatedb-job + idutils-job)))) %base-services))) @end lisp @@ -11709,17 +11711,6 @@ also specify the number of tasks to display: # herd schedule mcron 10 @end example -@deffn {Scheme Procedure} mcron-service @var{jobs} [#:mcron @var{mcron}] -Return an mcron service running @var{mcron} that schedules @var{jobs}, a -list of gexps denoting mcron job specifications. - -This is a shorthand for: -@example -(service mcron-service-type - (mcron-configuration (mcron mcron) (jobs jobs))) -@end example -@end deffn - @defvr {Scheme Variable} mcron-service-type This is the type of the @code{mcron} service, whose value is an @code{mcron-configuration} object. @@ -12313,12 +12304,6 @@ Tor} anonymous networking daemon. The service is configured using a @end defvr -@deffn {Scheme Procedure} tor-service [@var{config-file}] [#:tor @var{tor}] -This procedure is deprecated and will be removed in a future release. Return -a service of the @code{tor-service-type} type. @var{config-file} and -@var{tor} have the same meaning as in @code{}. -@end deffn - @deftp {Data Type} tor-configuration @table @asis @item @code{tor} (default: @code{tor}) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 6e99cbfec45..8395a856fce 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1688,7 +1688,9 @@ failed to register public key '~a': ~a~%" key status))))))) (description "Run the build daemon of GNU@tie{}Guix, aka. @command{guix-daemon}."))) -(define* (guix-service #:optional (config %default-guix-configuration)) +(define-deprecated (guix-service #:optional + (config %default-guix-configuration)) + guix-service-type "Return a service that runs the Guix build daemon according to @var{config}." (service guix-service-type config)) @@ -1789,7 +1791,9 @@ failed to register public key '~a': ~a~%" key status))))))) "Add a Shepherd service running @command{guix publish}, a command that allows you to share pre-built binaries with others over HTTP."))) -(define* (guix-publish-service #:key (guix guix) (port 80) (host "localhost")) +(define-deprecated (guix-publish-service #:key (guix guix) + (port 80) (host "localhost")) + guix-publish-service-type "Return a service that runs @command{guix publish} listening on @var{host} and @var{port} (@pxref{Invoking guix publish}). diff --git a/gnu/services/mcron.scm b/gnu/services/mcron.scm index 120b663e3e6..e4b652b3d49 100644 --- a/gnu/services/mcron.scm +++ b/gnu/services/mcron.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016, 2017, 2018 Ludovic Courtès +;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +21,7 @@ #:use-module (gnu services base) #:use-module (gnu services shepherd) #:autoload (gnu packages guile) (mcron) + #:use-module (guix deprecation) #:use-module (guix records) #:use-module (guix gexp) #:use-module (srfi srfi-1) @@ -142,7 +143,8 @@ files." jobs))))) (default-value (mcron-configuration)))) ;empty job list -(define* (mcron-service jobs #:optional (mcron mcron)) +(define-deprecated (mcron-service jobs #:optional (mcron mcron)) + mcron-service-type "Return an mcron service running @var{mcron} that schedules @var{jobs}, a list of gexps denoting mcron job specifications. diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 2f49bf28dd4..cab129e0c30 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -755,9 +755,10 @@ HiddenServicePort ~a ~a~%" "Run the @uref{https://torproject.org, Tor} anonymous networking daemon."))) -(define* (tor-service #:optional - (config-file (plain-file "empty" "")) - #:key (tor tor)) +(define-deprecated (tor-service #:optional + (config-file (plain-file "empty" "")) + #:key (tor tor)) + tor-service-type "Return a service to run the @uref{https://torproject.org, Tor} anonymous networking daemon. diff --git a/gnu/system/install.scm b/gnu/system/install.scm index c345ba0626f..19a6f6a0387 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -253,7 +253,8 @@ You have been warned. Thanks for being so brave.\x1b[0m ;; The build daemon. Register the official server keys as trusted. ;; This allows the installation process to use substitutes by ;; default. - (guix-service (guix-configuration (authorize-key? #t))) + (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 diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 8d4e218a8f4..2b20aac1dc5 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016, 2017, 2018 Ludovic Courtès +;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2018 Clément Lassieur ;;; ;;; This file is part of GNU Guix. @@ -627,7 +627,8 @@ non-ASCII names from /tmp.") (job3 #~(job next-second-from ;to test $PATH "touch witness-touch"))) (simple-operating-system - (mcron-service (list job1 job2 job3))))) + (service mcron-service-type + (mcron-configuration (jobs (list job1 job2 job3))))))) (define (run-mcron-test name) (define os diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index 9f12a4ae8d8..a97b29bc4ba 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -351,7 +351,7 @@ subnet 192.168.1.0 netmask 255.255.255.0 { (define %tor-os (simple-operating-system - (tor-service))) + (service tor-service-type))) (define %tor-os/unix-socks-socket (simple-operating-system diff --git a/tests/guix-system.sh b/tests/guix-system.sh index 23d2da49031..adb623d244b 100644 --- a/tests/guix-system.sh +++ b/tests/guix-system.sh @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès +# Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès # Copyright © 2017 Tobias Geerinckx-Rice # Copyright © 2018 Chris Marusich # @@ -258,7 +258,9 @@ cat > "$tmpdir/config.scm"< Date: Fri, 16 Nov 2018 20:35:37 +0900 Subject: services: kmscon: Remove virtual-terminal requirement. kmscon does not require that virtual terminals run in UTF-8 mode. * gnu/services/base.scm (kmscon-service-type): Remove virtual-terminal from requirement list. --- gnu/services/base.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/services/base.scm') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 8395a856fce..b2f39c4aea4 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -2138,7 +2138,7 @@ This service is not part of @var{%base-services}." (shepherd-service (documentation "kmscon virtual terminal") - (requirement '(user-processes udev dbus-system virtual-terminal)) + (requirement '(user-processes udev dbus-system)) (provision (list (symbol-append 'term- (string->symbol virtual-terminal)))) (start #~(make-forkexec-constructor #$kmscon-command)) (stop #~(make-kill-destructor))))))) -- cgit v1.3 From 7194745a16008947f6cf1a3aba0f86e8ca18c2f6 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 20 Jan 2019 15:10:58 +0200 Subject: services: Use guix-service-type. * gnu/services/base.scm (%base-services): Replace guix-service with guix-service-type. * gnu/system/examples/docker-image.tmpl (services): Same. --- gnu/services/base.scm | 2 +- gnu/system/examples/docker-image.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/services/base.scm') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index b2f39c4aea4..4971f892c63 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -2326,7 +2326,7 @@ to handle." (provision '(loopback))))) (syslog-service) (service urandom-seed-service-type) - (guix-service) + (service guix-service-type) (nscd-service) ;; The LVM2 rules are needed as soon as LVM2 or the device-mapper is diff --git a/gnu/system/examples/docker-image.tmpl b/gnu/system/examples/docker-image.tmpl index d73187398f9..9690d651c12 100644 --- a/gnu/system/examples/docker-image.tmpl +++ b/gnu/system/examples/docker-image.tmpl @@ -44,4 +44,4 @@ (type "does-not-matter")))) ;; Guix is all you need! - (services (list (guix-service)))) + (services (list (service guix-service-type)))) -- cgit v1.3 From db9035492b26cb646d1eb5e38aa59bd8de18b02a Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 20 Jan 2019 15:16:44 +0200 Subject: services: %base-services: Use nscd-service-type. * gnu/services/base.scm (nscd-service-type)[default-value]: New field. (%base-services): Replace nscd-service with nscd-service-type. --- gnu/services/base.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gnu/services/base.scm') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 4971f892c63..626c5975ded 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2016 David Craven ;;; Copyright © 2016 Ricardo Wurmus ;;; Copyright © 2018 Mathieu Othacehe +;;; Copyright © 2019 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -1358,6 +1359,7 @@ the tty to run, among other things." (name-services (append (nscd-configuration-name-services config) name-services))))) + (default-value %nscd-default-configuration) (description "Runs libc's @dfn{name service cache daemon} (nscd) with the given configuration---an @code{} object. @xref{Name @@ -2327,7 +2329,7 @@ to handle." (syslog-service) (service urandom-seed-service-type) (service guix-service-type) - (nscd-service) + (service nscd-service-type) ;; The LVM2 rules are needed as soon as LVM2 or the device-mapper is ;; used, so enable them by default. The FUSE and ALSA rules are -- cgit v1.3 From fd779db9e4f95031627efed5a6fc2ffa554d443e Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 20 Jan 2019 15:18:36 +0200 Subject: services: %base-services: Use udev-service-type. * gnu/services/base.scm (udev-configuration): Fix typo. (udev-service-type)[default-value]: New field. (%base-services): Replace udev-service with udev-service-type. --- gnu/services/base.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gnu/services/base.scm') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 626c5975ded..17c953f0d7b 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1815,7 +1815,7 @@ archive}). If that is not the case, the service will fail to start." udev-configuration make-udev-configuration udev-configuration? (udev udev-configuration-udev ; - (default udev)) + (default eudev)) (rules udev-configuration-rules ;list of (default '()))) @@ -1998,6 +1998,7 @@ the udev rules in use.") (udev-configuration (udev udev) (rules (append initial-rules rules))))))) + (default-value (udev-configuration)) (description "Run @command{udev}, which populates the @file{/dev} directory dynamically. Get extra rules from the packages listed in the @@ -2334,7 +2335,9 @@ to handle." ;; The LVM2 rules are needed as soon as LVM2 or the device-mapper is ;; used, so enable them by default. The FUSE and ALSA rules are ;; less critical, but handy. - (udev-service #:rules (list lvm2 fuse alsa-utils crda)) + (service udev-service-type + (udev-configuration + (rules (list lvm2 fuse alsa-utils crda)))) (service special-files-service-type `(("/bin/sh" ,(file-append (canonical-package bash) -- cgit v1.3 From 178bce41d8bd7fd25ea33c7e3f10add339746061 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 20 Jan 2019 15:24:22 +0200 Subject: gnu: %base-services: Use login-service-type. * gnu/services/base.scm (login-service-type)[default-value]: New field. (%base-services): Replace login-service with login-service-type. --- gnu/services/base.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu/services/base.scm') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 17c953f0d7b..5817562860c 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -819,6 +819,7 @@ Return a service that sets up Unicode support in @var{tty} and loads (service-type (name 'login) (extensions (list (service-extension pam-root-service-type login-pam-service))) + (default-value (login-configuration)) (description "Provide a console log-in service as specified by its configuration value, a @code{login-configuration} object."))) @@ -2296,7 +2297,7 @@ to handle." (define %base-services ;; Convenience variable holding the basic services. - (list (login-service) + (list (service login-service-type) (service virtual-terminal-service-type) (service console-font-service-type -- cgit v1.3 From 76a2b2db1a5c6a68be994712e5273b2ac4e4c82a Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 20 Jan 2019 15:25:45 +0200 Subject: gnu: %base-services: Use *getty-service-type. * gnu/services/base.scm (%base-services): Replace agetty-service with agetty-service-type, mingetty-service with mingetty-service-type. --- gnu/services/base.scm | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'gnu/services/base.scm') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 5817562860c..d2baea0dd09 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -2305,23 +2305,23 @@ to handle." (cons tty %default-console-font)) '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6"))) - (agetty-service (agetty-configuration - (extra-options '("-L")) ; no carrier detect - (term "vt100") - (tty #f))) ; automatic - - (mingetty-service (mingetty-configuration - (tty "tty1"))) - (mingetty-service (mingetty-configuration - (tty "tty2"))) - (mingetty-service (mingetty-configuration - (tty "tty3"))) - (mingetty-service (mingetty-configuration - (tty "tty4"))) - (mingetty-service (mingetty-configuration - (tty "tty5"))) - (mingetty-service (mingetty-configuration - (tty "tty6"))) + (service agetty-service-type (agetty-configuration + (extra-options '("-L")) ; no carrier detect + (term "vt100") + (tty #f))) ; automatic + + (service mingetty-service-type (mingetty-configuration + (tty "tty1"))) + (service mingetty-service-type (mingetty-configuration + (tty "tty2"))) + (service mingetty-service-type (mingetty-configuration + (tty "tty3"))) + (service mingetty-service-type (mingetty-configuration + (tty "tty4"))) + (service mingetty-service-type (mingetty-configuration + (tty "tty5"))) + (service mingetty-service-type (mingetty-configuration + (tty "tty6"))) (service static-networking-service-type (list (static-networking (interface "lo") -- cgit v1.3