diff options
author | Andreas Enge <andreas@enge.fr> | 2023-03-20 18:21:47 +0100 |
---|---|---|
committer | Andreas Enge <andreas@enge.fr> | 2023-03-20 18:49:06 +0100 |
commit | ccb62d8feb50e2859d7c41429a9e3d9e0fe30bfe (patch) | |
tree | 4ab573cee33f277828ad553a22579175b1dda22d /gnu/services | |
parent | 098bd280f82350073e8280e37d56a14162eed09c (diff) | |
parent | f80215c7c4ae5ea0c316f4766e6c05ae4218ede3 (diff) | |
download | guix-ccb62d8feb50e2859d7c41429a9e3d9e0fe30bfe.tar.gz |
Merge remote-tracking branch 'origin/master' into core-updates
Diffstat (limited to 'gnu/services')
-rw-r--r-- | gnu/services/base.scm | 116 | ||||
-rw-r--r-- | gnu/services/dbus.scm | 11 | ||||
-rw-r--r-- | gnu/services/desktop.scm | 112 | ||||
-rw-r--r-- | gnu/services/dict.scm | 6 | ||||
-rw-r--r-- | gnu/services/dns.scm | 128 | ||||
-rw-r--r-- | gnu/services/lirc.scm | 18 | ||||
-rw-r--r-- | gnu/services/mail.scm | 9 | ||||
-rw-r--r-- | gnu/services/networking.scm | 139 | ||||
-rw-r--r-- | gnu/services/sound.scm | 16 | ||||
-rw-r--r-- | gnu/services/spice.scm | 7 | ||||
-rw-r--r-- | gnu/services/ssh.scm | 74 | ||||
-rw-r--r-- | gnu/services/vpn.scm | 19 | ||||
-rw-r--r-- | gnu/services/xorg.scm | 47 |
13 files changed, 422 insertions, 280 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 7ad1e765bd..190bb8fe24 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -99,7 +99,8 @@ file-system-service-type file-system-utilities swap-service - host-name-service + host-name-service ; deprecated + host-name-service-type %default-console-font console-font-service-type console-font-service @@ -149,7 +150,7 @@ udev-configuration? udev-configuration-rules udev-service-type - udev-service + udev-service ; deprecated udev-rule file->udev-rule udev-rules-service @@ -157,11 +158,11 @@ login-configuration login-configuration? login-service-type - login-service + login-service ; deprecated agetty-configuration agetty-configuration? - agetty-service + agetty-service ; deprecated agetty-service-type mingetty-configuration @@ -172,11 +173,11 @@ mingetty-configuration-clear-on-logout? mingetty-configuration-mingetty mingetty-configuration? - mingetty-service + mingetty-service ; deprecated mingetty-service-type %nscd-default-caches - %nscd-default-configuration + %nscd-default-configuration ; deprecated nscd-configuration nscd-configuration? @@ -185,11 +186,11 @@ nscd-cache? nscd-service-type - nscd-service + nscd-service ; deprecated syslog-configuration syslog-configuration? - syslog-service + syslog-service ; deprecated syslog-service-type %default-syslog.conf @@ -238,7 +239,7 @@ rngd-configuration rngd-configuration? rngd-service-type - rngd-service + rngd-service ; deprecated kmscon-configuration kmscon-configuration? @@ -661,8 +662,10 @@ down."))) (define-record-type* <rngd-configuration> rngd-configuration make-rngd-configuration rngd-configuration? - (rng-tools rngd-configuration-rng-tools) ;file-like - (device rngd-configuration-device)) ;string + (rng-tools rngd-configuration-rng-tools ;file-like + (default rng-tools)) + (device rngd-configuration-device ;string + (default "/dev/hwrng"))) (define rngd-service-type (shepherd-service-type @@ -681,12 +684,13 @@ down."))) (provision '(trng)) (start #~(make-forkexec-constructor '#$rngd-command)) (stop #~(make-kill-destructor)))) + (rngd-configuration) (description "Run the @command{rngd} random number generation daemon to supply entropy to the kernel's pool."))) -(define* (rngd-service #:key - (rng-tools rng-tools) - (device "/dev/hwrng")) +(define-deprecated (rngd-service #:key (rng-tools rng-tools) + (device "/dev/hwrng")) + rngd-service-type "Return a service that runs the @command{rngd} program from @var{rng-tools} to add @var{device} to the kernel's entropy pool. The service will fail if @var{device} does not exist." @@ -778,7 +782,8 @@ host names." (one-shot? #t))) (description "Initialize the machine's host name."))) -(define (host-name-service name) +(define-deprecated (host-name-service name) + host-name-service-type "Return a service that sets the host name to @var{name}." (service host-name-service-type name)) @@ -868,7 +873,7 @@ of console keymaps with @command{loadkeys}."))) "-C" #$device #$font)) ((0 71) #t) (else #f)))) - (stop #~(const #t)) + (stop #~(const #f)) (respawn? #f))))) tty+font)) @@ -935,7 +940,8 @@ Return a service that sets up Unicode support in @var{tty} and loads "Provide a console log-in service as specified by its configuration value, a @code{login-configuration} object."))) -(define* (login-service #:optional (config (login-configuration))) +(define-deprecated (login-service #:optional (config (login-configuration))) + login-service-type "Return a service configure login according to @var{config}, which specifies the message of the day, among other things." (service login-service-type config)) @@ -1207,7 +1213,8 @@ to use as the tty. This is primarily useful for headless systems." "Provide console login using the @command{agetty} program."))) -(define* (agetty-service config) +(define-deprecated (agetty-service config) + agetty-service-type "Return a service to run agetty according to @var{config}, which specifies the tty to run, among other things." (service agetty-service-type config)) @@ -1272,7 +1279,8 @@ the tty to run, among other things." "Provide console login using the @command{mingetty} program."))) -(define* (mingetty-service config) +(define-deprecated (mingetty-service config) + mingetty-service-type "Return a service to run mingetty according to @var{config}, which specifies the tty to run, among other things." (service mingetty-service-type config)) @@ -1338,7 +1346,8 @@ the tty to run, among other things." (check-files? #t) ;check /etc/services changes (persistent? #t)))) -(define %nscd-default-configuration +(define-deprecated %nscd-default-configuration + #f ;; Default nscd configuration. (nscd-configuration)) @@ -1492,18 +1501,45 @@ the tty to run, among other things." (name-services (append (nscd-configuration-name-services config) name-services))))) - (default-value %nscd-default-configuration) + (default-value (nscd-configuration)) (description "Runs libc's @dfn{name service cache daemon} (nscd) with the given configuration---an @code{<nscd-configuration>} object. @xref{Name Service Switch}, for an example."))) -(define* (nscd-service #:optional (config %nscd-default-configuration)) +(define-deprecated (nscd-service #:optional (config (nscd-configuration))) + nscd-service-type "Return a service that runs libc's name service cache daemon (nscd) with the given @var{config}---an @code{<nscd-configuration>} object. @xref{Name Service Switch}, for an example." (service nscd-service-type config)) +;; Snippet adapted from the GNU inetutils manual. +(define %default-syslog.conf + (plain-file "syslog.conf" " + # Log all error messages, authentication messages of + # level notice or higher and anything of level err or + # higher to the console. + # Don't log private authentication messages! + *.alert;auth.notice;authpriv.none -/dev/console + + # Log anything (except mail) of level info or higher. + # Don't log private authentication messages! + *.info;mail.none;authpriv.none -/var/log/messages + + # Log \"debug\"-level entries and nothing else. + *.=debug -/var/log/debug + + # Same, in a different place. + *.info;mail.none;authpriv.none -/dev/tty12 + + # The authpriv file has restricted access. + # 'fsync' the file after each line (hence the lack of a leading dash). + authpriv.* /var/log/secure + + # Log all the mail messages in one place. + mail.* -/var/log/maillog +")) (define-record-type* <syslog-configuration> syslog-configuration make-syslog-configuration @@ -1533,37 +1569,12 @@ Service Switch}, for an example." (umask mask) pid)))) (stop #~(make-kill-destructor)))) + (syslog-configuration) (description "Run the syslog daemon, @command{syslogd}, which is responsible for logging system messages."))) -;; Snippet adapted from the GNU inetutils manual. -(define %default-syslog.conf - (plain-file "syslog.conf" " - # Log all error messages, authentication messages of - # level notice or higher and anything of level err or - # higher to the console. - # Don't log private authentication messages! - *.alert;auth.notice;authpriv.none -/dev/console - - # Log anything (except mail) of level info or higher. - # Don't log private authentication messages! - *.info;mail.none;authpriv.none -/var/log/messages - - # Log \"debug\"-level entries and nothing else. - *.=debug -/var/log/debug - - # Same, in a different place. - *.info;mail.none;authpriv.none -/dev/tty12 - - # The authpriv file has restricted access. - # 'fsync' the file after each line (hence the lack of a leading dash). - authpriv.* /var/log/secure - - # Log all the mail messages in one place. - mail.* -/var/log/maillog -")) - -(define* (syslog-service #:optional (config (syslog-configuration))) +(define-deprecated (syslog-service #:optional (config (syslog-configuration))) + syslog-service-type "Return a service that runs @command{syslogd} and takes @var{<syslog-configuration>} as a parameter. @@ -2343,7 +2354,8 @@ item of @var{packages}." directory dynamically. Get extra rules from the packages listed in the @code{rules} field of its value, @code{udev-configuration} object."))) -(define* (udev-service #:key (udev eudev) (rules '())) +(define-deprecated (udev-service #:key (udev eudev) (rules '())) + udev-service-type "Run @var{udev}, which populates the @file{/dev} directory dynamically. Get extra rules from the packages listed in @var{rules}." (service udev-service-type @@ -3287,7 +3299,7 @@ login manager daemon.") (cons tty %default-console-font)) '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6"))) - (syslog-service) + (service syslog-service-type) (service agetty-service-type (agetty-configuration (extra-options '("-L")) ; no carrier detect (term "vt100") diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index 4b56b8f3eb..5a0c634393 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -28,6 +28,7 @@ #:use-module ((gnu packages glib) #:select (dbus)) #:use-module (gnu packages polkit) #:use-module (gnu packages admin) + #:use-module (guix deprecation) #:use-module (guix gexp) #:use-module ((guix packages) #:select (package-name)) #:use-module (guix records) @@ -37,13 +38,13 @@ #:export (dbus-configuration dbus-configuration? dbus-root-service-type - dbus-service + dbus-service ; deprecated wrapped-dbus-service polkit-configuration polkit-configuration? polkit-service-type - polkit-service)) + polkit-service)) ; deprecated ;;; ;;; D-Bus. @@ -244,7 +245,8 @@ includes the @code{etc/dbus-1/system.d} directories of each package listed in bus. It allows programs and daemons to communicate and is also responsible for spawning (@dfn{activating}) D-Bus services on demand."))) -(define* (dbus-service #:key (dbus dbus) (services '()) verbose?) +(define-deprecated (dbus-service #:key (dbus dbus) (services '()) verbose?) + dbus-root-service-type "Return a service that runs the \"system bus\", using @var{dbus}, with support for @var{services}. When @var{verbose?} is true, it causes the @samp{DBUS_VERBOSE} environment variable to be set to @samp{1}; a @@ -395,7 +397,8 @@ management service}, which allows system administrators to grant access to privileged operations in a structured way. Polkit is a requirement for most desktop environments, such as GNOME."))) -(define* (polkit-service #:key (polkit polkit)) +(define-deprecated (polkit-service #:key (polkit polkit)) + polkit-service-type "Return a service that runs the @uref{http://www.freedesktop.org/wiki/Software/polkit/, Polkit privilege management service}, which allows system administrators to grant access to diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 4724294433..c0178135b0 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -97,7 +97,7 @@ udisks-configuration udisks-configuration? - udisks-service + udisks-service ; deprecated udisks-service-type colord-service-type @@ -106,17 +106,17 @@ geoclue-configuration geoclue-configuration? %standard-geoclue-applications - geoclue-service + geoclue-service ; deprecated geoclue-service-type bluetooth-service-type bluetooth-configuration bluetooth-configuration? - bluetooth-service + bluetooth-service ; deprecated elogind-configuration elogind-configuration? - elogind-service + elogind-service ; deprecated elogind-service-type %gdm-file-system @@ -126,7 +126,7 @@ fontconfig-file-system-service accountsservice-service-type - accountsservice-service + accountsservice-service ; deprecated cups-pk-helper-service-type sane-service-type @@ -318,19 +318,6 @@ used by GNOME.") ;;; GeoClue D-Bus service. ;;; -;; TODO: Export. -(define-record-type* <geoclue-configuration> - geoclue-configuration make-geoclue-configuration - geoclue-configuration? - (geoclue geoclue-configuration-geoclue - (default geoclue)) - (whitelist geoclue-configuration-whitelist) - (wifi-geolocation-url geoclue-configuration-wifi-geolocation-url) - (submit-data? geoclue-configuration-submit-data?) - (wifi-submission-url geoclue-configuration-wifi-submission-url) - (submission-nick geoclue-configuration-submission-nick) - (applications geoclue-configuration-applications)) - (define* (geoclue-application name #:key (allowed? #t) system? (users '())) "Configure default GeoClue access permissions for an application. NAME is the Desktop ID of the application, without the .desktop part. If ALLOWED? is @@ -350,6 +337,28 @@ users are allowed." (geoclue-application "epiphany" #:system? #f) (geoclue-application "firefox" #:system? #f))) +;; TODO: Use define-configuration and export accessors. +(define-record-type* <geoclue-configuration> + geoclue-configuration make-geoclue-configuration + geoclue-configuration? + (geoclue geoclue-configuration-geoclue + (default geoclue)) + (whitelist geoclue-configuration-whitelist + (default '())) + (wifi-geolocation-url + geoclue-configuration-wifi-geolocation-url + ;; Mozilla geolocation service: + (default "https://location.services.mozilla.com/v1/geolocate?key=geoclue")) + (submit-data? geoclue-configuration-submit-data? + (default #f)) + (wifi-submission-url + geoclue-configuration-wifi-submission-url + (default "https://location.services.mozilla.com/v1/submit?key=geoclue")) + (submission-nick geoclue-configuration-submission-nick + (default "geoclue")) + (applications geoclue-configuration-applications + (default %standard-geoclue-applications))) + (define* (geoclue-configuration-file config) "Return a geoclue configuration file." (plain-file "geoclue.conf" @@ -395,18 +404,21 @@ users are allowed." (description "Run the @command{geoclue} location service. This service provides a D-Bus interface to allow applications to request access to a user's physical location, and optionally to add information to -online location databases."))) - -(define* (geoclue-service #:key (geoclue geoclue) - (whitelist '()) - (wifi-geolocation-url - ;; Mozilla geolocation service: - "https://location.services.mozilla.com/v1/geolocate?key=geoclue") - (submit-data? #f) - (wifi-submission-url - "https://location.services.mozilla.com/v1/submit?key=geoclue") - (submission-nick "geoclue") - (applications %standard-geoclue-applications)) +online location databases.") + (default-value (geoclue-configuration)))) + +(define-deprecated + (geoclue-service #:key (geoclue geoclue) + (whitelist '()) + (wifi-geolocation-url + ;; Mozilla geolocation service: + "https://location.services.mozilla.com/v1/geolocate?key=geoclue") + (submit-data? #f) + (wifi-submission-url + "https://location.services.mozilla.com/v1/submit?key=geoclue") + (submission-nick "geoclue") + (applications %standard-geoclue-applications)) + geoclue-service-type "Return a service that runs the @command{geoclue} location service. This service provides a D-Bus interface to allow applications to request access to a user's physical location, and optionally to add information to online @@ -848,7 +860,8 @@ site} for more information." (description "Run the @command{bluetoothd} daemon, which manages all the Bluetooth devices and provides a number of D-Bus interfaces."))) -(define* (bluetooth-service #:key (bluez bluez) (auto-enable? #f)) +(define-deprecated (bluetooth-service #:key (bluez bluez) (auto-enable? #f)) + bluetooth-service-type "Return a service that runs the @command{bluetoothd} daemon, which manages all the Bluetooth devices and provides a number of D-Bus interfaces. When AUTO-ENABLE? is true, the bluetooth controller is powered automatically at @@ -945,9 +958,11 @@ screens and scanners."))) (description "Run UDisks, a @dfn{disk management} daemon that provides user interfaces with notifications and ways to mount/unmount disks. Programs that talk to UDisks include the @command{udisksctl} command, -part of UDisks, and GNOME Disks.")))) +part of UDisks, and GNOME Disks.") + (default-value (udisks-configuration))))) -(define* (udisks-service #:key (udisks udisks)) +(define-deprecated (udisks-service #:key (udisks udisks)) + udisks-service-type "Return a service for @uref{http://udisks.freedesktop.org/docs/latest/, UDisks}, a @dfn{disk management} daemon that provides user interfaces with notifications and ways to mount/unmount disks. Programs that talk to UDisks @@ -978,11 +993,7 @@ include the @command{udisksctl} command, part of UDisks, and GNOME Disks." (handle-suspend-key elogind-handle-suspend-key (default 'suspend)) (handle-hibernate-key elogind-handle-hibernate-key - ;; (default 'hibernate) - ;; XXX Ignore it for now, since we don't - ;; yet handle resume-from-hibernation in - ;; our initrd. - (default 'ignore)) + (default 'hibernate)) (handle-lid-switch elogind-handle-lid-switch (default 'suspend)) (handle-lid-switch-docked elogind-handle-lid-switch-docked @@ -1230,7 +1241,8 @@ allow other system components to know the set of logged-in users as well as their session types (graphical, console, remote, etc.). It can also clean up after users when they log out."))) -(define* (elogind-service #:key (config (elogind-configuration))) +(define-deprecated (elogind-service #:key (config (elogind-configuration))) + elogind-service-type "Return a service that runs the @command{elogind} login and seat management service. The @command{elogind} service integrates with PAM to allow other system components to know the set of logged-in users as well as their session @@ -1298,7 +1310,9 @@ over D-Bus that can list available accounts, change their passwords, and so on. AccountsService integrates with PolicyKit to enable unprivileged users to acquire the capability to modify their system configuration."))) -(define* (accountsservice-service #:key (accountsservice accountsservice)) +(define-deprecated + (accountsservice-service #:key (accountsservice accountsservice)) + accountsservice-service-type "Return a service that runs AccountsService, a system service that can list available accounts, change their passwords, and so on. AccountsService integrates with PolicyKit to enable unprivileged users to @@ -1818,8 +1832,12 @@ applications needing access to be root.") (service sddm-service-type)) ;; Screen lockers are a pretty useful thing and these are small. - (screen-locker-service slock) - (screen-locker-service xlockmore "xlock") + (service screen-locker-service-type + (screen-locker-configuration + "slock" (file-append slock "/bin/slock") #f)) + (service screen-locker-service-type + (screen-locker-configuration + "xlock" (file-append xlockmore "/bin/xlock") #f)) ;; Add udev rules for MTP devices so that non-root users can access ;; them. @@ -1859,15 +1877,15 @@ applications needing access to be root.") ;; The D-Bus clique. (service avahi-service-type) - (udisks-service) + (service udisks-service-type) (service upower-service-type) - (accountsservice-service) + (service accountsservice-service-type) (service cups-pk-helper-service-type) (service colord-service-type) - (geoclue-service) + (service geoclue-service-type) (service polkit-service-type) - (elogind-service) - (dbus-service) + (service elogind-service-type) + (service dbus-root-service-type) (service ntp-service-type) diff --git a/gnu/services/dict.scm b/gnu/services/dict.scm index 35253a0077..5a61085316 100644 --- a/gnu/services/dict.scm +++ b/gnu/services/dict.scm @@ -19,6 +19,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu services dict) + #:use-module (guix deprecation) #:use-module (guix gexp) #:use-module (guix records) #:use-module (guix modules) @@ -34,7 +35,7 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (ice-9 match) - #:export (dicod-service + #:export (dicod-service ; deprecated dicod-service-type dicod-configuration dicod-handler @@ -202,7 +203,8 @@ database { implements the standard DICT protocol supported by clients such as @command{dico} and GNOME Dictionary."))) -(define* (dicod-service #:key (config (dicod-configuration))) +(define-deprecated (dicod-service #:key (config (dicod-configuration))) + dicod-service-type "Return a service that runs the @command{dicod} daemon, an implementation of DICT server (@pxref{Dicod,,, dico, GNU Dico Manual}). diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index 50753b7ab6..2ff9f90cd0 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm @@ -114,7 +114,7 @@ (serial zone-file-serial (default 1)) (refresh zone-file-refresh - (default (* 2 24 3600))) + (default (* 12 3600))) (retry zone-file-retry (default (* 15 60))) (expiry zone-file-expiry @@ -754,6 +754,8 @@ cache.size = 100 * MB (default #f)) ;boolean (servers dnsmasq-configuration-servers (default '())) ;list of string + (servers-file dnsmasq-configuration-servers-file + (default #f)) ;string|file-like (addresses dnsmasq-configuration-addresses (default '())) ;list of string (cache-size dnsmasq-configuration-cache-size @@ -761,7 +763,7 @@ cache.size = 100 * MB (negative-cache? dnsmasq-configuration-negative-cache? (default #t)) ;boolean (cpe-id dnsmasq-configuration-cpe-id - (default #t)) ;string + (default #f)) ;string (tftp-enable? dnsmasq-configuration-tftp-enable? (default #f)) ;boolean (tftp-no-fail? dnsmasq-configuration-tftp-no-fail? @@ -792,7 +794,7 @@ cache.size = 100 * MB port local-service? listen-addresses resolv-file no-resolv? forward-private-reverse-lookup? query-servers-in-order? - servers addresses + servers addresses servers-file cache-size negative-cache? cpe-id tftp-enable? tftp-no-fail? @@ -805,76 +807,80 @@ cache.size = 100 * MB (requirement '(networking)) (documentation "Run the dnsmasq DNS server.") (start #~(make-forkexec-constructor - '(#$(file-append package "/sbin/dnsmasq") - "--keep-in-foreground" - "--pid-file=/run/dnsmasq.pid" - #$@(if no-hosts? - '("--no-hosts") + (list + #$(file-append package "/sbin/dnsmasq") + "--keep-in-foreground" + "--pid-file=/run/dnsmasq.pid" + #$@(if no-hosts? + '("--no-hosts") '()) - #$(format #f "--port=~a" port) - #$@(if local-service? - '("--local-service") + #$(format #f "--port=~a" port) + #$@(if local-service? + '("--local-service") '()) - #$@(map (cut format #f "--listen-address=~a" <>) - listen-addresses) - #$(format #f "--resolv-file=~a" resolv-file) - #$@(if no-resolv? - '("--no-resolv") + #$@(map (cut format #f "--listen-address=~a" <>) + listen-addresses) + #$(format #f "--resolv-file=~a" resolv-file) + #$@(if no-resolv? + '("--no-resolv") '()) - #$@(if forward-private-reverse-lookup? - '() + #$@(if forward-private-reverse-lookup? + '() '("--bogus-priv")) - #$@(if query-servers-in-order? - '("--strict-order") + #$@(if query-servers-in-order? + '("--strict-order") '()) - #$@(map (cut format #f "--server=~a" <>) - servers) - #$@(map (cut format #f "--address=~a" <>) - addresses) - #$(format #f "--cache-size=~a" cache-size) - #$@(if negative-cache? - '() + #$@(if servers-file + (list #~(string-append "--servers-file=" #$servers-file)) + '()) + #$@(map (cut format #f "--server=~a" <>) + servers) + #$@(map (cut format #f "--address=~a" <>) + addresses) + #$(format #f "--cache-size=~a" cache-size) + #$@(if negative-cache? + '() '("--no-negcache")) - #$@(if cpe-id - (list (format #f "--add-cpe-id=~a" cpe-id)) - '()) - #$@(if tftp-enable? - '("--enable-tftp") - '()) - #$@(if tftp-no-fail? - '("--tftp-no-fail") - '()) - #$@(if tftp-single-port? - '("--tftp-single-port") - '()) - #$@(if tftp-secure? - '("--tftp-secure?") - '()) - #$@(if tftp-max - (list (format #f "--tftp-max=~a" tftp-max)) + #$@(if cpe-id + (list (format #f "--add-cpe-id=~a" cpe-id)) + '()) + #$@(if tftp-enable? + '("--enable-tftp") '()) - #$@(if tftp-mtu - (list (format #f "--tftp-mtu=~a" tftp-mtu)) + #$@(if tftp-no-fail? + '("--tftp-no-fail") '()) - #$@(if tftp-no-blocksize? - '("--tftp-no-blocksize") + #$@(if tftp-single-port? + '("--tftp-single-port") '()) - #$@(if tftp-lowercase? - '("--tftp-lowercase") + #$@(if tftp-secure? + '("--tftp-secure") '()) - #$@(if tftp-port-range - (list (format #f "--tftp-port-range=~a" - tftp-port-range)) + #$@(if tftp-max + (list (format #f "--tftp-max=~a" tftp-max)) + '()) + #$@(if tftp-mtu + (list (format #f "--tftp-mtu=~a" tftp-mtu)) + '()) + #$@(if tftp-no-blocksize? + '("--tftp-no-blocksize") '()) - #$@(if tftp-root - (list (format #f "--tftp-root=~a" tftp-root)) + #$@(if tftp-lowercase? + '("--tftp-lowercase") '()) - #$@(if tftp-unique-root - (list - (if (> (length tftp-unique-root) 0) - (format #f "--tftp-unique-root=~a" tftp-unique-root) - (format #f "--tftp-unique-root"))) - '())) + #$@(if tftp-port-range + (list (format #f "--tftp-port-range=~a" + tftp-port-range)) + '()) + #$@(if tftp-root + (list (format #f "--tftp-root=~a" tftp-root)) + '()) + #$@(if tftp-unique-root + (list + (if (> (length tftp-unique-root) 0) + (format #f "--tftp-unique-root=~a" tftp-unique-root) + (format #f "--tftp-unique-root"))) + '())) #:pid-file "/run/dnsmasq.pid")) (stop #~(make-kill-destructor))))) diff --git a/gnu/services/lirc.scm b/gnu/services/lirc.scm index 492d77defa..92784b65ca 100644 --- a/gnu/services/lirc.scm +++ b/gnu/services/lirc.scm @@ -21,12 +21,13 @@ #:use-module (gnu services) #:use-module (gnu services shepherd) #:use-module (gnu packages lirc) + #:use-module (guix deprecation) #:use-module (guix gexp) #:use-module (guix records) #:use-module (ice-9 match) #:export (lirc-configuration lirc-configuation? - lirc-service + lirc-service ; deprecated lirc-service-type)) ;;; Commentary: @@ -40,9 +41,12 @@ lirc-configuation? (lirc lirc-configuration-lirc ;file-like (default lirc)) - (device lirc-configuration-device) ;string - (driver lirc-configuration-driver) ;string - (config-file lirc-configuration-file) ;string | file-like object + (device lirc-configuration-device ;string + (default #f)) + (driver lirc-configuration-driver ;string + (default #f)) + (config-file lirc-configuration-file ;string | file-like object + (default #f)) (extra-options lirc-configuration-options ;list of strings (default '()))) @@ -81,11 +85,13 @@ (service-extension activation-service-type (const %lirc-activation)))) (description "Run LIRC, a daemon that decodes infrared signals -from remote controls."))) +from remote controls.") + (default-value (lirc-configuration)))) -(define* (lirc-service #:key (lirc lirc) +(define-deprecated (lirc-service #:key (lirc lirc) device driver config-file (extra-options '())) + lirc-service-type "Return a service that runs @url{http://www.lirc.org,LIRC}, a daemon that decodes infrared signals from remote controls. diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index 6f588679b1..bf4948dcfb 100644 --- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm @@ -35,6 +35,7 @@ #:use-module (gnu packages admin) #:use-module (gnu packages dav) #:use-module (gnu packages tls) + #:use-module (guix deprecation) #:use-module (guix modules) #:use-module (guix records) #:use-module (guix packages) @@ -42,7 +43,7 @@ #:use-module (ice-9 match) #:use-module (ice-9 format) #:use-module (srfi srfi-1) - #:export (dovecot-service + #:export (dovecot-service ; deprecated dovecot-service-type dovecot-configuration opaque-dovecot-configuration @@ -1601,9 +1602,11 @@ greyed out, instead of only later giving \"not selectable\" popup error. (service-extension activation-service-type %dovecot-activation))) (description "Run Dovecot, a mail server that can run POP3, -IMAP, and LMTP."))) +IMAP, and LMTP.") + (default-value (dovecot-configuration)))) -(define* (dovecot-service #:key (config (dovecot-configuration))) +(define-deprecated (dovecot-service #:key (config (dovecot-configuration))) + dovecot-service-type "Return a service that runs @command{dovecot}, a mail server that can run POP3, IMAP, and LMTP. @var{config} should be a configuration object created by @code{dovecot-configuration}. @var{config} may also be created by diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index dacf64c2d1..4632498357 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -143,12 +143,17 @@ network-manager-configuration network-manager-configuration? + network-manager-configuration-shepherd-requirement network-manager-configuration-dns network-manager-configuration-vpn-plugins network-manager-service-type connman-configuration connman-configuration? + connman-configuration-connman + connman-configuration-shepherd-requirement + connman-configuration-disable-vpn? + connman-configuration-iwd? connman-service-type modem-manager-configuration @@ -1135,16 +1140,29 @@ project's documentation} for more information." ;;; NetworkManager ;;; +;; TODO: deprecated field, remove later. +(define-with-syntax-properties (warn-iwd?-field-deprecation + (value properties)) + (when value + (warning (source-properties->location properties) + (G_ "the 'iwd?' field is deprecated, please use \ +'shepherd-requirement' field instead~%"))) + value) + (define-record-type* <network-manager-configuration> network-manager-configuration make-network-manager-configuration network-manager-configuration? (network-manager network-manager-configuration-network-manager (default network-manager)) + (shepherd-requirement network-manager-configuration-shepherd-requirement + (default '(wpa-supplicant))) (dns network-manager-configuration-dns (default "default")) (vpn-plugins network-manager-configuration-vpn-plugins ;list of file-like (default '())) - (iwd? network-manager-configuration-iwd? (default #f))) + (iwd? network-manager-configuration-iwd? ; TODO: deprecated field, remove. + (default #f) + (sanitize warn-iwd?-field-deprecation))) (define (network-manager-activation config) ;; Activation gexp for NetworkManager @@ -1200,28 +1218,47 @@ project's documentation} for more information." (define (network-manager-shepherd-service config) (match-record config <network-manager-configuration> - (network-manager dns vpn-plugins iwd?) - (let ((conf (plain-file "NetworkManager.conf" - (string-append - "[main]\ndns=" dns "\n" - (if iwd? "[device]\nwifi.backend=iwd\n" "")))) - (vpn (vpn-plugin-directory vpn-plugins))) + (network-manager shepherd-requirement dns vpn-plugins iwd?) + (let* ((iwd? (or iwd? ; TODO: deprecated field, remove later. + (and shepherd-requirement + (memq 'iwd shepherd-requirement)))) + (conf (plain-file "NetworkManager.conf" + (string-append + "[main]\ndns=" dns "\n" + (if iwd? "[device]\nwifi.backend=iwd\n" "")))) + (vpn (vpn-plugin-directory vpn-plugins))) (list (shepherd-service (documentation "Run the NetworkManager.") - (provision '(networking)) - (requirement (append '(user-processes dbus-system loopback) - (if iwd? '(iwd) '(wpa-supplicant)))) - (start #~(make-forkexec-constructor - (list (string-append #$network-manager - "/sbin/NetworkManager") - (string-append "--config=" #$conf) - "--no-daemon") - #:environment-variables - (list (string-append "NM_VPN_PLUGIN_DIR=" #$vpn - "/lib/NetworkManager/VPN") - ;; Override non-existent default users - "NM_OPENVPN_USER=" - "NM_OPENVPN_GROUP="))) + (provision '(NetworkManager networking)) + (requirement `(user-processes dbus-system loopback + ,@shepherd-requirement + ;; TODO: iwd? is deprecated and should be passed + ;; with shepherd-requirement, remove later. + ,@(if iwd? '(iwd) '()))) + (start + #~(lambda _ + (let ((pid + (fork+exec-command + (list #$(file-append network-manager + "/sbin/NetworkManager") + (string-append "--config=" #$conf) + "--no-daemon") + #:environment-variables + (list (string-append "NM_VPN_PLUGIN_DIR=" #$vpn + "/lib/NetworkManager/VPN") + ;; Override non-existent default users + "NM_OPENVPN_USER=" + "NM_OPENVPN_GROUP=")))) + ;; XXX: Despite the "online" name, this doesn't guarantee + ;; WAN connectivity, it merely waits for NetworkManager + ;; to finish starting-up. This is required otherwise + ;; services will fail since the network interfaces be + ;; absent until NetworkManager finishes setting them up. + (system* #$(file-append network-manager "/bin/nm-online") + "--wait-for-startup" "--quiet") + ;; XXX: Finally, return the pid from running + ;; fork+exec-command to shepherd. + pid))) (stop #~(make-kill-destructor))))))) (define network-manager-service-type @@ -1265,10 +1302,13 @@ wireless networking.")))) connman-configuration? (connman connman-configuration-connman (default connman)) + (shepherd-requirement connman-configuration-shepherd-requirement + (default '())) (disable-vpn? connman-configuration-disable-vpn? (default #f)) (iwd? connman-configuration-iwd? - (default #f))) + (default #f) + (sanitize warn-iwd?-field-deprecation))) (define (connman-activation config) (let ((disable-vpn? (connman-configuration-disable-vpn? config))) @@ -1280,33 +1320,34 @@ wireless networking.")))) (mkdir-p "/var/lib/connman-vpn/")))))) (define (connman-shepherd-service config) - "Return a shepherd service for Connman" - (and - (connman-configuration? config) - (let ((connman (connman-configuration-connman config)) - (disable-vpn? (connman-configuration-disable-vpn? config)) - (iwd? (connman-configuration-iwd? config))) - (list (shepherd-service - (documentation "Run Connman") - (provision '(networking)) - (requirement - (append '(user-processes dbus-system loopback) - (if iwd? '(iwd) '()))) - (start #~(make-forkexec-constructor - (list (string-append #$connman - "/sbin/connmand") - "--nodaemon" - "--nodnsproxy" - #$@(if disable-vpn? '("--noplugin=vpn") '()) - #$@(if iwd? '("--wifi=iwd_agent") '())) - - ;; As connman(8) notes, when passing '-n', connman - ;; "directs log output to the controlling terminal in - ;; addition to syslog." Redirect stdout and stderr - ;; to avoid spamming the console (XXX: for some reason - ;; redirecting to /dev/null doesn't work.) - #:log-file "/var/log/connman.log")) - (stop #~(make-kill-destructor))))))) + (match-record config <connman-configuration> (connman shepherd-requirement + disable-vpn? iwd?) + (let ((iwd? (or iwd? ; TODO: deprecated field, remove later. + (and shepherd-requirement + (memq 'iwd shepherd-requirement))))) + (list (shepherd-service + (documentation "Run Connman") + (provision '(connman networking)) + (requirement `(user-processes dbus-system loopback + ,@shepherd-requirement + ;; TODO: iwd? is deprecated and should be passed + ;; with shepherd-requirement, remove later. + ,@(if iwd? '(iwd) '()))) + (start #~(make-forkexec-constructor + (list (string-append #$connman + "/sbin/connmand") + "--nodaemon" + "--nodnsproxy" + #$@(if disable-vpn? '("--noplugin=vpn") '()) + #$@(if iwd? '("--wifi=iwd_agent") '())) + + ;; As connman(8) notes, when passing '-n', connman + ;; "directs log output to the controlling terminal in + ;; addition to syslog." Redirect stdout and stderr + ;; to avoid spamming the console (XXX: for some reason + ;; redirecting to /dev/null doesn't work.) + #:log-file "/var/log/connman.log")) + (stop #~(make-kill-destructor))))))) (define %connman-log-rotation (list (log-rotation diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm index 3e778f3cea..8ca7acd737 100644 --- a/gnu/services/sound.scm +++ b/gnu/services/sound.scm @@ -38,12 +38,24 @@ #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:export (alsa-configuration + alsa-configuration? + alsa-configuration-alsa-plugins + alsa-configuration-pulseaudio? + alsa-configuration-extra-options alsa-service-type pulseaudio-configuration + pulseaudio-configuration? + pulseaudio-configuration-client-conf + pulseaudio-configuration-daemon-conf + pulseaudio-configuration-script-file + pulseaudio-configuration-extra-script-files + pulseaudio-configuration-system-script-file pulseaudio-service-type ladspa-configuration + ladspa-configuration? + ladspa-configuration-plugins ladspa-service-type)) ;;; Commentary: @@ -231,7 +243,7 @@ computed-file object~%") file)))) (define-record-type* <ladspa-configuration> ladspa-configuration make-ladspa-configuration ladspa-configuration? - (plugins ladspa-plugins (default '()))) + (plugins ladspa-configuration-plugins (default '()))) (define (ladspa-environment config) ;; Define this variable in the global environment such that @@ -239,7 +251,7 @@ computed-file object~%") file)))) `(("LADSPA_PATH" . (string-join ',(map (lambda (package) (file-append package "/lib/ladspa")) - (ladspa-plugins config)) + (ladspa-configuration-plugins config)) ":")))) (define ladspa-service-type diff --git a/gnu/services/spice.scm b/gnu/services/spice.scm index e5ec46b9b5..b8d2f8486e 100644 --- a/gnu/services/spice.scm +++ b/gnu/services/spice.scm @@ -21,12 +21,13 @@ #:use-module (gnu packages spice) #:use-module (gnu services) #:use-module (gnu services shepherd) + #:use-module (guix deprecation) #:use-module (guix gexp) #:use-module (guix records) #:export (spice-vdagent-configuration spice-vdagent-configuration? spice-vdagent-service-type - spice-vdagent-service)) + spice-vdagent-service)) ; deprecated (define-record-type* <spice-vdagent-configuration> spice-vdagent-configuration make-spice-vdagent-configuration @@ -74,8 +75,8 @@ from the @code{spice-vdagent} package to enable window resizing and clipboard sharing for @acronym{VM, virtual machine} guests."))) -(define* (spice-vdagent-service - #:optional (config (spice-vdagent-configuration))) +(define-deprecated (spice-vdagent-service + #:optional (config (spice-vdagent-configuration))) "Start the @command{vdagentd} and @command{vdagent} daemons from @var{spice-vdagent} to enable guest window resizing and clipboard sharing." diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm index 7b038e6ac6..b76544c1a8 100644 --- a/gnu/services/ssh.scm +++ b/gnu/services/ssh.scm @@ -42,7 +42,7 @@ #:use-module (ice-9 vlist) #:export (lsh-configuration lsh-configuration? - lsh-service + lsh-service ; deprecated lsh-service-type openssh-configuration @@ -52,7 +52,7 @@ dropbear-configuration dropbear-configuration? dropbear-service-type - dropbear-service + dropbear-service ; deprecated autossh-configuration autossh-configuration? @@ -74,20 +74,34 @@ lsh-configuration? (lsh lsh-configuration-lsh (default lsh)) - (daemonic? lsh-configuration-daemonic?) - (host-key lsh-configuration-host-key) - (interfaces lsh-configuration-interfaces) - (port-number lsh-configuration-port-number) - (allow-empty-passwords? lsh-configuration-allow-empty-passwords?) - (root-login? lsh-configuration-root-login?) - (syslog-output? lsh-configuration-syslog-output?) - (pid-file? lsh-configuration-pid-file?) - (pid-file lsh-configuration-pid-file) - (x11-forwarding? lsh-configuration-x11-forwarding?) - (tcp/ip-forwarding? lsh-configuration-tcp/ip-forwarding?) - (password-authentication? lsh-configuration-password-authentication?) - (public-key-authentication? lsh-configuration-public-key-authentication?) - (initialize? lsh-configuration-initialize?)) + (daemonic? lsh-configuration-daemonic? + (default #t)) + (host-key lsh-configuration-host-key + (default "/etc/lsh/host-key")) + (interfaces lsh-configuration-interfaces + (default '())) + (port-number lsh-configuration-port-number + (default 22)) + (allow-empty-passwords? lsh-configuration-allow-empty-passwords? + (default #f)) + (root-login? lsh-configuration-root-login? + (default #f)) + (syslog-output? lsh-configuration-syslog-output? + (default #t)) + (pid-file? lsh-configuration-pid-file? + (default #f)) + (pid-file lsh-configuration-pid-file + (default "/var/run/lshd.pid")) + (x11-forwarding? lsh-configuration-x11-forwarding? + (default #t)) + (tcp/ip-forwarding? lsh-configuration-tcp/ip-forwarding? + (default #t)) + (password-authentication? lsh-configuration-password-authentication? + (default #t)) + (public-key-authentication? lsh-configuration-public-key-authentication? + (default #t)) + (initialize? lsh-configuration-initialize? + (default #t))) (define %yarrow-seed "/var/spool/lsh/yarrow-seed-file") @@ -203,19 +217,20 @@ (lsh-configuration-allow-empty-passwords? config)))) (define lsh-service-type - (service-type (name 'lsh) - (description - "Run the GNU@tie{}lsh secure shell (SSH) daemon, + (service-type + (name 'lsh) + (extensions + (list (service-extension shepherd-root-service-type + lsh-shepherd-service) + (service-extension pam-root-service-type + lsh-pam-services) + (service-extension activation-service-type + lsh-activation))) + (description "Run the GNU@tie{}lsh secure shell (SSH) daemon, @command{lshd}.") - (extensions - (list (service-extension shepherd-root-service-type - lsh-shepherd-service) - (service-extension pam-root-service-type - lsh-pam-services) - (service-extension activation-service-type - lsh-activation))))) + (default-value (lsh-configuration)))) -(define* (lsh-service #:key +(define-deprecated (lsh-service #:key (lsh lsh) (daemonic? #t) (host-key "/etc/lsh/host-key") @@ -231,6 +246,7 @@ (password-authentication? #t) (public-key-authentication? #t) (initialize? #t)) + lsh-service-type "Run the @command{lshd} program from @var{lsh} to listen on port @var{port-number}. @var{host-key} must designate a file containing the host key, and readable only by root. @@ -701,7 +717,9 @@ of user-name/file-like tuples." dropbear-activation))) (default-value (dropbear-configuration)))) -(define* (dropbear-service #:optional (config (dropbear-configuration))) +(define-deprecated (dropbear-service #:optional + (config (dropbear-configuration))) + dropbear-service-type "Run the @uref{https://matt.ucc.asn.au/dropbear/dropbear.html,Dropbear SSH daemon} with the given @var{config}, a @code{<dropbear-configuration>} object." diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm index 4103f89ecf..a884d71eb2 100644 --- a/gnu/services/vpn.scm +++ b/gnu/services/vpn.scm @@ -39,11 +39,12 @@ #:use-module (guix records) #:use-module (guix gexp) #:use-module (guix i18n) + #:use-module (guix deprecation) #:use-module (srfi srfi-1) #:use-module (ice-9 match) #:use-module (ice-9 regex) - #:export (openvpn-client-service - openvpn-server-service + #:export (openvpn-client-service ; deprecated + openvpn-server-service ; deprecated openvpn-client-service-type openvpn-server-service-type openvpn-client-configuration @@ -531,7 +532,8 @@ is truncated and rewritten every minute.") (service-extension activation-service-type (const %openvpn-activation)))) (description "Run the OpenVPN server, which allows you to -@emph{host} a @acronym{VPN, virtual private network}."))) +@emph{host} a @acronym{VPN, virtual private network}.") + (default-value (openvpn-server-configuration)))) (define openvpn-client-service-type (service-type (name 'openvpn-client) @@ -544,12 +546,17 @@ is truncated and rewritten every minute.") (const %openvpn-activation)))) (description "Run the OpenVPN client service, which allows you to connect -to an existing @acronym{VPN, virtual private network}."))) +to an existing @acronym{VPN, virtual private network}.") + (default-value (openvpn-client-configuration)))) -(define* (openvpn-client-service #:key (config (openvpn-client-configuration))) +(define-deprecated + (openvpn-client-service #:key (config (openvpn-client-configuration))) + openvpn-client-service-type (service openvpn-client-service-type config)) -(define* (openvpn-server-service #:key (config (openvpn-server-configuration))) +(define-deprecated + (openvpn-server-service #:key (config (openvpn-server-configuration))) + openvpn-server-service-type (service openvpn-server-service-type config)) (define (generate-openvpn-server-documentation) diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 5f073d05d3..c4745cecf5 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -107,10 +107,13 @@ slim-service-type - screen-locker - screen-locker? + screen-locker-configuration + screen-locker-configuration? + screen-locker-configuration-name + screen-locker-configuration-program + screen-locker-configuration-allow-empty-password? screen-locker-service-type - screen-locker-service + screen-locker-service ; deprecated localed-configuration localed-configuration? @@ -683,21 +686,30 @@ reboot_cmd " shepherd "/sbin/reboot\n" ;;; Screen lockers & co. ;;; -(define-record-type <screen-locker> - (screen-locker name program empty?) +(define-record-type <screen-locker-configuration> + (screen-locker-configuration name program allow-empty-password?) + screen-locker-configuration? + (name screen-locker-configuration-name) ;string + (program screen-locker-configuration-program) ;gexp + (allow-empty-password? + screen-locker-configuration-allow-empty-password?)) ;Boolean + +(define-deprecated/public-alias + screen-locker + screen-locker-configuration) + +(define-deprecated/public-alias screen-locker? - (name screen-locker-name) ;string - (program screen-locker-program) ;gexp - (empty? screen-locker-allows-empty-passwords?)) ;Boolean + screen-locker-configuration?) (define screen-locker-pam-services (match-lambda - (($ <screen-locker> name _ empty?) + (($ <screen-locker-configuration> name _ empty?) (list (unix-pam-service name #:allow-empty-passwords? empty?))))) (define screen-locker-setuid-programs - (compose list file-like->setuid-program screen-locker-program)) + (compose list file-like->setuid-program screen-locker-configuration-program)) (define screen-locker-service-type (service-type (name 'screen-locker) @@ -711,10 +723,11 @@ reboot_cmd " shepherd "/sbin/reboot\n" the graphical server by making it setuid-root, so it can authenticate users, and by creating a PAM service for it."))) -(define* (screen-locker-service package - #:optional - (program (package-name package)) - #:key allow-empty-passwords?) +(define-deprecated (screen-locker-service package + #:optional + (program (package-name package)) + #:key allow-empty-passwords?) + screen-locker-service-type "Add @var{package}, a package for a screen locker or screen saver whose command is @var{program}, to the set of setuid programs and add a PAM entry for it. For example: @@ -725,9 +738,9 @@ for it. For example: makes the good ol' XlockMore usable." (service screen-locker-service-type - (screen-locker program - (file-append package "/bin/" program) - allow-empty-passwords?))) + (screen-locker-configuration program + (file-append package "/bin/" program) + allow-empty-passwords?))) ;;; |