From 4ef9a5dd5ec07d2cf4326b65d44a9227d184a56e Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 26 Feb 2023 01:00:00 +0100 Subject: file-systems: Validate 'no-diratime flag. This follows up on commit c0773455397746b10194bc14c7cef144f4095b65, and adds a comment to avoid this in future. * gnu/system/file-systems.scm (invalid-file-system-flags): Add 'no-diratime to the list of KNOWN-FLAGS. --- gnu/system/file-systems.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index f2eb2e0837..85b00a4a09 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -122,7 +122,7 @@ (define invalid-file-system-flags ;; Note: Keep in sync with 'mount-flags->bit-mask'. (let ((known-flags '(read-only bind-mount no-suid no-dev no-exec - no-atime strict-atime lazy-time + no-atime no-diratime strict-atime lazy-time shared))) (lambda (flags) "Return the subset of FLAGS that is invalid." -- cgit v1.2.3 From 6dd635b4cf7a65560056c1089982fe00f73e6468 Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Sat, 25 Feb 2023 18:57:48 +0000 Subject: services: base: Deprecate 'login-service' procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Base Services): Replace with login-service-type. * gnu/services/base.scm (login-service): Deprecate procedure. * gnu/system/install.scm (%installation-services): Use login-service-type. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 12 ++++++------ gnu/services/base.scm | 5 +++-- gnu/system/install.scm | 5 +++-- 3 files changed, 12 insertions(+), 10 deletions(-) (limited to 'gnu/system') diff --git a/doc/guix.texi b/doc/guix.texi index 537b8e19f5..0d205555c1 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18101,14 +18101,14 @@ Return a new record for the host at @var{address} with the given host names. @end defun -@deffn {Scheme Procedure} login-service @var{config} -Return a service to run login according to @var{config}, a -@code{} object, which specifies the message of the day, -among other things. -@end deffn +@defvar login-service-type +Type of the service that provides a console login service, whose value +is a @code{} object. +@end defvar @deftp {Data Type} login-configuration -This is the data type representing the configuration of login. +Data type representing the configuration of login, which specifies the +@acronym{MOTD, message of the day}, among other things. @table @asis diff --git a/gnu/services/base.scm b/gnu/services/base.scm index c471107883..8dfd92aacf 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -158,7 +158,7 @@ (define-module (gnu services base) login-configuration login-configuration? login-service-type - login-service + login-service ; deprecated agetty-configuration agetty-configuration? @@ -937,7 +937,8 @@ (define login-service-type "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)) diff --git a/gnu/system/install.scm b/gnu/system/install.scm index b3cf7a1bd8..8c7585f188 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -347,8 +347,9 @@ (define bare-bones-os (virtual-terminal "tty1") (login-program (installer-program)))) - (login-service (login-configuration - (motd motd))) + (service login-service-type + (login-configuration + (motd motd))) ;; Documentation. The manual is in UTF-8, but ;; 'console-font-service' sets up Unicode support and loads a font -- cgit v1.2.3 From ad665a38fc18ed7a6b8efb09086713b0e73e3781 Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Sat, 25 Feb 2023 18:57:49 +0000 Subject: services: base: Deprecate 'mingetty-service' procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Base Services): Replace mingetty-service with mingetty-service-type. * gnu/services/base.scm (mingetty-service): Deprecate procedure. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 15 +++++++-------- gnu/services/base.scm | 5 +++-- gnu/system/install.scm | 7 ++++--- 3 files changed, 14 insertions(+), 13 deletions(-) (limited to 'gnu/system') diff --git a/doc/guix.texi b/doc/guix.texi index 0d205555c1..06f77639ce 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18123,18 +18123,17 @@ the 'root' account has just been created. @end table @end deftp -@deffn {Scheme Procedure} mingetty-service @var{config} -Return a service to run mingetty according to @var{config}, a -@code{} object, which specifies the tty to run, among -other things. -@end deffn +@defvar mingetty-service-type +Type of the service that runs Mingetty, an implementation of the +virtual console log-in. The value for this service is a +@code{} object. +@end defvar @deftp {Data Type} mingetty-configuration -This is the data type representing the configuration of Mingetty, which -provides the default implementation of virtual console log-in. +Data type representing the configuration of Mingetty, which specifies +the tty to run, among other things. @table @asis - @item @code{tty} The name of the console this Mingetty runs on---e.g., @code{"tty1"}. diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 8dfd92aacf..c762485054 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -173,7 +173,7 @@ (define-module (gnu services base) mingetty-configuration-clear-on-logout? mingetty-configuration-mingetty mingetty-configuration? - mingetty-service + mingetty-service ; deprecated mingetty-service-type %nscd-default-caches @@ -1275,7 +1275,8 @@ (define mingetty-service-type "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)) diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 8c7585f188..1b05a862c6 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -331,9 +331,10 @@ (define* (%installation-services #:key (system (or (and=> Access documentation at any time by pressing Alt-F2.\x1b[0m "))) (define (normal-tty tty) - (mingetty-service (mingetty-configuration (tty tty) - (auto-login "root") - (login-pause? #t)))) + (service mingetty-service-type + (mingetty-configuration (tty tty) + (auto-login "root") + (login-pause? #t)))) (define bare-bones-os (load "examples/bare-bones.tmpl")) -- cgit v1.2.3 From 4892c0186eec75253701c5097803b6168a2956ce Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Sat, 25 Feb 2023 18:57:50 +0000 Subject: services: base: Deprecate 'agetty-service' procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Base Services): Replace agetty-service with agetty-service-type. * gnu/services/base.scm (agetty-service): Deprecate procedure. * gnu/system/examples/beaglebone-black.tmpl (operating-system)[services]: Use agetty-service-type. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 17 ++++++++--------- gnu/services/base.scm | 5 +++-- gnu/system/examples/beaglebone-black.tmpl | 14 +++++++------- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'gnu/system') diff --git a/doc/guix.texi b/doc/guix.texi index 06f77639ce..de7b61432e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18160,19 +18160,18 @@ The Mingetty package to use. @end table @end deftp -@deffn {Scheme Procedure} agetty-service @var{config} -Return a service to run agetty according to @var{config}, an -@code{} object, which specifies the tty to run, -among other things. -@end deffn +@defvar agetty-service-type +Type of the service that runs agetty, which implements virtual and +serial console log-in. The value for this service is a +@code{} object. +@end defvar @deftp {Data Type} agetty-configuration -This is the data type representing the configuration of agetty, which -implements virtual and serial console log-in. See the @code{agetty(8)} -man page for more information. +Data type representing the configuration of agetty, which specifies the +tty to run, among other things@footnote{See the @code{agetty(8)} +man page for more information.}. @table @asis - @item @code{tty} The name of the console this agetty runs on, as a string---e.g., @code{"ttyS0"}. This argument is optional, it will default to diff --git a/gnu/services/base.scm b/gnu/services/base.scm index c762485054..c5fd0cf5b4 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -162,7 +162,7 @@ (define-module (gnu services base) agetty-configuration agetty-configuration? - agetty-service + agetty-service ; deprecated agetty-service-type mingetty-configuration @@ -1210,7 +1210,8 @@ (define agetty-service-type "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)) diff --git a/gnu/system/examples/beaglebone-black.tmpl b/gnu/system/examples/beaglebone-black.tmpl index 40d0a76a37..18bbb2723c 100644 --- a/gnu/system/examples/beaglebone-black.tmpl +++ b/gnu/system/examples/beaglebone-black.tmpl @@ -48,10 +48,10 @@ (services (append (list (service dhcp-client-service-type) ;; mingetty does not work on serial lines. ;; Use agetty with board-specific serial parameters. - (agetty-service - (agetty-configuration - (extra-options '("-L")) - (baud-rate "115200") - (term "vt100") - (tty "ttyO0")))) - %base-services))) + (service agetty-service-type + (agetty-configuration + (extra-options '("-L")) + (baud-rate "115200") + (term "vt100") + (tty "ttyO0")))) + %base-services))) -- cgit v1.2.3 From 98e9dc6ab7f66203fa9a921605ef7de0ff038e11 Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Sat, 25 Feb 2023 18:57:52 +0000 Subject: services: base: Deprecate 'nscd-service' procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Application Setup): Compress @cindex entries. (Base Services): Compress @cindex entries. Delete %nscd-default-configuration. Replace 'nscd-service' with 'nscd-service-type'. * gnu/services/base.scm (%nscd-default-configuration): Deprecate variable. (nscd-service): Deprecate procedure. * gnu/system/install.scm (%installation-services): Use nscd-service-type. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 25 +++++++------------------ gnu/services/base.scm | 12 +++++++----- gnu/system/install.scm | 5 +++-- 3 files changed, 17 insertions(+), 25 deletions(-) (limited to 'gnu/system') diff --git a/doc/guix.texi b/doc/guix.texi index c0932804dd..e849728b4e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -1976,8 +1976,7 @@ versions may be incompatible. @cindex name service switch, glibc @cindex NSS (name service switch), glibc -@cindex nscd (name service caching daemon) -@cindex name service caching daemon (nscd) +@cindex @abbr{nscd, name service cache daemon} When using Guix on a foreign distro, we @emph{strongly recommend} that the system run the GNU C library's @dfn{name service cache daemon}, @command{nscd}, which should be listening on the @@ -18390,20 +18389,17 @@ The Kmscon package to use. @end table @end deftp -@cindex name service cache daemon -@cindex nscd -@deffn {Scheme Procedure} nscd-service [@var{config}] [#:glibc glibc] @ - [#:name-services '()] -Return a service that runs the libc name service cache daemon (nscd) with the -given @var{config}---an @code{} object. @xref{Name -Service Switch}, for an example. +@cindex @abbr{nscd, name service cache daemon} +@defvar nscd-service-type +Type of the service that runs the libc @abbr{nscd, name service cache +daemon}, whose value is a @code{} object. For convenience, the Shepherd service for nscd provides the following actions: @table @code @item invalidate -@cindex cache invalidation, nscd @cindex nscd, cache invalidation +@cindex cache invalidation, nscd This invalidate the given cache. For instance, running: @example @@ -18417,17 +18413,10 @@ invalidates the host name lookup cache of nscd. Running @command{herd statistics nscd} displays information about nscd usage and caches. @end table - -@end deffn - -@defvar %nscd-default-configuration -This is the default @code{} value (see below) used -by @code{nscd-service}. It uses the caches defined by -@code{%nscd-default-caches}; see below. @end defvar @deftp {Data Type} nscd-configuration -This is the data type representing the name service cache daemon (nscd) +Data type representing the @abbr{nscd, name service cache daemon} configuration. @table @asis diff --git a/gnu/services/base.scm b/gnu/services/base.scm index c5fd0cf5b4..423a38e39d 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -177,7 +177,7 @@ (define-module (gnu services base) mingetty-service-type %nscd-default-caches - %nscd-default-configuration + %nscd-default-configuration ; deprecated nscd-configuration nscd-configuration? @@ -186,7 +186,7 @@ (define-module (gnu services base) nscd-cache? nscd-service-type - nscd-service + nscd-service ; deprecated syslog-configuration syslog-configuration? @@ -1343,7 +1343,8 @@ (define %nscd-default-caches (check-files? #t) ;check /etc/services changes (persistent? #t)))) -(define %nscd-default-configuration +(define-deprecated %nscd-default-configuration + #f ;; Default nscd configuration. (nscd-configuration)) @@ -1497,13 +1498,14 @@ (define nscd-service-type (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{} 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{} object. @xref{Name Service Switch}, for an example." diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 1b05a862c6..f7de0d6a09 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -426,8 +426,9 @@ (define bare-bones-os ;; 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))) + (service nscd-service-type + (nscd-configuration + (caches %nscd-minimal-caches))) ;; Having /bin/sh is a good idea. In particular it allows Tramp ;; connections to this system to work. -- cgit v1.2.3 From 6edacf249110ce9e59dc44f330d7f03ecd7c60d8 Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Sat, 25 Feb 2023 18:57:53 +0000 Subject: services: base: Deprecate 'syslog-service' procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Base Services): Replace syslog-service with syslog-service-type. * gnu/services/base.scm (%default-syslog.conf): Place before . (syslog-service-type): Set default value. (syslog-service): Deprecate procedure. (%base-services): Use syslog-service-type. * gnu/system/hurd.scm (%base-services/hurd): Ditto. * gnu/system/install.scm (%installation-services): Ditto. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 19 +++++++--------- gnu/services/base.scm | 61 +++++++++++++++++++++++++------------------------- gnu/system/hurd.scm | 2 +- gnu/system/install.scm | 2 +- 4 files changed, 41 insertions(+), 43 deletions(-) (limited to 'gnu/system') diff --git a/doc/guix.texi b/doc/guix.texi index e849728b4e..7b4ecf9e81 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18494,11 +18494,15 @@ privacy---often the result of host name lookups is in local cache, so external name servers do not even need to be queried. @end defvar -@anchor{syslog-configuration-type} @cindex syslog @cindex logging +@defvar syslog-service-type +Type of the service that runs the syslog daemon, whose value is a +@code{} object. +@end defvar + @deftp {Data Type} syslog-configuration -This data type represents the configuration of the syslog daemon. +Data type representing the configuration of the syslog daemon. @table @asis @item @code{syslogd} (default: @code{#~(string-append #$inetutils "/libexec/syslogd")}) @@ -18506,19 +18510,12 @@ The syslog daemon to use. @item @code{config-file} (default: @code{%default-syslog.conf}) The syslog configuration file to use. +@xref{syslogd invocation,,, inetutils, GNU Inetutils}, for more +information on the configuration file syntax. @end table @end deftp -@anchor{syslog-service} -@cindex syslog -@deffn {Scheme Procedure} syslog-service @var{config} -Return a service that runs a syslog daemon according to @var{config}. - -@xref{syslogd invocation,,, inetutils, GNU Inetutils}, for more -information on the configuration file syntax. -@end deffn - @defvar guix-service-type This is the type of the service that runs the build daemon, @command{guix-daemon} (@pxref{Invoking guix-daemon}). Its value must be a diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 423a38e39d..45e6c5f448 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -190,7 +190,7 @@ (define-module (gnu services base) syslog-configuration syslog-configuration? - syslog-service + syslog-service ; deprecated syslog-service-type %default-syslog.conf @@ -1511,6 +1511,32 @@ (define-deprecated (nscd-service #:optional (config (nscd-configuration))) 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 make-syslog-configuration @@ -1540,37 +1566,12 @@ (define syslog-service-type (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{} as a parameter. @@ -3294,7 +3295,7 @@ (define %base-services (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/system/hurd.scm b/gnu/system/hurd.scm index 24fc6dbcae..20dc4ae735 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -93,7 +93,7 @@ (define %base-services/hurd `(("/bin/sh" ,(file-append bash "/bin/sh")) ("/usr/bin/env" ,(file-append coreutils "/bin/env")))) - (syslog-service)) + (service syslog-service-type)) (map (lambda (n) (service hurd-getty-service-type (hurd-getty-configuration diff --git a/gnu/system/install.scm b/gnu/system/install.scm index f7de0d6a09..8c7752df0e 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -367,7 +367,7 @@ (define bare-bones-os (normal-tty "tty6") ;; The usual services. - (syslog-service) + (service syslog-service-type) ;; Use the Avahi daemon to discover substitute servers on the local ;; network. It can be faster than fetching from remote servers. -- cgit v1.2.3 From 2e7516168e7b27d1ad3cee60d337d2ad98fb09ff Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Sat, 25 Feb 2023 18:57:54 +0000 Subject: services: base: Deprecate 'udev-service' procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Base Services): Replace udev-service with udev-service-type. Document . Use @defun @-commands for udev-rules-service, udev-rule and file->udev-rule. * gnu/services/base.scm (udev-service): Deprecate procedure. * gnu/system/install.scm (%installation-services): Use udev-service-type. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 52 ++++++++++++++++++++++++++++++++------------------ gnu/services/base.scm | 5 +++-- gnu/system/install.scm | 4 +++- 3 files changed, 39 insertions(+), 22 deletions(-) (limited to 'gnu/system') diff --git a/doc/guix.texi b/doc/guix.texi index 7b4ecf9e81..f4bfb8a24f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18675,15 +18675,30 @@ A list of file-like objects or strings pointing to additional directories the bu @end table @end deftp -@deffn {Scheme Procedure} udev-service [#:udev @var{eudev} #:rules @code{'()}] -Run @var{udev}, which populates the @file{/dev} directory dynamically. -udev rules can be provided as a list of files through the @var{rules} -variable. The procedures @code{udev-rule}, @code{udev-rules-service} -and @code{file->udev-rule} from @code{(gnu services base)} simplify the -creation of such rule files. -@end deffn +@defvar udev-service-type +Type of the service that runs udev, a service which populates the +@file{/dev} directory dynamically, whose value is a +@code{} object. + +This service type can be @emph{extended} using procedures +@code{udev-rules-service} along with @code{file->udev-rule} or +@code{udev-rule} which simplify the process of writing udev rules. +@end defvar -@deffn {Scheme Procedure} udev-rule [@var{file-name} @var{contents}] +@deftp {Data Type} udev-configuration +Data type representing the configuration of udev. + +@table @asis +@item @code{udev} (default: @code{eudev}) (type: file-like) +Package object of the udev service. + +@item @code{rules} (default: @var{'()}) (type: list-of-file-like) +List of file-like objects denoting udev-rule files. + +@end table +@end deftp + +@defun udev-rule @var{file-name} @var{contents} Return a udev-rule file named @var{file-name} containing the rules defined by the @var{contents} literal. @@ -18699,18 +18714,17 @@ upon detecting a USB device with a given product identifier. "ATTR@{product@}==\"Example\", " "RUN+=\"/path/to/script\""))) @end lisp -@end deffn +@end defun -@deffn {Scheme Procedure} udev-rules-service [@var{name} @var{rules}] @ - [#:groups @var{groups}] -Return a service that extends @code{udev-service-type } with @var{rules} +@defun udev-rules-service @var{name} @var{rules} [#:groups '()] +Return a service that extends @code{udev-service-type} with @var{rules} and @code{account-service-type} with @var{groups} as system groups. This works by creating a singleton service type @code{@var{name}-udev-rules}, of which the returned service is an instance. -Here we show how it can be used to extend @code{udev-service-type} with the -previously defined rule @code{%example-udev-rule}. +Here we show how it can be used to extend @code{udev-service-type} +with the previously defined rule @code{%example-udev-rule}. @lisp (operating-system @@ -18719,11 +18733,11 @@ previously defined rule @code{%example-udev-rule}. (cons (udev-rules-service 'usb-thing %example-udev-rule) %desktop-services))) @end lisp -@end deffn +@end defun -@deffn {Scheme Procedure} file->udev-rule [@var{file-name} @var{file}] -Return a udev file named @var{file-name} containing the rules defined -within @var{file}, a file-like object. +@defun file->udev-rule @var{file-name} @var{file} +Return a udev-rule file named @var{file-name} containing the rules +defined within @var{file}, a file-like object. The following example showcases how we can use an existing rule file. @@ -18743,7 +18757,7 @@ The following example showcases how we can use an existing rule file. (sha256 (base32 "0lmmagpyb6xsq6zcr2w1cyx9qmjqmajkvrdbhjx32gqf1d9is003")))))) @end lisp -@end deffn +@end defun Additionally, Guix package definitions can be included in @var{rules} in order to extend the udev rules with the definitions found under their diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 45e6c5f448..b183cf58c1 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -150,7 +150,7 @@ (define-module (gnu services base) udev-configuration? udev-configuration-rules udev-service-type - udev-service + udev-service ; deprecated udev-rule file->udev-rule udev-rules-service @@ -2351,7 +2351,8 @@ (define udev-service-type 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 diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 8c7752df0e..dd965f312b 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -388,7 +388,9 @@ (define bare-bones-os ;; 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)) + (service udev-service-type + (udev-configuration + (rules (list lvm2 crda)))) ;; Add the 'cow-store' service, which users have to start manually ;; since it takes the installation directory as an argument. -- cgit v1.2.3 From 2799ad44234be675f018115f99be98d2c9fd565d Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Sat, 25 Feb 2023 18:58:13 +0000 Subject: services: dbus: Deprecate 'dbus-service' procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Desktop Services): Replace with 'dbus-root-service-type'. Document dbus-configuration. * gnu/services/dbus.scm (dbus-service): Define with 'define-deprecated'. * gnu/services/desktop.scm (desktop-services-for-system): Replace with dbus-root-service-type. * gnu/system/install.scm (%installation-services): Ditto. * gnu/tests/base.scm (%avahi-os): Ditto. * gnu/tests/docker.scm (%docker-os): Ditto. * gnu/tests/lightdm.scm (minimal-desktop-services): Ditto. * gnu/tests/virtualization.scm (%libvirt-os): Ditto. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 49 ++++++++++++++++++++++++++++---------------- gnu/services/dbus.scm | 5 +++-- gnu/services/desktop.scm | 2 +- gnu/system/install.scm | 2 +- gnu/tests/base.scm | 2 +- gnu/tests/docker.scm | 2 +- gnu/tests/lightdm.scm | 2 +- gnu/tests/virtualization.scm | 2 +- 8 files changed, 40 insertions(+), 26 deletions(-) (limited to 'gnu/system') diff --git a/doc/guix.texi b/doc/guix.texi index 704c125b10..74658dbc86 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -23301,24 +23301,37 @@ The actual service definitions included in @code{%desktop-services} and provided by @code{(gnu services dbus)} and @code{(gnu services desktop)} are described below. -@deffn {Scheme Procedure} dbus-service [#:dbus @var{dbus}] [#:services '()] @ - [#:verbose?] -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 -verbose-enabled D-Bus package such as @code{dbus-verbose} should be -provided as @var{dbus} in this scenario. The verbose output is logged -to @file{/var/log/dbus-daemon.log}. - -@uref{https://dbus.freedesktop.org/, D-Bus} is an inter-process communication -facility. Its system bus is used to allow system services to communicate -and to be notified of system-wide events. - -@var{services} must be a list of packages that provide an -@file{etc/dbus-1/system.d} directory containing additional D-Bus configuration -and policy files. For example, to allow avahi-daemon to use the system bus, -@var{services} must be equal to @code{(list avahi)}. -@end deffn +@defvar dbus-root-service-type +Type for a service that runs the D-Bus ``system bus''. +@footnote{@uref{https://dbus.freedesktop.org/, D-Bus} is an inter-process +communication facility. Its system bus is used to allow system services +to communicate and to be notified of system-wide events.} + +The value for this service type is a @code{} record. +@end defvar + +@deftp {Data Type} dbus-configuration +Data type representing the configuration for @code{dbus-root-service-type}. + +@table @asis +@item @code{dbus} (default: @code{dbus}) (type: file-like) +Package object for dbus. + +@item @code{services} (default: @code{()}) (type: list) +List of packages that provide an @file{etc/dbus-1/system.d} directory +containing additional D-Bus configuration and policy files. +For example, to allow avahi-daemon to use the system bus, @var{services} +must be equal to @code{(list avahi)}. + +@item @code{verbose?} (default: @code{#f}) (type: boolean) +When @code{#t}, D-Bus is launched with environment variable +@samp{DBUS_VERBOSE} set to @samp{1}. A verbose-enabled D-Bus package +such as @code{dbus-verbose} should be provided to @var{dbus} in this +scenario. The verbose output is logged to +@file{/var/log/dbus-daemon.log}. + +@end table +@end deftp @subsubheading Elogind diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index ea2593501f..e9c9346f56 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -38,7 +38,7 @@ (define-module (gnu services dbus) #:export (dbus-configuration dbus-configuration? dbus-root-service-type - dbus-service + dbus-service ; deprecated wrapped-dbus-service polkit-configuration @@ -245,7 +245,8 @@ (define dbus-root-service-type 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 diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 3ec746cdbd..8026778ea5 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -1880,7 +1880,7 @@ (define* (desktop-services-for-system #:optional (service geoclue-service-type) (service polkit-service-type) (service elogind-service-type) - (dbus-service) + (service dbus-root-service-type) (service ntp-service-type) diff --git a/gnu/system/install.scm b/gnu/system/install.scm index dd965f312b..7a68c19606 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -442,7 +442,7 @@ (define bare-bones-os (list %loopback-static-networking)) (service wpa-supplicant-service-type) - (dbus-service) + (service dbus-root-service-type) (service connman-service-type (connman-configuration (disable-vpn? #t))) diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 3e72e193d7..97edbbc6ad 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -962,7 +962,7 @@ (define %avahi-os (name-service-switch %mdns-host-lookup-nss) (services (cons* (service avahi-service-type (avahi-configuration (debug? #t))) - (dbus-service) + (service dbus-root-service-type) (service dhcp-client-service-type) ;needed for multicast ;; Enable heavyweight debugging output. diff --git a/gnu/tests/docker.scm b/gnu/tests/docker.scm index e464ec587e..0276e398a7 100644 --- a/gnu/tests/docker.scm +++ b/gnu/tests/docker.scm @@ -48,7 +48,7 @@ (define-module (gnu tests docker) (define %docker-os (simple-operating-system (service dhcp-client-service-type) - (dbus-service) + (service dbus-root-service-type) (service polkit-service-type) (service elogind-service-type) (service docker-service-type))) diff --git a/gnu/tests/lightdm.scm b/gnu/tests/lightdm.scm index aa97a96939..dda472bd74 100644 --- a/gnu/tests/lightdm.scm +++ b/gnu/tests/lightdm.scm @@ -49,7 +49,7 @@ (define minimal-desktop-services (service accountsservice-service-type) (service polkit-service-type) (service elogind-service-type) - (dbus-service) + (service dbus-root-service-type) x11-socket-directory-service)) (define %lightdm-os diff --git a/gnu/tests/virtualization.scm b/gnu/tests/virtualization.scm index 6749ade4bd..effdeb4cfa 100644 --- a/gnu/tests/virtualization.scm +++ b/gnu/tests/virtualization.scm @@ -49,7 +49,7 @@ (define-module (gnu tests virtualization) (define %libvirt-os (simple-operating-system (service dhcp-client-service-type) - (dbus-service) + (service dbus-root-service-type) (service polkit-service-type) (service libvirt-service-type))) -- cgit v1.2.3 From 2397f4768091210b0a705ef750f2f38d6946fb89 Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Mon, 27 Feb 2023 14:59:39 +0000 Subject: file-systems: Remove deprecated 'title' field helper procedures. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/system/file-systems.scm (): Change constructor name to 'file-system'. (report-deprecation, device-expression, process-file-system-declaration, file-system): Remove macros. (file-system-title): Remove procedure. Signed-off-by: Ludovic Courtès --- gnu/system/file-systems.scm | 69 +-------------------------------------------- 1 file changed, 1 insertion(+), 68 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 85b00a4a09..0ff5a0dcf6 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -42,7 +42,6 @@ (define-module (gnu system file-systems) file-system? file-system-device file-system-device->string - file-system-title ;deprecated file-system-mount-point file-system-type file-system-needed-for-boot? @@ -158,7 +157,7 @@ (define-syntax validate-file-system-flags #'%validate-file-system-flags)))) ;; File system declaration. -(define-record-type* %file-system +(define-record-type* file-system make-file-system file-system? (device file-system-device) ; string | | @@ -200,72 +199,6 @@ (define-record-type (format port "#" (file-system-label->string obj)))) -(define-syntax report-deprecation - (lambda (s) - "Report the use of the now-deprecated 'title' field." - (syntax-case s () - ((_ field) - (let* ((source (syntax-source #'field)) - (file (and source (assq-ref source 'filename))) - (line (and source - (and=> (assq-ref source 'line) 1+))) - (column (and source (assq-ref source 'column)))) - (format (current-error-port) - "~a:~a:~a: warning: 'title' field is deprecated~%" - file line column) - #t))))) - -;; Helper for 'process-file-system-declaration'. -(define-syntax device-expression - (syntax-rules (quote label uuid device) - ((_ (quote label) dev) - (file-system-label dev)) - ((_ (quote uuid) dev) - (if (uuid? dev) dev (uuid dev))) - ((_ (quote device) dev) - dev) - ((_ title dev) - (case title - ((label) (file-system-label dev)) - ((uuid) (uuid dev)) - (else dev))))) - -;; Helper to interpret the now-deprecated 'title' field. Detect forms like -;; (title 'label), remove them, and adjust the 'device' field accordingly. -;; TODO: Remove this once 'title' has been deprecated long enough. -(define-syntax process-file-system-declaration - (syntax-rules (device title) - ((_ () (rest ...) #f #f) ;no 'title' and no 'device' field - (%file-system rest ...)) - ((_ () (rest ...) dev #f) ;no 'title' field - (%file-system rest ... (device dev))) - ((_ () (rest ...) dev titl) ;got a 'title' field - (%file-system rest ... - (device (device-expression titl dev)))) - ((_ ((title titl) rest ...) (previous ...) dev _) - (begin - (report-deprecation (title titl)) - (process-file-system-declaration (rest ...) - (previous ...) - dev titl))) - ((_ ((device dev) rest ...) (previous ...) _ titl) - (process-file-system-declaration (rest ...) - (previous ...) - dev titl)) - ((_ (field rest ...) (previous ...) dev titl) - (process-file-system-declaration (rest ...) - (previous ... field) - dev titl)))) - -(define-syntax-rule (file-system fields ...) - (process-file-system-declaration (fields ...) () #f #f)) - -(define (file-system-title fs) ;deprecated - (match (file-system-device fs) - ((? file-system-label?) 'label) - ((? uuid?) 'uuid) - ((? string?) 'device))) - ;; Note: This module is used both on the build side and on the host side. ;; Arrange not to pull (guix store) and (guix config) because the latter ;; differs from user to user. -- cgit v1.2.3 From 723fc5df3e964fcecb09c7c6fd48f00f97e2e806 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 13 Feb 2023 20:56:54 +0200 Subject: system: Update skeleton gdbinit. * gnu/system/shadow.scm (default-skeleton): Update gdbinit to search for more debug packages in guix-home and the system profile. (skeleton-directory): Move .gdbinit to .config/gdb/gdbinit. --- gnu/system/shadow.scm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index 445a72e2f5..2bd72d3e96 100644 --- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013-2020, 2022 Ludovic Courtès ;;; Copyright © 2016 Alex Griffin ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen -;;; Copyright © 2020 Efraim Flashner +;;; Copyright © 2020, 2023 Efraim Flashner ;;; Copyright © 2020 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. @@ -168,8 +168,16 @@ (define (default-skeletons) guile (use-modules (gdb)) (execute (string-append \"set debug-file-directory \" - (or (getenv \"GDB_DEBUG_FILE_DIRECTORY\") - \"~/.guix-profile/lib/debug\"))) + (string-join + (filter file-exists? + (append + (if (getenv \"GDB_DEBUG_FILE_DIRECTORY\") + (list (getenv \"GDB_DEBUG_FILE_DIRECTORY\")) + '()) + (list \"~/.guix-home/profile/lib/debug\" + \"~/.guix-profile/lib/debug\" + \"/run/current-system/profile/lib/debug\"))) + \":\"))) end # Authorize extensions found in the store, such as the @@ -228,6 +236,9 @@ (define (skeleton-directory skeletons) (when (file-exists? ".nanorc") (mkdir-p ".config/nano") (rename-file ".nanorc" ".config/nano/nanorc")) + (when (file-exists? ".gdbinit") + (mkdir-p ".config/gdb") + (rename-file ".gdbinit" ".config/gdb/gdbinit")) #t)))) (define (find-duplicates list) -- cgit v1.2.3