From 956607e34095e99235706e94b61376a4c7c497bf Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 18 Mar 2019 21:52:18 +0100 Subject: services: xorg: Remove unused #:guile parameter. * gnu/services/xorg.scm (xorg-wrapper): Remove #:guile, which was unused. (xorg-start-command): Likewise. (xinitrc): Likewise. --- gnu/services/xorg.scm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index f2a3c28c90..8381a7ed04 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -261,7 +261,6 @@ in @var{modules}." #t)))) (define* (xorg-wrapper #:key - (guile (canonical-package guile-2.0)) (modules %default-xorg-modules) (configuration-file (xorg-configuration-file #:modules modules)) @@ -287,7 +286,6 @@ in place of @code{/usr/bin/X}." (program-file "X-wrapper" exp)) (define* (xorg-start-command #:key - (guile (canonical-package guile-2.0)) (modules %default-xorg-modules) (fonts %default-xorg-fonts) (configuration-file @@ -300,8 +298,7 @@ packages, and @var{fonts}, a list of X font directories, are available. See @code{xorg-wrapper} for more details on the arguments. The result should be used in place of @code{startx}." (define X - (xorg-wrapper #:guile guile - #:configuration-file configuration-file + (xorg-wrapper #:configuration-file configuration-file #:modules modules #:xorg-server xorg-server)) (define exp @@ -312,9 +309,7 @@ used in place of @code{startx}." (program-file "startx" exp)) -(define* (xinitrc #:key - (guile (canonical-package guile-2.0)) - fallback-session) +(define* (xinitrc #:key fallback-session) "Return a system-wide xinitrc script that starts the specified X session, which should be passed to this script as the first argument. If not, the @var{fallback-session} will be used or, if @var{fallback-session} is false, a -- cgit v1.2.3 From b2e564515a811c75ed9bd30969bc48ac4eadebfb Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 18 Mar 2019 22:56:13 +0100 Subject: services: xorg: Define an record type. * gnu/services/xorg.scm (): New record type. (xorg-configuration-file): Remove. (xorg-wrapper): Remove #:modules, #:configuration-file, and #:xorg-server; add optional 'config' parameter instead. Adjust accordingly. (xorg-start-command): Likewise. * doc/guix.texi (X Window): Document 'xorg-configuration'. Update 'xorg-start-command' documentation. Remove 'xorg-configuration-file' documentation. --- doc/guix.texi | 118 +++++++++++++++---------------------------------- gnu/services/xorg.scm | 119 +++++++++++++++++++++++++------------------------- 2 files changed, 95 insertions(+), 142 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 5789b3b99b..b49f651562 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13352,99 +13352,53 @@ type @code{}. @end example @end deffn -@deffn {Scheme Procedure} xorg-start-command @ - [#:modules %default-xorg-modules] @ - [#:fonts %default-xorg-fonts] @ - [#:configuration-file (xorg-configuration-file @dots{})] @ - [#:xorg-server @var{xorg-server}] - [#:xserver-arguments '("-nolisten" "tcp")] -Return a @code{startx} script in which @var{modules}, a list of X module -packages, and @var{fonts}, a list of X font directories, are available. See -@code{xorg-wrapper} for more details on the arguments. The result should be -used in place of @code{startx}. +@cindex Xorg, configuration +@deftp {Data Type} xorg-configuration +This data type represents the configuration of the Xorg graphical display +server. Note that there is not Xorg service; instead, the X server is started +by a ``display manager'' such as GDM, SDDM, and SLiM. Thus, the configuration +of these display managers aggregates an @code{xorg-configuration} record. -Usually the X server is started by a login manager. -@end deffn +@table @asis +@item @code{modules} (default: @code{%default-xorg-modules}) +This is a list of @dfn{module packages} loaded by the Xorg +server---e.g., @code{xf86-video-vesa}, @code{xf86-input-keyboard}, and so on. -@cindex @code{-listen tcp}, for X11. -This procedure is useful to override command line options for the X server, -such as having it listen to over TCP: +@item @code{fonts} (default: @code{%default-xorg-fonts}) +This is a list of font directories to add to the server's @dfn{font path}. -@example -(operating-system - ... - (services - (modify-services %desktop-services - (slim-service-type config => - (slim-configuration - (inherit config) - (startx (xorg-start-command - #:xserver-arguments '("-listen" "tcp")))))))) -@end example - -@deffn {Scheme Procedure} xorg-configuration-file @ - [#:modules %default-xorg-modules] @ - [#:fonts %default-xorg-fonts] @ - [#:drivers '()] [#:resolutions '()] [#:extra-config '()] -Return a configuration file for the Xorg server containing search paths for -all the common drivers. - -@var{modules} must be a list of @dfn{module packages} loaded by the Xorg -server---e.g., @code{xf86-video-vesa}, @code{xf86-input-keyboard}, and so on. -@var{fonts} must be a list of font directories to add to the server's -@dfn{font path}. +@item @code{drivers} (default: @code{'()}) +This must be either the empty list, in which case Xorg chooses a graphics +driver automatically, or a list of driver names that will be tried in this +order---e.g., @code{("modesetting" "vesa")}. -@var{drivers} must be either the empty list, in which case Xorg chooses a -graphics driver automatically, or a list of driver names that will be tried in -this order---e.g., @code{("modesetting" "vesa")}. +@item @code{resolutions} (default: @code{'()}) +When @code{resolutions} is the empty list, Xorg chooses an appropriate screen +resolution. Otherwise, it must be a list of resolutions---e.g., @code{((1024 +768) (640 480))}. -Likewise, when @var{resolutions} is the empty list, Xorg chooses an -appropriate screen resolution; otherwise, it must be a list of -resolutions---e.g., @code{((1024 768) (640 480))}. +@item @code{extra-config} (default: @code{'()}) +This is a list of strings or objects appended to the configuration file. It +is used to pass extra text to be added verbatim to the configuration file. -Last, @var{extra-config} is a list of strings or objects appended to the -configuration file. It is used to pass extra text to be -added verbatim to the configuration file. +@item @code{server} (default: @code{xorg-server}) +This is the package providing the Xorg server. -@cindex keymap -@cindex keyboard layout -This procedure is especially useful to configure a different keyboard layout -than the default US keymap. For instance, to use the ``bépo'' keymap by -default on the display manager: +@item @code{server-arguments} (default: @code{%default-xorg-server-arguments}) +This is the list of command-line arguments to pass to the X server. The +default is @code{-nolisten tcp}. +@end table +@end deftp -@example -(define bepo-evdev - "Section \"InputClass\" - Identifier \"evdev keyboard catchall\" - Driver \"evdev\" - MatchIsKeyboard \"on\" - Option \"xkb_layout\" \"fr\" - Option \"xkb_variant\" \"bepo\" -EndSection") +@deffn {Scheme Procedure} xorg-start-command [@var{config}] +Return a @code{startx} script in which the modules, fonts, etc. specified +in @var{config}, are available. The result should be used in place of +@code{startx}. -(operating-system - ... - (services - (modify-services %desktop-services - (slim-service-type config => - (slim-configuration - (inherit config) - (startx (xorg-start-command - #:configuration-file - (xorg-configuration-file - #:extra-config - (list bepo-evdev))))))))) -@end example - -The @code{MatchIsKeyboard} line specifies that we only apply the configuration -to keyboards. Without this line, other devices such as touchpad may not work -correctly because they will be attached to the wrong driver. In this example, -the user typically used @code{setxkbmap fr bepo} to set their favorite keymap -once logged in. The first argument corresponds to the layout, while the second -argument corresponds to the variant. The @code{xkb_variant} line can be omitted -to select the default variant. +Usually the X server is started by a login manager. @end deffn + @deffn {Scheme Procedure} screen-locker-service @var{package} [@var{program}] 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 diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 8381a7ed04..3c547c1303 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -48,7 +48,16 @@ #:use-module (srfi srfi-9) #:use-module (srfi srfi-26) #:use-module (ice-9 match) - #:export (xorg-configuration-file + #:export (xorg-configuration + xorg-configuration? + xorg-configuration-modules + xorg-configuration-fonts + xorg-configuration-drivers + xorg-configuration-resolutions + xorg-configuration-extra-config + xorg-configuration-server + xorg-configuration-server-arguments + %default-xorg-modules %default-xorg-fonts xorg-wrapper @@ -122,33 +131,36 @@ "/share/fonts/X11/misc") (file-append font-adobe75dpi "/share/fonts/X11/75dpi"))) -(define* (xorg-configuration-file #:key - (modules %default-xorg-modules) - (fonts %default-xorg-fonts) - (drivers '()) (resolutions '()) - (extra-config '())) - "Return a configuration file for the Xorg server containing search paths for -all the common drivers. - -@var{modules} must be a list of @dfn{module packages} loaded by the Xorg -server---e.g., @code{xf86-video-vesa}, @code{xf86-input-keyboard}, and so on. -@var{fonts} must be a list of font directories to add to the server's -@dfn{font path}. - -@var{drivers} must be either the empty list, in which case Xorg chooses a -graphics driver automatically, or a list of driver names that will be tried in -this order---e.g., @code{(\"modesetting\" \"vesa\")}. - -Likewise, when @var{resolutions} is the empty list, Xorg chooses an -appropriate screen resolution; otherwise, it must be a list of -resolutions---e.g., @code{((1024 768) (640 480))}. - -Last, @var{extra-config} is a list of strings or objects appended to the -configuration file. It is used to pass extra text to be -added verbatim to the configuration file." +(define %default-xorg-server-arguments + ;; Default command-line arguments for X. + '("-nolisten" "tcp")) + +;; Configuration of an Xorg server. +(define-record-type* + xorg-configuration make-xorg-configuration + xorg-configuration? + (modules xorg-configuration-modules ;list of packages + (default %default-xorg-modules)) + (fonts xorg-configuration-fonts ;list of packges + (default %default-xorg-fonts)) + (drivers xorg-configuration-drivers ;list of strings + (default '())) + (resolutions xorg-configuration-resolutions ;list of tuples + (default '())) + (extra-config xorg-configuration-extra-config ;list of strings + (default '())) + (server xorg-configuration-server ;package + (default xorg-server)) + (server-arguments xorg-configuration-server-arguments ;list of strings + (default %default-xorg-server-arguments))) + +(define (xorg-configuration->file config) + "Compute an Xorg configuration file corresponding to CONFIG, an + record." (define all-modules ;; 'xorg-server' provides 'fbdevhw.so' etc. - (append modules (list xorg-server))) + (append (xorg-configuration-modules config) + (list xorg-server))) (define build #~(begin @@ -159,7 +171,7 @@ added verbatim to the configuration file." (call-with-output-file #$output (lambda (port) (define drivers - '#$drivers) + '#$(xorg-configuration-drivers config)) (define (device-section driver) (string-append " @@ -201,7 +213,7 @@ EndSection")) (display "Section \"Files\"\n" port) (for-each (lambda (font) (format port " FontPath \"~a\"~%" font)) - '#$fonts) + '#$(xorg-configuration-fonts config)) (for-each (lambda (module) (format port " ModulePath \"~a\"~%" @@ -221,7 +233,8 @@ EndSection\n" port) port) (newline port) (display (string-join - (map (cut screen-section <> '#$resolutions) + (map (cut screen-section <> + '#$(xorg-configuration-resolutions config)) drivers) "\n") port) @@ -229,11 +242,10 @@ EndSection\n" port) (for-each (lambda (config) (display config port)) - '#$extra-config))))) + '#$(xorg-configuration-extra-config config)))))) (computed-file "xserver.conf" build)) - (define (xorg-configuration-directory modules) "Return a directory that contains the @code{.conf} files for X.org that includes the @code{share/X11/xorg.conf.d} directories of each package listed @@ -260,51 +272,38 @@ in @var{modules}." files) #t)))) -(define* (xorg-wrapper #:key - (modules %default-xorg-modules) - (configuration-file (xorg-configuration-file - #:modules modules)) - (xorg-server xorg-server)) - "Return a derivation that builds a @var{guile} script to start the X server -from @var{xorg-server}. @var{configuration-file} is the server configuration -file or a derivation that builds it; when omitted, the result of -@code{xorg-configuration-file} is used. The resulting script should be used -in place of @code{/usr/bin/X}." +(define* (xorg-wrapper #:optional (config (xorg-configuration))) + "Return a derivation that builds a script to start the X server with the +given @var{config}. The resulting script should be used in place of +@code{/usr/bin/X}." (define exp ;; Write a small wrapper around the X server. #~(begin (setenv "XORG_DRI_DRIVER_PATH" (string-append #$mesa "/lib/dri")) (setenv "XKB_BINDIR" (string-append #$xkbcomp "/bin")) - (let ((X (string-append #$xorg-server "/bin/X"))) + (let ((X (string-append #$(xorg-configuration-server config) "/bin/X"))) (apply execl X X "-xkbdir" (string-append #$xkeyboard-config "/share/X11/xkb") - "-config" #$configuration-file - "-configdir" #$(xorg-configuration-directory modules) + "-config" #$(xorg-configuration->file config) + "-configdir" #$(xorg-configuration-directory + (xorg-configuration-modules config)) (cdr (command-line)))))) (program-file "X-wrapper" exp)) -(define* (xorg-start-command #:key - (modules %default-xorg-modules) - (fonts %default-xorg-fonts) - (configuration-file - (xorg-configuration-file #:modules modules - #:fonts fonts)) - (xorg-server xorg-server) - (xserver-arguments '("-nolisten" "tcp"))) - "Return a @code{startx} script in which @var{modules}, a list of X module -packages, and @var{fonts}, a list of X font directories, are available. See -@code{xorg-wrapper} for more details on the arguments. The result should be -used in place of @code{startx}." +(define* (xorg-start-command #:optional (config (xorg-configuration))) + "Return a @code{startx} script in which the modules, fonts, etc. specified +in @var{config}, are available. The result should be used in place of +@code{startx}." (define X - (xorg-wrapper #:configuration-file configuration-file - #:modules modules - #:xorg-server xorg-server)) + (xorg-wrapper config)) + (define exp ;; Write a small wrapper around the X server. #~(apply execl #$X #$X ;; Second #$X is for argv[0]. - "-logverbose" "-verbose" "-terminate" #$@xserver-arguments + "-logverbose" "-verbose" "-terminate" + #$@(xorg-configuration-server-arguments config) (cdr (command-line)))) (program-file "startx" exp)) -- cgit v1.2.3 From 554b8607396785dcde6eb391f75f98a07ec582fd Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 19 Mar 2019 21:26:33 +0100 Subject: services: sddm, slim, gdm: Take an record. * gnu/services/sddm.scm ()[xorg-server-path] [xserver-arguments]: Remove. [xorg-configuration]: New field. (sddm-configuration-file): Adjust accordingly. * gnu/services/xorg.scm ()[startx]: Remove. [xorg-configuration]: New field. (slim-shepherd-service, slim-service): Adjust accordingly. ()[x-server]: Remove. [xorg-configuration]: New field. (gdm-shepherd-service, gdm-service): Adjust accordingly. * doc/guix.texi (X Window): Update accordingly. --- doc/guix.texi | 11 ++++------- gnu/services/sddm.scm | 14 ++++++++------ gnu/services/xorg.scm | 19 +++++++++---------- 3 files changed, 21 insertions(+), 23 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index b49f651562..5511aaaf57 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13223,8 +13223,8 @@ your user profile. Failing to do that, if @code{auto-login-session} is false, you will be unable to log in. @end quotation -@item @code{startx} (default: @code{(xorg-start-command)}) -The command used to start the X11 graphical server. +@item @code{xorg-configuration} (default @code{(xorg-configuration)}) +Configuration of the Xorg graphical server. @item @code{xauth} (default: @code{xauth}) The XAuth package to use. @@ -13300,8 +13300,8 @@ Script to run before starting a wayland session. @item @code{sessions-directory} (default "/run/current-system/profile/share/wayland-sessions") Directory to look for desktop files starting wayland sessions. -@item @code{xorg-server-path} (default @code{xorg-start-command}) -Path to xorg-server. +@item @code{xorg-configuration} (default @code{(xorg-configuration)}) +Configuration of the Xorg graphical server. @item @code{xauth-path} (default @code{#~(string-append #$xauth "/bin/xauth")}) Path to xauth. @@ -13324,9 +13324,6 @@ Directory to look for desktop files starting X sessions. @item @code{minimum-vt} (default: 7) Minimum VT to use. -@item @code{xserver-arguments} (default "-nolisten tcp") -Arguments to pass to xorg-server. - @item @code{auto-login-user} (default "") User to use for auto-login. diff --git a/gnu/services/sddm.scm b/gnu/services/sddm.scm index 2ebfe22016..a33eb39c43 100644 --- a/gnu/services/sddm.scm +++ b/gnu/services/sddm.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 David Craven +;;; Copyright © 2019 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -83,8 +84,8 @@ (sessions-directory sddm-configuration-sessions-directory (default "/run/current-system/profile/share/wayland-sessions")) ;; [X11] - (xorg-server-path sddm-configuration-xorg-server-path - (default (xorg-start-command))) + (xorg-configuration sddm-configuration-xorg + (default (xorg-configuration))) (xauth-path sddm-configuration-xauth-path (default (file-append xauth "/bin/xauth"))) (xephyr-path sddm-configuration-xephyr-path @@ -99,8 +100,6 @@ (default "/run/current-system/profile/share/xsessions")) (minimum-vt sddm-configuration-minimum-vt (default 7)) - (xserver-arguments sddm-configuration-xserver-arguments - (default "-nolisten tcp")) ;; [Autologin] (auto-login-user sddm-configuration-auto-login-user @@ -140,7 +139,8 @@ SessionCommand=" (sddm-configuration-session-command config) " SessionDir=" (sddm-configuration-sessions-directory config) " [X11] -ServerPath=" (sddm-configuration-xorg-server-path config) " +ServerPath=" (xorg-configuration-server + (sddm-configuration-xorg config)) " XauthPath=" (sddm-configuration-xauth-path config) " XephyrPath=" (sddm-configuration-xephyr-path config) " DisplayCommand=" (sddm-configuration-xdisplay-start config) " @@ -148,7 +148,9 @@ DisplayStopCommand=" (sddm-configuration-xdisplay-stop config) " SessionCommand=" (sddm-configuration-xsession-command config) " SessionDir=" (sddm-configuration-xsessions-directory config) " MinimumVT=" (number->string (sddm-configuration-minimum-vt config)) " -ServerArguments=" (sddm-configuration-xserver-arguments config) " +ServerArguments=" (string-join + (xorg-configuration-server-arguments + (sddm-configuration-xorg config))) " [Autologin] User=" (sddm-configuration-auto-login-user config) " diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 3c547c1303..a3a4d769d7 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -436,8 +436,8 @@ desktop session from the system or user profile will be used." (default shepherd)) (auto-login-session slim-configuration-auto-login-session (default #f)) - (startx slim-configuration-startx - (default (xorg-start-command))) + (xorg-configuration slim-configuration-xorg + (default (xorg-configuration))) (sessreg slim-configuration-sessreg (default sessreg))) @@ -454,7 +454,7 @@ desktop session from the system or user profile will be used." (slim-configuration-auto-login-session config))) (slim (slim-configuration-slim config)) (xauth (slim-configuration-xauth config)) - (startx (slim-configuration-startx config)) + (startx (xorg-start-command (slim-configuration-xorg config))) (shepherd (slim-configuration-shepherd config)) (theme-name (slim-configuration-theme-name config)) (sessreg (slim-configuration-sessreg config))) @@ -561,8 +561,7 @@ theme." (auto-login? auto-login?) (default-user default-user) (theme theme) (theme-name theme-name) (xauth xauth) (shepherd shepherd) - (auto-login-session auto-login-session) - (startx startx)))) + (auto-login-session auto-login-session)))) ;;; @@ -641,8 +640,8 @@ makes the good ol' XlockMore usable." (default-user gdm-configuration-default-user (default #f)) (gnome-shell-assets gdm-configuration-gnome-shell-assets (default (list adwaita-icon-theme font-cantarell))) - (x-server gdm-configuration-x-server - (default (xorg-wrapper))) + (xorg-configuration gdm-configuration-xorg + (default (xorg-configuration))) (x-session gdm-configuration-x-session (default (xinitrc)))) @@ -714,7 +713,8 @@ makes the good ol' XlockMore usable." #$(gdm-configuration-dbus-daemon config)) (string-append "GDM_X_SERVER=" - #$(gdm-configuration-x-server config)) + #$(xorg-wrapper + (gdm-configuration-xorg config))) (string-append "GDM_X_SESSION=" #$(gdm-configuration-x-session config)) @@ -779,7 +779,6 @@ password." (service gdm-service-type (gdm-configuration (gdm gdm) - (allow-empty-passwords? allow-empty-passwords?) - (x-server x-server)))) + (allow-empty-passwords? allow-empty-passwords?)))) ;;; xorg.scm ends here -- cgit v1.2.3 From 598757e038ab5dea3b59c9c248a2ad860c41fe62 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 19 Mar 2019 21:34:02 +0100 Subject: services: xorg: Add a 'keyboard-layout' field in . * gnu/services/xorg.scm ()[keyboard-layout]: New field. (xorg-configuration->file)[input-class-section]: New procedure. Use it. * doc/guix.texi (X Window): Document 'keyboard-layout' field. Co-authored-by: nee --- doc/guix.texi | 9 +++++++++ gnu/services/xorg.scm | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 5511aaaf57..4a8b66703d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13374,6 +13374,15 @@ When @code{resolutions} is the empty list, Xorg chooses an appropriate screen resolution. Otherwise, it must be a list of resolutions---e.g., @code{((1024 768) (640 480))}. +@cindex keyboard layout, for Xorg +@cindex keymap, for Xorg +@item @code{keyboard-layout} (default: @code{#f}) +If this is @code{#f}, Xorg uses the default keyboard layout---usually US +English (``qwerty'') for a 105-key PC keyboard. + +Otherwise this must be a @code{keyboard-layout} object specifying the keyboard +layout in use when Xorg is running. + @item @code{extra-config} (default: @code{'()}) This is a list of strings or objects appended to the configuration file. It is used to pass extra text to be added verbatim to the configuration file. diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index a3a4d769d7..05465f3bdf 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -25,6 +25,7 @@ #:use-module (gnu services) #:use-module (gnu services shepherd) #:use-module (gnu system pam) + #:use-module (gnu system keyboard) #:use-module (gnu services dbus) #:use-module ((gnu packages base) #:select (canonical-package)) #:use-module (gnu packages guile) @@ -147,6 +148,8 @@ (default '())) (resolutions xorg-configuration-resolutions ;list of tuples (default '())) + (keyboard-layout xorg-configuration-keyboard-layout ;#f | + (default #f)) (extra-config xorg-configuration-extra-config ;list of strings (default '())) (server xorg-configuration-server ;package @@ -195,6 +198,31 @@ Section \"Screen\" EndSubSection EndSection")) + (define (input-class-section layout variant model options) + (string-append " +Section \"InputClass\" + Identifier \"evdev keyboard catchall\" + MatchIsKeyboard \"on\" + Option \"XkbLayout\" " (object->string layout) + (if variant + (string-append " Option \"XkbVariant\" \"" + variant "\"") + "") + (if model + (string-append " Option \"XkbModel\" \"" + model "\"") + "") + (match options + (() + "") + (_ + (string-append " Option \"XkbOptions\" \"" + (string-join options ",") "\""))) " + + MatchDevicePath \"/dev/input/event*\" + Driver \"evdev\" +EndSection\n")) + (define (expand modules) ;; Append to MODULES the relevant /lib/xorg/modules ;; sub-directories. @@ -240,6 +268,19 @@ EndSection\n" port) port) (newline port) + (let ((layout #$(and=> (xorg-configuration-keyboard-layout config) + keyboard-layout-name)) + (variant #$(and=> (xorg-configuration-keyboard-layout config) + keyboard-layout-variant)) + (model #$(and=> (xorg-configuration-keyboard-layout config) + keyboard-layout-model)) + (options '#$(keyboard-layout-options + (xorg-configuration-keyboard-layout config)))) + (when layout + (display (input-class-section layout variant model options) + port) + (newline port))) + (for-each (lambda (config) (display config port)) '#$(xorg-configuration-extra-config config)))))) -- cgit v1.2.3 From 70bb83b7b29ba9d5eb151aa2748717f182a25534 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 25 Mar 2019 00:20:42 +0100 Subject: services: xorg: Fix cases where 'keyboard-layout' is #f. This is a followup to 598757e038ab5dea3b59c9c248a2ad860c41fe62. * gnu/services/xorg.scm (xorg-configuration->file): Check whether 'xorg-configuration-keyboard-layout' returns #f before calling 'keyboard-layout-options'. --- gnu/services/xorg.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 05465f3bdf..f047b8a043 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -274,8 +274,8 @@ EndSection\n" port) keyboard-layout-variant)) (model #$(and=> (xorg-configuration-keyboard-layout config) keyboard-layout-model)) - (options '#$(keyboard-layout-options - (xorg-configuration-keyboard-layout config)))) + (options '#$(and=> (xorg-configuration-keyboard-layout config) + keyboard-layout-options))) (when layout (display (input-class-section layout variant model options) port) -- cgit v1.2.3 From b283d5f6308154b42a8656f370c97168726b2ab5 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Mon, 25 Mar 2019 17:40:45 +0100 Subject: services: SDDM: Specify absolute path to the X server. I'm not sure how this service ever worked, but SDDM started consistently failing on one machine seemingly because of this setting. * gnu/services/sddm.scm (sddm-configuration-file): Append /bin/X to the ServerPath setting. --- gnu/services/sddm.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/sddm.scm b/gnu/services/sddm.scm index a33eb39c43..43b34a38d9 100644 --- a/gnu/services/sddm.scm +++ b/gnu/services/sddm.scm @@ -140,7 +140,7 @@ SessionDir=" (sddm-configuration-sessions-directory config) " [X11] ServerPath=" (xorg-configuration-server - (sddm-configuration-xorg config)) " + (sddm-configuration-xorg config)) "/bin/X" " XauthPath=" (sddm-configuration-xauth-path config) " XephyrPath=" (sddm-configuration-xephyr-path config) " DisplayCommand=" (sddm-configuration-xdisplay-start config) " -- cgit v1.2.3 From ee05cc7fe353c1c9b45062343746ac215a29fed5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 27 Mar 2019 10:14:11 +0100 Subject: services: Deprecate 'gnome-desktop-service'. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/desktop.scm (gnome-desktop-service-type)[default-value]: New field. (gnome-desktop-service): Deprecate. * gnu/installer/services.scm (%desktop-environments): Use the (service …) form for GNOME. * gnu/system/examples/desktop.tmpl: Likewise. * doc/guix.texi (Desktop Services): Adjust accordingly. --- doc/guix.texi | 28 ++++++++++++++++++++-------- gnu/installer/services.scm | 2 +- gnu/services/desktop.scm | 5 ++++- gnu/system/examples/desktop.tmpl | 2 +- 4 files changed, 26 insertions(+), 11 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 7d80c00530..d99b7fd933 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14420,7 +14420,7 @@ The @var{%desktop-services} variable can be used as the @code{services} field of an @code{operating-system} declaration (@pxref{operating-system Reference, @code{services}}). -Additionally, the @code{gnome-desktop-service}, +Additionally, the @code{gnome-desktop-service-type}, @code{xfce-desktop-service}, @code{mate-desktop-service-type} and @code{enlightenment-desktop-service-type} procedures can add GNOME, XFCE, MATE and/or Enlightenment to a system. To ``add GNOME'' means that system-level @@ -14428,7 +14428,7 @@ services like the backlight adjustment helpers and the power management utilities are added to the system, extending @code{polkit} and @code{dbus} appropriately, allowing GNOME to operate with elevated privileges on a limited number of special-purpose system interfaces. Additionally, -adding a service made by @code{gnome-desktop-service} adds the GNOME +adding a service made by @code{gnome-desktop-service-type} adds the GNOME metapackage to the system profile. Likewise, adding the XFCE service not only adds the @code{xfce} metapackage to the system profile, but it also gives the Thunar file manager the ability to open a ``root-mode'' @@ -14452,11 +14452,23 @@ also try starting GNOME on Wayland manually from a TTY with the command ``XDG_SESSION_TYPE=wayland exec dbus-run-session gnome-session``. Currently only GNOME has support for Wayland. -@deffn {Scheme Procedure} gnome-desktop-service -Return a service that adds the @code{gnome} package to the system -profile, and extends polkit with the actions from -@code{gnome-settings-daemon}. -@end deffn +@defvr {Scheme Variable} gnome-desktop-service-type +This is the type of the service that adds the @uref{https://www.gnome.org, +GNOME} desktop environment. Its value is a @code{gnome-desktop-configuration} +object (see below.) + +This service adds the @code{gnome} package to the system profile, and extends +polkit with the actions from @code{gnome-settings-daemon}. +@end defvr + +@deftp {Data Type} gnome-desktop-configuration +Configuration record for the GNOME desktop environment. + +@table @asis +@item @code{gnome} (default @code{gnome}) +The GNOME package to use. +@end table +@end deftp @deffn {Scheme Procedure} xfce-desktop-service Return a service that adds the @code{xfce} package to the system profile, @@ -14508,7 +14520,7 @@ them by default. To add GNOME, XFCE or MATE, just @code{cons} them onto (operating-system ... ;; cons* adds items to the list given as its last argument. - (services (cons* (gnome-desktop-service) + (services (cons* (service gnome-desktop-service-type) (xfce-desktop-service) %desktop-services)) ...) diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm index f263ecc84f..e719da083d 100644 --- a/gnu/installer/services.scm +++ b/gnu/installer/services.scm @@ -38,7 +38,7 @@ (list (desktop-environment (name "GNOME") - (snippet '(gnome-desktop-service))) + (snippet '(service gnome-desktop-service-type))) (desktop-environment (name "Xfce") (snippet '(xfce-desktop-service))) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index b912c208cc..9c9472e1a2 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -884,9 +884,12 @@ rules." (service-extension profile-service-type (compose list gnome-package)))) + (default-value (gnome-desktop-configuration)) (description "Run the GNOME desktop environment."))) -(define* (gnome-desktop-service #:key (config (gnome-desktop-configuration))) +(define-deprecated (gnome-desktop-service #:key (config + (gnome-desktop-configuration))) + gnome-desktop-service-type "Return a service that adds the @code{gnome} package to the system profile, and extends polkit with the actions from @code{gnome-settings-daemon}." (service gnome-desktop-service-type config)) diff --git a/gnu/system/examples/desktop.tmpl b/gnu/system/examples/desktop.tmpl index bc5cbd6e6b..fe32bc58b5 100644 --- a/gnu/system/examples/desktop.tmpl +++ b/gnu/system/examples/desktop.tmpl @@ -57,7 +57,7 @@ ;; screen with F1. Use the "desktop" services, which ;; include the X11 log-in service, networking with ;; NetworkManager, and more. - (services (append (list (gnome-desktop-service) + (services (append (list (service gnome-desktop-service-type) (xfce-desktop-service)) %desktop-services)) -- cgit v1.2.3 From 391e0d65d7129d53c025963d2758724e75626eb4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 27 Mar 2019 10:41:14 +0100 Subject: services: Deprecate 'xfce-desktop-service'. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/desktop.scm (xfce-desktop-service-type)[default-value] [description]: New fields. (xfce-desktop-service): Deprecate. * gnu/system/examples/desktop.tmpl: Use the (service …) form. * gnu/installer/services.scm (%desktop-environments): Add TODO comment. * doc/guix.texi (Desktop Services): Adjust accordingly, and fix spelling of "Xfce" throughout. --- doc/guix.texi | 37 +++++++++++++++++++++++++------------ gnu/installer/services.scm | 2 ++ gnu/services/desktop.scm | 9 ++++++--- gnu/system/examples/desktop.tmpl | 2 +- 4 files changed, 34 insertions(+), 16 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index d99b7fd933..1bbed7a72d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14395,7 +14395,7 @@ The @code{(gnu services desktop)} module provides services that are usually useful in the context of a ``desktop'' setup---that is, on a machine running a graphical display server, possibly with graphical user interfaces, etc. It also defines services that provide specific desktop -environments like GNOME, XFCE or MATE. +environments like GNOME, Xfce or MATE. To simplify things, the module defines a variable containing the set of services that users typically expect on a machine with a graphical @@ -14422,14 +14422,14 @@ Reference, @code{services}}). Additionally, the @code{gnome-desktop-service-type}, @code{xfce-desktop-service}, @code{mate-desktop-service-type} and -@code{enlightenment-desktop-service-type} procedures can add GNOME, XFCE, MATE +@code{enlightenment-desktop-service-type} procedures can add GNOME, Xfce, MATE and/or Enlightenment to a system. To ``add GNOME'' means that system-level services like the backlight adjustment helpers and the power management utilities are added to the system, extending @code{polkit} and @code{dbus} appropriately, allowing GNOME to operate with elevated privileges on a limited number of special-purpose system interfaces. Additionally, adding a service made by @code{gnome-desktop-service-type} adds the GNOME -metapackage to the system profile. Likewise, adding the XFCE service +metapackage to the system profile. Likewise, adding the Xfce service not only adds the @code{xfce} metapackage to the system profile, but it also gives the Thunar file manager the ability to open a ``root-mode'' file management window, if the user authenticates using the @@ -14470,12 +14470,25 @@ The GNOME package to use. @end table @end deftp -@deffn {Scheme Procedure} xfce-desktop-service -Return a service that adds the @code{xfce} package to the system profile, -and extends polkit with the ability for @code{thunar} to manipulate the -file system as root from within a user session, after the user has -authenticated with the administrator's password. -@end deffn +@defvr {Scheme Variable} xfce-desktop-service-type +This is the type of a service to run the @uref{Xfce, https://xfce.org/} +desktop environment. Its value is an @code{xfce-desktop-configuration} object +(see below.) + +This service that adds the @code{xfce} package to the system profile, and +extends polkit with the ability for @code{thunar} to manipulate the file +system as root from within a user session, after the user has authenticated +with the administrator's password. +@end defvr + +@deftp {Data Type} xfce-desktop-configuration +Configuration record for the Xfce desktop environment. + +@table @asis +@item @code{xfce} (default @code{xfce}) +The Xfce package to use. +@end table +@end deftp @deffn {Scheme Variable} mate-desktop-service-type This is the type of the service that runs the @uref{https://mate-desktop.org/, @@ -14508,9 +14521,9 @@ The enlightenment package to use. @end table @end deftp -Because the GNOME, XFCE and MATE desktop services pull in so many packages, +Because the GNOME, Xfce and MATE desktop services pull in so many packages, the default @code{%desktop-services} variable doesn't include any of -them by default. To add GNOME, XFCE or MATE, just @code{cons} them onto +them by default. To add GNOME, Xfce or MATE, just @code{cons} them onto @code{%desktop-services} in the @code{services} field of your @code{operating-system}: @@ -14521,7 +14534,7 @@ them by default. To add GNOME, XFCE or MATE, just @code{cons} them onto ... ;; cons* adds items to the list given as its last argument. (services (cons* (service gnome-desktop-service-type) - (xfce-desktop-service) + (service xfce-desktop-service) %desktop-services)) ...) @end example diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm index e719da083d..2b6625f6af 100644 --- a/gnu/installer/services.scm +++ b/gnu/installer/services.scm @@ -41,6 +41,8 @@ (snippet '(service gnome-desktop-service-type))) (desktop-environment (name "Xfce") + ;; TODO: Use 'xfce-desktop-service-type' when the 'guix' package provides + ;; it with a default value. (snippet '(xfce-desktop-service))) (desktop-environment (name "MATE") diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 9c9472e1a2..da6291036f 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -945,10 +945,13 @@ and extends polkit with the actions from @code{mate-settings-daemon}." "thunar") xfce-package)) (service-extension profile-service-type - (compose list - xfce-package)))))) + (compose list xfce-package)))) + (default-value (xfce-desktop-configuration)) + (description "Run the Xfce desktop environment."))) -(define* (xfce-desktop-service #:key (config (xfce-desktop-configuration))) +(define-deprecated (xfce-desktop-service #:key (config + (xfce-desktop-configuration))) + xfce-desktop-service-type "Return a service that adds the @code{xfce} package to the system profile, and extends polkit with the ability for @code{thunar} to manipulate the file system as root from within a user session, after the user has authenticated diff --git a/gnu/system/examples/desktop.tmpl b/gnu/system/examples/desktop.tmpl index fe32bc58b5..d0e3ff56e8 100644 --- a/gnu/system/examples/desktop.tmpl +++ b/gnu/system/examples/desktop.tmpl @@ -58,7 +58,7 @@ ;; include the X11 log-in service, networking with ;; NetworkManager, and more. (services (append (list (service gnome-desktop-service-type) - (xfce-desktop-service)) + (service xfce-desktop-service)) %desktop-services)) ;; Allow resolution of '.local' host names with mDNS. -- cgit v1.2.3 From 357b287b8f083e8b078da4a3246e0bad4ef199ac Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 28 Mar 2019 23:03:11 +0100 Subject: services: desktop: Switch to GDM. * gnu/services/desktop.scm (%desktop-services): Replace SLIM-SERVICE-TYPE instance with an instance of GDM-SERVICE-TYPE. * doc/guix.texi (Keyboard Layout): Change example to mention GDM-SERVICE-TYPE. (X Window): Mention GDM. (Desktop Services): Adjust references to SLiM. --- doc/guix.texi | 18 ++++++++++++------ gnu/services/desktop.scm | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 1bbed7a72d..525b8f424f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11090,8 +11090,8 @@ configuration would look like: (target "/boot/efi") (keyboard-layout keyboard-layout))) ;for GRUB (services (modify-services %desktop-services - (slim-service-type config => - (slim-configuration + (gdm-service-type config => + (gdm-configuration (inherit config) (xorg-configuration (xorg-configuration ;for Xorg @@ -13294,7 +13294,13 @@ Package object of the Open vSwitch. Support for the X Window graphical display system---specifically Xorg---is provided by the @code{(gnu services xorg)} module. Note that there is no @code{xorg-service} procedure. Instead, the X server is -started by the @dfn{login manager}, by default SLiM. +started by the @dfn{login manager}, by default the GNOME Display Manager (GDM). + +@cindex GDM +@cindex GNOME, login manager +GDM of course allows users to log in into window managers and desktop +environments other than GNOME; for those using GNOME, GDM is required for +features such as automatic screen locking. @cindex window manager To use X11, you must install at least one @dfn{window manager}---for @@ -14406,7 +14412,7 @@ This is a list of services that builds upon @var{%base-services} and adds or adjusts services for a typical ``desktop'' setup. In particular, it adds a graphical login manager (@pxref{X Window, -@code{slim-service}}), screen lockers, a network management tool +@code{gdm-service-type}}), screen lockers, a network management tool (@pxref{Networking Services, @code{network-manager-service-type}}), energy and color management services, the @code{elogind} login and seat manager, the Polkit privilege service, the GeoClue location service, the @@ -14445,8 +14451,8 @@ functionality to work as expetected. The desktop environments in Guix use the Xorg display server by default. If you'd like to use the newer display server protocol -called Wayland, you need to use the @code{sddm-service} instead of the -@code{slim-service} for the graphical login manager. You should then +called Wayland, you need to use the @code{sddm-service} instead of +GDM as the graphical login manager. You should then select the ``GNOME (Wayland)'' session in SDDM. Alternatively you can also try starting GNOME on Wayland manually from a TTY with the command ``XDG_SESSION_TYPE=wayland exec dbus-run-session diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index da6291036f..dcab950822 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -1078,7 +1078,7 @@ dispatches events from it."))) (define %desktop-services ;; List of services typically useful for a "desktop" use case. - (cons* (service slim-service-type) + (cons* (service gdm-service-type) ;; Screen lockers are a pretty useful thing and these are small. (screen-locker-service slock) -- cgit v1.2.3 From e73ded3c71527412944bb9a97916a096742f695d Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Mon, 25 Mar 2019 00:17:41 +0100 Subject: services: Open vSwitch: Provide a default configuration. * gnu/services/networking.scm (openvswitch-service-type): Provide OPENVSWITCH-CONFIGURATION as a default value. * gnu/tests/networking.scm (%openvswitch-os): Don't configure the service. --- gnu/services/networking.scm | 3 ++- gnu/tests/networking.scm | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index cab129e0c3..5fbbf25789 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1154,7 +1154,8 @@ implements authentication, key negotiation and more for wireless networks.") (description "Run @uref{http://www.openvswitch.org, Open vSwitch}, a multilayer virtual switch designed to enable massive network automation through programmatic -extension."))) +extension.") + (default-value (openvswitch-configuration)))) ;;; ;;; iptables diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index a97b29bc4b..d1234442bb 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -178,9 +178,7 @@ port 7, and a dict service on port 2628." (static-networking-service "ovs0" "10.1.1.1" #:netmask "255.255.255.252" #:requirement '(openvswitch-configuration)) - (service openvswitch-service-type - (openvswitch-configuration - (package openvswitch))) + (service openvswitch-service-type) openvswitch-configuration-service)) (define (run-openvswitch-test) -- cgit v1.2.3 From 631a6e63777dd2e08fe5bdc75908e6c030abcd1f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 31 Mar 2019 23:13:51 +0200 Subject: doc: Document 'gdm-service-type'. * doc/guix.texi (X Window): Document 'gdm-service-type' and 'gdm-configuration'. Take description of '.desktop' files from the 'slim-service-type' description. * gnu/services/xorg.scm (gdm-service): Remove outdated comment. --- doc/guix.texi | 52 +++++++++++++++++++++++++++++++++++++++++++-------- gnu/services/xorg.scm | 3 --- 2 files changed, 44 insertions(+), 11 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 527f9bcd10..616970b505 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13304,23 +13304,59 @@ example the @code{windowmaker} or @code{openbox} packages---preferably by adding it to the @code{packages} field of your operating system definition (@pxref{operating-system Reference, system-wide packages}). -@defvr {Scheme Variable} slim-service-type -This is the type for the SLiM graphical login manager for X11. +@defvr {Scheme Variable} gdm-service-type +This is the type for the @uref{https://wiki.gnome.org/Projects/GDM/, GNOME +Desktop Manager} (GDM), a program that manages graphical display servers and +handles graphical user logins. Its value must be a @code{gdm-configuration} +(see below.) @cindex session types (X11) @cindex X11 session types -SLiM looks for @dfn{session types} described by the @file{.desktop} files in -@file{/run/current-system/profile/share/xsessions} and allows users to -choose a session from the log-in screen using @kbd{F1}. Packages such -as @code{xfce}, @code{sawfish}, and @code{ratpoison} provide -@file{.desktop} files; adding them to the system-wide set of packages -automatically makes them available at the log-in screen. +GDM looks for @dfn{session types} described by the @file{.desktop} files in +@file{/run/current-system/profile/share/xsessions} and allows users to choose +a session from the log-in screen. Packages such as @code{gnome}, @code{xfce}, +and @code{i3} provide @file{.desktop} files; adding them to the system-wide +set of packages automatically makes them available at the log-in screen. In addition, @file{~/.xsession} files are honored. When available, @file{~/.xsession} must be an executable that starts a window manager and/or other X clients. @end defvr +@deftp {Data Type} gdm-configuration +@table @asis +@item @code{auto-login?} (default: @code{#f}) +@itemx @code{default-user} (default: @code{#f}) +When @code{auto-login?} is false, GDM presents a log-in screen. + +When @code{auto-login?} is true, GDM logs in directly as +@code{default-user}. + +@item @code{gnome-shell-assets} (default: ...) +List of GNOME Shell assets needed by GDM: icon theme, fonts, etc. + +@item @code{xorg-configuration} (default: @code{(xorg-configuration)}) +Configuration of the Xorg graphical server. + +@item @code{xsession} (default: @code{(xinitrc)}) +Script to run before starting a X session. + +@item @code{dbus-daemon} (default: @code{dbus-daemon-wrapper}) +File name of the @code{dbus-daemon} executable. + +@item @code{gdm} (default: @code{gdm}) +The GDM package to use. +@end table +@end deftp + +@defvr {Scheme Variable} slim-service-type +This is the type for the SLiM graphical login manager for X11. + +Like GDM, SLiM looks for session types described by @file{.desktop} files and +allows users to choose a session from the log-in screen using @kbd{F1}. It +also honors @file{~/.xsession} files. +@end defvr + @deftp {Data Type} slim-configuration Data type representing the configuration of @code{slim-service-type}. diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index f047b8a043..6cbd1fd722 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -791,9 +791,6 @@ makes the good ol' XlockMore usable." "Run the GNOME Desktop Manager (GDM), a program that allows you to log in in a graphical session, whether or not you use GNOME."))) -;; This service isn't working yet; it gets as far as starting to run the -;; greeter from gnome-shell but doesn't get any further. It is here because -;; it doesn't hurt anyone and perhaps it inspires someone to fix it :) (define-deprecated (gdm-service #:key (gdm gdm) (allow-empty-passwords? #t) (x-server (xorg-wrapper))) -- cgit v1.2.3 From bab7a49558e28388d064063ae674117ca4a964df Mon Sep 17 00:00:00 2001 From: Tim Gesthuizen Date: Tue, 26 Mar 2019 20:52:50 +0100 Subject: services: slim-configuration: Adapt exported getter methods. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 554b8607396785dcde6eb391f75f98a07ec582fd introduces changes to the slim-configuration record without updating the exported methods. * gnu/services/xorg.scm: Export slim-configuration-xorg and slim-configuration-sessreg. Signed-off-by: Ludovic Courtès --- gnu/services/xorg.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 6cbd1fd722..29c7f30013 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2015 Sou Bunnbu ;;; Copyright © 2018, 2019 Timothy Sample ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2019 Tim Gesthuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -79,7 +80,8 @@ slim-configuration-xauth slim-configuration-shepherd slim-configuration-auto-login-session - slim-configuration-startx + slim-configuration-xorg + slim-configuration-sessreg slim-service-type slim-service -- cgit v1.2.3 From c1ef50ac79ff56bebe81a173a858d83a1bee6a36 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 4 Apr 2019 17:28:00 +0200 Subject: gexp: Remove workarounds for . * gnu/services/base.scm (hydra-key-authorization)[aaa]: Remove. [default-acl]: Don't import it. * guix/scripts/pack.scm (store-database)[build]: Don't import (gnu build install). --- gnu/services/base.scm | 10 ---------- guix/scripts/pack.scm | 6 +----- 2 files changed, 1 insertion(+), 15 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 04b123b833..246932e5c8 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1515,19 +1515,9 @@ GID." (define (hydra-key-authorization keys guix) "Return a gexp with code to register KEYS, a list of files containing 'guix archive' public keys, with GUIX." - (define aaa - ;; XXX: Terrible hack to work around : this - ;; forces (guix config) and (guix utils) to be loaded upfront, so that - ;; their run-time symbols are defined. - (scheme-file "aaa.scm" - #~(define-module (guix aaa) - #:use-module (guix config) - #:use-module (guix memoization)))) - (define default-acl (with-extensions (list guile-gcrypt) (with-imported-modules `(((guix config) => ,(make-config.scm)) - ((guix aaa) => ,aaa) ,@(source-module-closure '((guix pki)) #:select? not-config?)) (computed-file "acl" diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index e5502ef9ca..d2ef68d153 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -126,13 +126,9 @@ dependencies are registered." (define build (with-extensions gcrypt-sqlite3&co - ;; XXX: Adding (gnu build install) just to work around - ;; : that way, (guix build store-copy) is - ;; copied last and the 'store-info-XXX' macros are correctly expanded. (with-imported-modules (source-module-closure '((guix build store-copy) - (guix store database) - (gnu build install))) + (guix store database))) #~(begin (use-modules (guix store database) (guix build store-copy) -- cgit v1.2.3 From b68f65007f50175a68cd174ad7c1036cf622556d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 2 Apr 2019 21:36:26 +0200 Subject: services: dbus: Add 'wrapped-dbus-service'. * gnu/services/desktop.scm (wrapped-dbus-service): Move to... * gnu/services/dbus.scm (wrapped-dbus-service): ... here. New procedure. --- gnu/services/dbus.scm | 42 ++++++++++++++++++++++++++++++++++++++++++ gnu/services/desktop.scm | 40 ---------------------------------------- 2 files changed, 42 insertions(+), 40 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index 606ee0c2f5..3d2dbb903c 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -26,6 +26,7 @@ #:use-module (gnu packages polkit) #:use-module (gnu packages admin) #:use-module (guix gexp) + #:use-module ((guix packages) #:select (package-name)) #:use-module (guix records) #:use-module (srfi srfi-1) #:use-module (ice-9 match) @@ -33,6 +34,7 @@ dbus-configuration? dbus-root-service-type dbus-service + wrapped-dbus-service polkit-service-type polkit-service)) @@ -229,6 +231,46 @@ and policy files. For example, to allow avahi-daemon to use the system bus, (dbus-configuration (dbus dbus) (services services)))) +(define (wrapped-dbus-service service program variable value) + "Return a wrapper for @var{service}, a package containing a D-Bus service, +where @var{program} is wrapped such that environment variable @var{variable} +is set to @var{value} when the bus daemon launches it." + (define wrapper + (program-file (string-append (package-name service) "-program-wrapper") + #~(begin + (setenv #$variable #$value) + (apply execl (string-append #$service "/" #$program) + (string-append #$service "/" #$program) + (cdr (command-line)))))) + + (define build + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + + (define service-directory + "/share/dbus-1/system-services") + + (mkdir-p (dirname (string-append #$output + service-directory))) + (copy-recursively (string-append #$service + service-directory) + (string-append #$output + service-directory)) + (symlink (string-append #$service "/etc") ;for etc/dbus-1 + (string-append #$output "/etc")) + + (for-each (lambda (file) + (substitute* file + (("Exec[[:blank:]]*=[[:blank:]]*([[:graph:]]+)(.*)$" + _ original-program arguments) + (string-append "Exec=" #$wrapper arguments + "\n")))) + (find-files #$output "\\.service$"))))) + + (computed-file (string-append (package-name service) "-wrapper") + build)) + ;;; ;;; Polkit privilege management service. diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index dcab950822..230aeb324c 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -150,46 +150,6 @@ ((package . _) package)))) -(define (wrapped-dbus-service service program variable value) - "Return a wrapper for @var{service}, a package containing a D-Bus service, -where @var{program} is wrapped such that environment variable @var{variable} -is set to @var{value} when the bus daemon launches it." - (define wrapper - (program-file (string-append (package-name service) "-program-wrapper") - #~(begin - (setenv #$variable #$value) - (apply execl (string-append #$service "/" #$program) - (string-append #$service "/" #$program) - (cdr (command-line)))))) - - (define build - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - - (define service-directory - "/share/dbus-1/system-services") - - (mkdir-p (dirname (string-append #$output - service-directory))) - (copy-recursively (string-append #$service - service-directory) - (string-append #$output - service-directory)) - (symlink (string-append #$service "/etc") ;for etc/dbus-1 - (string-append #$output "/etc")) - - (for-each (lambda (file) - (substitute* file - (("Exec[[:blank:]]*=[[:blank:]]*([[:graph:]]+)(.*)$" - _ original-program arguments) - (string-append "Exec=" #$wrapper arguments - "\n")))) - (find-files #$output "\\.service$"))))) - - (computed-file (string-append (package-name service) "-wrapper") - build)) - ;;; ;;; Upower D-Bus service. -- cgit v1.2.3 From aa071ca049c4324c790b3364e6c4c8e886d26a9e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 2 Apr 2019 22:35:49 +0200 Subject: services: dbus: 'wrapped-dbus-service' accepts a list of variables. * gnu/services/dbus.scm (wrapped-dbus-service): Replace 'variable' and 'value' by 'variables', and adjust code accordingly. * gnu/services/desktop.scm (upower-dbus-service): (geoclue-dbus-service, elogind-dbus-service): Adjust accordingly. --- gnu/services/dbus.scm | 14 ++++++++++---- gnu/services/desktop.scm | 12 ++++++------ 2 files changed, 16 insertions(+), 10 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index 3d2dbb903c..35d7ff3c9c 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -231,14 +231,20 @@ and policy files. For example, to allow avahi-daemon to use the system bus, (dbus-configuration (dbus dbus) (services services)))) -(define (wrapped-dbus-service service program variable value) +(define (wrapped-dbus-service service program variables) "Return a wrapper for @var{service}, a package containing a D-Bus service, -where @var{program} is wrapped such that environment variable @var{variable} -is set to @var{value} when the bus daemon launches it." +where @var{program} is wrapped such that @var{variables}, a list of name/value +tuples, are all set as environment variables when the bus daemon launches it." (define wrapper (program-file (string-append (package-name service) "-program-wrapper") #~(begin - (setenv #$variable #$value) + (use-modules (ice-9 match)) + + (for-each (match-lambda + ((variable value) + (setenv variable value))) + '#$variables) + (apply execl (string-append #$service "/" #$program) (string-append #$service "/" #$program) (cdr (command-line)))))) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 230aeb324c..578095b146 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -217,8 +217,8 @@ (define (upower-dbus-service config) (list (wrapped-dbus-service (upower-configuration-upower config) "libexec/upowerd" - "UPOWER_CONF_FILE_NAME" - (upower-configuration-file config)))) + `(("UPOWER_CONF_FILE_NAME" + ,(upower-configuration-file config)))))) (define (upower-shepherd-service config) "Return a shepherd service for UPower with CONFIG." @@ -349,8 +349,8 @@ users are allowed." (define (geoclue-dbus-service config) (list (wrapped-dbus-service (geoclue-configuration-geoclue config) "libexec/geoclue" - "GEOCLUE_CONFIG_FILE" - (geoclue-configuration-file config)))) + `(("GEOCLUE_CONFIG_FILE" + ,(geoclue-configuration-file config)))))) (define %geoclue-accounts (list (user-group (name "geoclue") (system? #t)) @@ -702,8 +702,8 @@ include the @command{udisksctl} command, part of UDisks, and GNOME Disks." (define (elogind-dbus-service config) (list (wrapped-dbus-service (elogind-package config) "libexec/elogind/elogind" - "ELOGIND_CONF_FILE" - (elogind-configuration-file config)))) + `(("ELOGIND_CONF_FILE" + ,(elogind-configuration-file config)))))) (define (pam-extension-procedure config) "Return an extension for PAM-ROOT-SERVICE-TYPE that ensures that all the PAM -- cgit v1.2.3 From 607fcc75404e2b1fc74affcf372b4a6a789ac55e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 2 Apr 2019 22:50:38 +0200 Subject: services: Add 'localed' service type and have GDM extend it. This fixes a bug whereby GDM would always switch to US English keyboard layout regardless to the configured Xorg keyboard layout. * gnu/services/xorg.scm (): New record type. (localed-dbus-service): New procedure. (localed-service-type): New variable. (gdm-service-type): Extend LOCALED-SERVICE-TYPE. --- gnu/services/xorg.scm | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 88 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 29c7f30013..7745f9a3cc 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -27,6 +27,7 @@ #:use-module (gnu services shepherd) #:use-module (gnu system pam) #:use-module (gnu system keyboard) + #:use-module (gnu services base) #:use-module (gnu services dbus) #:use-module ((gnu packages base) #:select (canonical-package)) #:use-module (gnu packages guile) @@ -35,6 +36,7 @@ #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages display-managers) + #:use-module (gnu packages freedesktop) #:use-module (gnu packages gnustep) #:use-module (gnu packages gnome) #:use-module (gnu packages admin) @@ -91,6 +93,10 @@ screen-locker-service-type screen-locker-service + localed-configuration + localed-configuration? + localed-service-type + gdm-configuration gdm-service-type gdm-service)) @@ -653,6 +659,82 @@ makes the good ol' XlockMore usable." (file-append package "/bin/" program) allow-empty-passwords?))) + +;;; +;;; Locale service. +;;; + +(define-record-type* + localed-configuration make-localed-configuration + localed-configuration? + (localed localed-configuration-localed + (default localed)) + (keyboard-layout localed-configuration-keyboard-layout + (default #f))) + +(define (localed-dbus-service config) + "Return the 'localed' D-Bus service for @var{config}, a +@code{} record." + (define keyboard-layout + (localed-configuration-keyboard-layout config)) + + ;; The primary purpose of 'localed' is to tell GDM what the "current" Xorg + ;; keyboard layout is. If 'localed' is missing, or if it's unable to + ;; determine the current XKB layout, then GDM forcefully installs its + ;; default XKB config (US English). Here we communicate the configured + ;; layout through environment variables. + + (if keyboard-layout + (let* ((layout (keyboard-layout-name keyboard-layout)) + (variant (keyboard-layout-variant keyboard-layout)) + (model (keyboard-layout-model keyboard-layout)) + (options (keyboard-layout-options keyboard-layout))) + (list (wrapped-dbus-service + (localed-configuration-localed config) + "libexec/localed/localed" + `(("GUIX_XKB_LAYOUT" ,layout) + ,@(if variant + `(("GUIX_XKB_VARIANT" ,variant)) + '()) + ,@(if model + `(("GUIX_XKB_MODEL" ,model)) + '()) + ,@(if (null? options) + '() + `(("GUIX_XKB_OPTIONS" + ,(string-join options ",")))))))) + (localed-configuration-localed config))) + +(define localed-service-type + (let ((package (compose list localed-configuration-localed))) + (service-type (name 'localed) + (extensions + (list (service-extension dbus-root-service-type + localed-dbus-service) + (service-extension udev-service-type package) + (service-extension polkit-service-type package) + + ;; Add 'localectl' to the profile. + (service-extension profile-service-type package))) + + ;; This service can be extended, typically by the X login + ;; manager, to communicate the chosen Xorg keyboard layout. + (compose first) + (extend (lambda (config keyboard-layout) + (localed-configuration + (inherit config) + (keyboard-layout keyboard-layout)))) + (description + "Run the locale daemon, @command{localed}, which can be used +to control the system locale and keyboard mapping from user programs such as +the GNOME desktop environment.") + (default-value (localed-configuration))))) + + +;;; +;;; GNOME Desktop Manager. +;;; + (define %gdm-accounts (list (user-group (name "gdm") (system? #t)) (user-account @@ -787,7 +869,12 @@ makes the good ol' XlockMore usable." gdm-configuration-gnome-shell-assets) (service-extension dbus-root-service-type (compose list - gdm-configuration-gdm)))) + gdm-configuration-gdm)) + (service-extension localed-service-type + (compose + xorg-configuration-keyboard-layout + gdm-configuration-xorg)))) + (default-value (gdm-configuration)) (description "Run the GNOME Desktop Manager (GDM), a program that allows -- cgit v1.2.3 From 305a732a0a19c5810aab401aa7d70eba02ac386b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 3 Apr 2019 13:55:06 +0200 Subject: services: xorg: Add 'set-xorg-configuration'. * gnu/services/xorg.scm (gdm-service-type)[compose, extend]: New fields. (set-xorg-configuration): New procedure. * doc/guix.texi (Keyboard Layout): Use it. (X Window): Document it. * gnu/system/examples/desktop.tmpl: Add 'keyboard-layout' fields. --- doc/guix.texi | 24 +++++++++++++++++------- gnu/services/xorg.scm | 22 +++++++++++++++++++++- gnu/system/examples/desktop.tmpl | 14 +++++++++++--- 3 files changed, 49 insertions(+), 11 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 616c2ef305..96755a6cce 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11077,6 +11077,7 @@ Let's say you want your system to use the Turkish keyboard layout throughout your system---bootloader, console, and Xorg. Here's what your system configuration would look like: +@findex set-xorg-configuration @lisp ;; Using the Turkish layout for the bootloader, the console, ;; and for Xorg. @@ -11088,18 +11089,17 @@ configuration would look like: (bootloader grub-efi-bootloader) (target "/boot/efi") (keyboard-layout keyboard-layout))) ;for GRUB - (services (modify-services %desktop-services - (gdm-service-type config => - (gdm-configuration - (inherit config) - (xorg-configuration + (services (cons (set-xorg-configuration (xorg-configuration ;for Xorg - (keyboard-layout keyboard-layout)))))))) + (keyboard-layout keyboard-layout))) + %desktop-services))) @end lisp In the example above, for GRUB and for Xorg, we just refer to the @code{keyboard-layout} field defined above, but we could just as well refer to -a different layout. +a different layout. The @code{set-xorg-configuration} procedure communicates +the desired Xorg configuration to the graphical log-in manager, by default +GDM. @node Locales @section Locales @@ -13566,6 +13566,16 @@ default is @code{-nolisten tcp}. @end table @end deftp +@deffn {Scheme Procedure} set-xorg-configuration @var{config} @ + [@var{login-manager-service-type}] +Tell the log-in manager (of type @var{login-manager-service-type}) to use +@var{config}, an record. + +Since the Xorg configuration is embedded in the log-in manager's +configuration---e.g., @code{gdm-configuration}---this procedure provides a +shorthand to set the Xorg configuration. +@end deffn + @deffn {Scheme Procedure} xorg-start-command [@var{config}] Return a @code{startx} script in which the modules, fonts, etc. specified in @var{config}, are available. The result should be used in place of diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 7745f9a3cc..26ca0d4f1f 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -99,7 +99,8 @@ gdm-configuration gdm-service-type - gdm-service)) + gdm-service + set-xorg-configuration)) ;;; Commentary: ;;; @@ -875,6 +876,15 @@ the GNOME desktop environment.") xorg-configuration-keyboard-layout gdm-configuration-xorg)))) + ;; For convenience, this service can be extended with an + ;; record. Take the first one that + ;; comes. + (compose first) + (extend (lambda (config xorg-configuration) + (gdm-configuration + (inherit config) + (xorg-configuration xorg-configuration)))) + (default-value (gdm-configuration)) (description "Run the GNOME Desktop Manager (GDM), a program that allows @@ -908,4 +918,14 @@ password." (gdm gdm) (allow-empty-passwords? allow-empty-passwords?)))) +(define* (set-xorg-configuration config + #:optional + (login-manager-service-type + gdm-service-type)) + "Tell the log-in manager (of type @var{login-manager-service-type}) to use +@var{config}, an record." + (simple-service 'set-xorg-configuration + login-manager-service-type + config)) + ;;; xorg.scm ends here diff --git a/gnu/system/examples/desktop.tmpl b/gnu/system/examples/desktop.tmpl index ff4c12b24a..baeb5e2d77 100644 --- a/gnu/system/examples/desktop.tmpl +++ b/gnu/system/examples/desktop.tmpl @@ -3,7 +3,7 @@ ;; root partition is encrypted with LUKS. (use-modules (gnu) (gnu system nss)) -(use-service-modules desktop) +(use-service-modules desktop xorg) (use-package-modules certs gnome) (operating-system @@ -11,11 +11,16 @@ (timezone "Europe/Paris") (locale "en_US.utf8") + ;; Choose US English keyboard layout. The "altgr-intl" + ;; variant provides dead keys for accented characters. + (keyboard-layout (keyboard-layout "us" "altgr-intl")) + ;; Use the UEFI variant of GRUB with the EFI System ;; Partition mounted on /boot/efi. (bootloader (bootloader-configuration (bootloader grub-efi-bootloader) - (target "/boot/efi"))) + (target "/boot/efi") + (keyboard-layout keyboard-layout))) ;; Specify a mapped device for the encrypted root partition. ;; The UUID is that returned by 'cryptsetup luksUUID'. @@ -58,7 +63,10 @@ ;; include the X11 log-in service, networking with ;; NetworkManager, and more. (services (append (list (service gnome-desktop-service-type) - (service xfce-desktop-service-type)) + (service xfce-desktop-service-type) + (set-xorg-configuration + (xorg-configuration + (keyboard-layout keyboard-layout)))) %desktop-services)) ;; Allow resolution of '.local' host names with mDNS. -- cgit v1.2.3 From 3a665637afc32a142dc24a77ce7ce9235eb6a3af Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 3 Apr 2019 14:32:41 +0200 Subject: services: console-keymap: Deprecate. * gnu/services/base.scm (console-keymap-service): Mark as deprecated. * doc/guix.texi (Base Services): Remove its documentation. --- doc/guix.texi | 23 ----------------------- gnu/services/base.scm | 3 ++- 2 files changed, 2 insertions(+), 24 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 1b0bd1de58..1c82579afc 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -12023,29 +12023,6 @@ This is the name of the file where some random bytes are saved by It defaults to @file{/var/lib/random-seed}. @end defvr -@cindex keymap -@cindex keyboard -@deffn {Scheme Procedure} console-keymap-service @var{files} ... -@cindex keyboard layout -Return a service to load console keymaps from @var{files} using -@command{loadkeys} command. Most likely, you want to load some default -keymap, which can be done like this: - -@example -(console-keymap-service "dvorak") -@end example - -Or, for example, for a Swedish keyboard, you may need to combine -the following keymaps: -@example -(console-keymap-service "se-lat6" "se-fi-lat6") -@end example - -Also you can specify a full file name (or file names) of your keymap(s). -See @code{man loadkeys} for details. - -@end deffn - @cindex mouse @cindex gpm @defvr {Scheme Variable} gpm-service-type diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 246932e5c8..65f7ff29c8 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -719,7 +719,8 @@ to add @var{device} to the kernel's entropy pool. The service will fail if #$@files)))) (respawn? #f))))) -(define (console-keymap-service . files) +(define-deprecated (console-keymap-service #:rest files) + #f "Return a service to load console keymaps from @var{files}." (service console-keymap-service-type files)) -- cgit v1.2.3 From 0cf981a6066711f6e830a3f1d40f7c265b0bac94 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 5 Apr 2019 17:40:01 +0200 Subject: services: gdm: Properly handle empty extensions lists. Fixes a bug whereby not extending GDM would lead us to do: (first '()) in the 'compose' method. Regression introduced in 305a732a0a19c5810aab401aa7d70eba02ac386b. * gnu/services/xorg.scm (gdm-service-type)[compose]: Handle the case where EXTENSIONS is empty. [extend]: Handle the case where XORG-CONFIGURATION is #f. --- gnu/services/xorg.scm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 26ca0d4f1f..ede8bc7304 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -879,11 +879,16 @@ the GNOME desktop environment.") ;; For convenience, this service can be extended with an ;; record. Take the first one that ;; comes. - (compose first) + (compose (lambda (extensions) + (match extensions + (() #f) + ((config . _) config)))) (extend (lambda (config xorg-configuration) - (gdm-configuration - (inherit config) - (xorg-configuration xorg-configuration)))) + (if xorg-configuration + (gdm-configuration + (inherit config) + (xorg-configuration xorg-configuration)) + config))) (default-value (gdm-configuration)) (description -- cgit v1.2.3 From 3ef3bdf1cd52965457c6664e15d03dc6370925b0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 5 Apr 2019 17:43:22 +0200 Subject: services: localed: Properly handle lack of a 'keyboard-layout'. Fixes a type error when KEYBOARD-LAYOUT is #f. * gnu/services/xorg.scm (localed-dbus-service): Return the empty list when KEYBOARD-LAYOUT is #f. --- gnu/services/xorg.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index ede8bc7304..d0e6c7cd5c 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -704,7 +704,7 @@ makes the good ol' XlockMore usable." '() `(("GUIX_XKB_OPTIONS" ,(string-join options ",")))))))) - (localed-configuration-localed config))) + '())) (define localed-service-type (let ((package (compose list localed-configuration-localed))) -- cgit v1.2.3 From 1361584983b7e53f5eadd1815d1a2b81b387e6ad Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 5 Apr 2019 17:51:28 +0200 Subject: services: localed: Do nothing for unconfigured keyboards. * gnu/services/xorg.scm (localed-service-type)[package]: Return the empty list when the 'keyboard-layout' field is #f. [compose]: Use 'find' instead of 'first'. --- gnu/services/xorg.scm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index d0e6c7cd5c..d4e73c13b4 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -707,7 +707,12 @@ makes the good ol' XlockMore usable." '())) (define localed-service-type - (let ((package (compose list localed-configuration-localed))) + (let ((package (lambda (config) + ;; Don't bother if the user didn't specify any keyboard + ;; layout. + (if (localed-configuration-keyboard-layout config) + (list (localed-configuration-localed config)) + '())))) (service-type (name 'localed) (extensions (list (service-extension dbus-root-service-type @@ -720,7 +725,8 @@ makes the good ol' XlockMore usable." ;; This service can be extended, typically by the X login ;; manager, to communicate the chosen Xorg keyboard layout. - (compose first) + (compose (lambda (extensions) + (find keyboard-layout? extensions))) (extend (lambda (config keyboard-layout) (localed-configuration (inherit config) -- cgit v1.2.3 From 177bc62d63e89a1ce2f255879bca1fdc5f3769f1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 5 Apr 2019 17:52:40 +0200 Subject: services: wpa-supplicant: Log to syslog. * gnu/services/networking.scm (wpa-supplicant-shepherd-service): Pass "-s" to 'wpa_supplicant'. Add 'syslogd' to 'requirement'. --- gnu/services/networking.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 5fbbf25789..61561a40dd 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1060,12 +1060,13 @@ networking.")))) (list (shepherd-service (documentation "Run the WPA supplicant daemon") (provision '(wpa-supplicant)) - (requirement '(user-processes dbus-system loopback)) + (requirement '(user-processes dbus-system loopback syslogd)) (start #~(make-forkexec-constructor (list (string-append #$wpa-supplicant "/sbin/wpa_supplicant") (string-append "-P" #$pid-file) "-B" ;run in background + "-s" ;log to syslogd #$@(if dbus? #~("-u") #~()) -- cgit v1.2.3 From 412e6396bbb8b398e8a94427db50271e47db610f Mon Sep 17 00:00:00 2001 From: 宋文武 Date: Sat, 6 Apr 2019 22:02:41 +0800 Subject: services: Add 'imap4d-service-type'. * gnu/services/mail.scm (): New record type. (imap4d-shepherd-service): New procedure. (%default-imap4d-config-file, imap4d-service-type): New variables. * gnu/services/mail.scm (Mail Services): Document it. --- doc/guix.texi | 30 ++++++++++++++++++++++++++++++ gnu/services/mail.scm | 45 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 74 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 1c82579afc..cecad64e0c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16559,6 +16559,36 @@ the @code{operating-system}'s @code{user-accounts} in order to deliver the @code{postmaster} mail to @code{bob} (which subsequently would deliver mail to @code{bob@@example.com} and @code{bob@@example2.com}). +@subsubheading GNU Mailutils IMAP4 Daemon +@cindex GNU Mailutils IMAP4 Daemon + +@deffn {Scheme Variable} imap4d-service-type +This is the type of the GNU Mailutils IMAP4 Daemon (@pxref{(mailutils) +imap4d}), whose value should be an @code{imap4d-configuration} object as in +this example: + +@example +(service imap4d-service-type + (imap4d-configuration + (config-file (local-file "imap4d.conf")))) +@end example +@end deffn + +@deftp {Data Type} imap4d-configuration +Data type representing the configuration of @command{imap4d}. + +@table @asis +@item @code{package} (default: @code{mailutils}) +The package that provides @command{imap4d}. + +@item @code{config-file} (default: @code{%default-imap4d-config-file}) +File-like object of the configuration file to use, by default it will listen +on the tcp port 143 of @code{localhost}. @xref{(mailutils) Conf-imap4d} for +details. + +@end table +@end deftp + @node Messaging Services @subsection Messaging Services diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index a7e8c41d3a..0dabfed4cb 100644 --- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm @@ -64,7 +64,12 @@ exim-configuration exim-configuration? exim-service-type - %default-exim-config-file)) + %default-exim-config-file + + imap4d-configuration + imap4d-configuration? + imap4d-service-type + %defualt-imap4d-config-file)) ;;; Commentary: ;;; @@ -1776,3 +1781,41 @@ exim_group = exim (service-extension activation-service-type exim-activation) (service-extension profile-service-type exim-profile) (service-extension mail-aliases-service-type (const '())))))) + + +;;; +;;; GNU Mailutils IMAP4 Daemon. +;;; + +(define %default-imap4d-config-file + (plain-file "imap4d.conf" "server localhost {};\n")) + +(define-record-type* + imap4d-configuration make-imap4d-configuration imap4d-configuration? + (package imap4d-configuration-package + (default mailutils)) + (config-file imap4d-configuration-config-file + (default %default-imap4d-config-file))) + +(define imap4d-shepherd-service + (match-lambda + (($ package config-file) + (list (shepherd-service + (provision '(imap4d)) + (requirement '(networking syslogd)) + (documentation "Run the imap4d daemon.") + (start (let ((imap4d (file-append package "/sbin/imap4d"))) + #~(make-forkexec-constructor + (list #$imap4d "--daemon" "--foreground" + "--config-file" #$config-file)))) + (stop #~(make-kill-destructor))))))) + +(define imap4d-service-type + (service-type + (name 'imap4d) + (description + "Run the GNU @command{imap4d} to serve e-mail messages through IMAP.") + (extensions + (list (service-extension + shepherd-root-service-type imap4d-shepherd-service))) + (default-value (imap4d-configuration)))) -- cgit v1.2.3 From 3613ce46dceff657c5ea14008722fc83475fc56a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 7 Apr 2019 18:04:08 +0200 Subject: services: dropbear: Add default value. * gnu/services/ssh.scm (dropbear-service-type)[default-value]: New field. --- gnu/services/ssh.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm index 362a7f1490..25db783420 100644 --- a/gnu/services/ssh.scm +++ b/gnu/services/ssh.scm @@ -617,7 +617,8 @@ of user-name/file-like tuples." (list (service-extension shepherd-root-service-type dropbear-shepherd-service) (service-extension activation-service-type - dropbear-activation))))) + dropbear-activation))) + (default-value (dropbear-configuration)))) (define* (dropbear-service #:optional (config (dropbear-configuration))) "Run the @uref{https://matt.ucc.asn.au/dropbear/dropbear.html,Dropbear SSH -- cgit v1.2.3 From 02394462fcddd4fdaf354178160adc54c47de1bc Mon Sep 17 00:00:00 2001 From: frozenpigs Date: Wed, 10 Apr 2019 16:05:39 +0100 Subject: services: sddm: Switch back to using ‘startx’. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/sddm.scm (sddm-configuration-file): Use XORG-START-COMMAND. Signed-off-by: Tobias Geerinckx-Rice --- gnu/services/sddm.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/sddm.scm b/gnu/services/sddm.scm index 43b34a38d9..b433c59e12 100644 --- a/gnu/services/sddm.scm +++ b/gnu/services/sddm.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 David Craven ;;; Copyright © 2019 Ludovic Courtès +;;; Copyright © 2019 Jesse Gildersleve ;;; ;;; This file is part of GNU Guix. ;;; @@ -139,8 +140,7 @@ SessionCommand=" (sddm-configuration-session-command config) " SessionDir=" (sddm-configuration-sessions-directory config) " [X11] -ServerPath=" (xorg-configuration-server - (sddm-configuration-xorg config)) "/bin/X" " +ServerPath=" (xorg-start-command (sddm-configuration-xorg config)) " XauthPath=" (sddm-configuration-xauth-path config) " XephyrPath=" (sddm-configuration-xephyr-path config) " DisplayCommand=" (sddm-configuration-xdisplay-start config) " -- cgit v1.2.3 From 0682f084635cdc289aabafc4b2583639e00a28b3 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 17 Apr 2019 08:47:54 +0200 Subject: services: fprintd: Fix service. * gnu/services/authentication.scm ()[ntp]: Rename to... [fprintd]: ...this. (fprintd-dbus-service): New procedure. (fprintd-service-type): Use it. [default-value]: Add value. --- gnu/services/authentication.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/authentication.scm b/gnu/services/authentication.scm index ab54aaf698..6a9dab9185 100644 --- a/gnu/services/authentication.scm +++ b/gnu/services/authentication.scm @@ -45,14 +45,18 @@ (define-record-type* fprintd-configuration make-fprintd-configuration fprintd-configuration? - (ntp fprintd-configuration-fprintd + (fprintd fprintd-configuration-fprintd (default fprintd))) +(define (fprintd-dbus-service config) + (list (fprintd-configuration-fprintd config))) + (define fprintd-service-type (service-type (name 'fprintd) (extensions (list (service-extension dbus-root-service-type - list))) + fprintd-dbus-service))) + (default-value (fprintd-configuration)) (description "Run fprintd, a fingerprint management daemon."))) -- cgit v1.2.3 From dc01978288318a8155e2e2657be9b278a754ebac Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 17 Apr 2019 08:56:32 +0200 Subject: services: fprintd: Use define-configuration. * gnu/services/authentication.scm: Use define-configuration in fprintd. --- gnu/services/authentication.scm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/authentication.scm b/gnu/services/authentication.scm index 6a9dab9185..16df4da1fc 100644 --- a/gnu/services/authentication.scm +++ b/gnu/services/authentication.scm @@ -42,11 +42,9 @@ nslcd-configuration? nslcd-service-type)) -(define-record-type* - fprintd-configuration make-fprintd-configuration - fprintd-configuration? - (fprintd fprintd-configuration-fprintd - (default fprintd))) +(define-configuration fprintd-configuration + (fprintd (package fprintd) + "The fprintd package")) (define (fprintd-dbus-service config) (list (fprintd-configuration-fprintd config))) -- cgit v1.2.3 From 95ef8b85b16f19557ea07d0d0cbf856f85657368 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 23 Apr 2019 14:48:56 +0200 Subject: services: shepherd: Support one-shot services. * gnu/services/shepherd.scm ()[one-shot?]: New field. (shepherd-service-file): Pass #:one-shot? to the constructor. * doc/guix.texi (Shepherd Services): Document it. --- doc/guix.texi | 6 ++++++ gnu/services/shepherd.scm | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 3ec1cf852a..955fd1f172 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -25124,6 +25124,12 @@ shepherd, The GNU Shepherd Manual}). @xref{Slots of services, the @item @code{requirements} (default: @code{'()}) List of symbols denoting the Shepherd services this one depends on. +@cindex one-shot services, for the Shepherd +@item @code{one-shot?} (default: @code{#f}) +Whether this service is @dfn{one-shot}. One-shot services stop immediately +after their @code{start} action has completed. @xref{Slots of services,,, +shepherd, The GNU Shepherd Manual}, for more info. + @item @code{respawn?} (default: @code{#t}) Whether to restart the service when it stops, for instance when the underlying process dies. diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index 12d649f542..21baacbaf7 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016, 2018 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2019 Ludovic Courtès ;;; Copyright © 2017 Clément Lassieur ;;; Copyright © 2018 Carlo Zancanaro ;;; @@ -44,6 +44,7 @@ shepherd-service-provision shepherd-service-canonical-name shepherd-service-requirement + shepherd-service-one-shot? shepherd-service-respawn? shepherd-service-start shepherd-service-stop @@ -149,6 +150,8 @@ DEFAULT is given, use it as the service's default value." (provision shepherd-service-provision) ;list of symbols (requirement shepherd-service-requirement ;list of symbols (default '())) + (one-shot? shepherd-service-one-shot? ;Boolean + (default #f)) (respawn? shepherd-service-respawn? ;Boolean (default #t)) (start shepherd-service-start) ;g-expression (procedure) @@ -238,6 +241,11 @@ stored." #:docstring '#$(shepherd-service-documentation service) #:provides '#$(shepherd-service-provision service) #:requires '#$(shepherd-service-requirement service) + + ;; The 'one-shot?' slot is new in Shepherd 0.6.0. + ;; Older versions ignore it. + #:one-shot? '#$(shepherd-service-one-shot? service) + #:respawn? '#$(shepherd-service-respawn? service) #:start #$(shepherd-service-start service) #:stop #$(shepherd-service-stop service) -- cgit v1.2.3 From 86b8869ffffad96e06e98d523f287b25684a6fa6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 23 Apr 2019 15:08:31 +0200 Subject: linux-container: Remove '%containerized-shepherd-service' hack. This hack worked around a defect in the Shepherd 0.5.0 and is no longer needed. * gnu/services/shepherd.scm (%containerized-shepherd-service): Remove. * gnu/system/linux-container.scm (container-essential-services): Don't use it. --- gnu/services/shepherd.scm | 16 ---------------- gnu/system/linux-container.scm | 3 +-- 2 files changed, 1 insertion(+), 18 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index 21baacbaf7..45c67e04eb 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -60,7 +60,6 @@ %default-modules shepherd-service-file - %containerized-shepherd-service shepherd-service-lookup-procedure shepherd-service-back-edges @@ -346,21 +345,6 @@ symbols provided/required by a service." (lambda (service) (vhash-foldq* cons '() service edges))) -(define %containerized-shepherd-service - ;; XXX: This service works around a bug in the Shepherd 0.5.0: shepherd - ;; calls reboot(2) (via 'disable-reboot-on-ctrl-alt-del') when it starts, - ;; but in a container that fails with EINVAL. This was fixed in Shepherd - ;; commit 92e806bac1abaeeaf5d60f0ab50d1ae85ba6a62f. - (simple-service 'containerized-shepherd - shepherd-root-service-type - (list (shepherd-service - (provision '(containerized-shepherd)) - (start #~(lambda () - (set! (@@ (shepherd) - disable-reboot-on-ctrl-alt-del) - (const #t)) - #t)))))) - (define (shepherd-service-upgrade live target) "Return two values: the subset of LIVE (a list of ) that needs to be unloaded, and the subset of TARGET (a list of ) that diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm index 37a053cdc3..149c3d08a3 100644 --- a/gnu/system/linux-container.scm +++ b/gnu/system/linux-container.scm @@ -29,7 +29,6 @@ #:use-module (gnu build linux-container) #:use-module (gnu services) #:use-module (gnu services base) - #:use-module (gnu services shepherd) #:use-module (gnu system) #:use-module (gnu system file-systems) #:export (system-container @@ -52,7 +51,7 @@ from OS that are needed on the bare metal and not in a container." (let ((locale (operating-system-locale-directory os))) (with-monad %store-monad (return `(("locale" ,locale)))))) - (append base (list %containerized-shepherd-service)))) + base)) (define (containerized-operating-system os mappings) "Return an operating system based on OS for use in a Linux container -- cgit v1.2.3 From 06e5c3af8b6d0ab2a369d5832a4f1756ae6c3570 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 23 Apr 2019 23:41:35 +0200 Subject: services: connman: Redirect output to a log file. * gnu/services/networking.scm (connman-shepherd-service): Pass #:log-file to 'make-forkexec-constructor'. --- gnu/services/networking.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 61561a40dd..03b2c6e1ec 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -985,7 +985,14 @@ wireless networking.")))) (list (string-append #$connman "/sbin/connmand") "-n" "-r" - #$@(if disable-vpn? '("--noplugin=vpn") '())))) + #$@(if disable-vpn? '("--noplugin=vpn") '())) + + ;; 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-service-type -- cgit v1.2.3 From 9374cbd1fb29395a5e849e95e8a249e5f9f944c0 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 24 Apr 2019 22:21:35 +0200 Subject: services: fprintd: Provide polkit policy. * gnu/services/authentication.scm (fprintd-service-type)[extensions]: Add polkit-service-type. --- gnu/services/authentication.scm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gnu/services') diff --git a/gnu/services/authentication.scm b/gnu/services/authentication.scm index 16df4da1fc..73969a5a6d 100644 --- a/gnu/services/authentication.scm +++ b/gnu/services/authentication.scm @@ -53,6 +53,8 @@ (service-type (name 'fprintd) (extensions (list (service-extension dbus-root-service-type + fprintd-dbus-service) + (service-extension polkit-service-type fprintd-dbus-service))) (default-value (fprintd-configuration)) (description -- cgit v1.2.3 From b68aff1f05864a589b62afa44665a99e5cf43718 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 19 Apr 2019 22:28:30 +0200 Subject: gnu: certbot: Add support for manual plugin. * gnu/services/certbot.scm (certificate-configuration): Add challenge, auth-hook and cleanup-hook fields. (certbot-command): Use them. * doc/guix.texi (Certificate Services): Document them. --- doc/guix.texi | 20 ++++++++++++++++++++ gnu/services/certbot.scm | 40 +++++++++++++++++++++++++++++++--------- 2 files changed, 51 insertions(+), 9 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 879cb562e9..dbbb811a60 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19425,6 +19425,26 @@ Its default is the first provided domain. The first domain provided will be the subject CN of the certificate, and all domains will be Subject Alternative Names on the certificate. +@item @code{challenge} (default: @code{#f}) +The challenge type that has to be run by certbot. If @code{#f} is specified, +default to the HTTP challenge. If a value is specified, defaults to the +manual plugin (see @code{authentication-hook}, @code{cleanup-hook} and +the documentation at @url{https://certbot.eff.org/docs/using.html#hooks}). + +@item @code{authentication-hook} (default: @code{#f}) +Command to be run in a shell once for each certificate challenge to be +answered. For this command, the shell variable @code{$CERTBOT_DOMAIN} +will contain the domain being authenticated, @code{$CERTBOT_VALIDATION} +contains the validation string and @code{$CERTBOT_TOKEN} contains the +file name of the resource requested when performing an HTTP-01 challenge. + +@item @code{cleanup-hook} (default: @code{#f}) +Command to be run in a shell once for each certificate challenge that +have been answered by the @code{auth-hook}. For this command, the shell +variables available in the @code{auth-hook} script are still available, and +additionally @code{$CERTBOT_AUTH_OUTPUT} will contain the standard output +of the @code{auth-hook} script. + @item @code{deploy-hook} (default: @code{#f}) Command to be run in a shell once for each successfully issued certificate. For this command, the shell variable diff --git a/gnu/services/certbot.scm b/gnu/services/certbot.scm index 7565bc97ca..ae34ad17bb 100644 --- a/gnu/services/certbot.scm +++ b/gnu/services/certbot.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2016 ng0 ;;; Copyright © 2016 Sou Bunnbu ;;; Copyright © 2017, 2018 Clément Lassieur +;;; Copyright © 2019 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -50,6 +51,12 @@ (default #f)) (domains certificate-configuration-domains (default '())) + (challenge certificate-configuration-challenge + (default #f)) + (authentication-hook certificate-authentication-hook + (default #f)) + (cleanup-hook certificate-cleanup-hook + (default #f)) (deploy-hook certificate-configuration-deploy-hook (default #f))) @@ -81,17 +88,32 @@ (commands (map (match-lambda - (($ custom-name domains + (($ custom-name domains challenge + authentication-hook cleanup-hook deploy-hook) (let ((name (or custom-name (car domains)))) - (append - (list name certbot "certonly" "-n" "--agree-tos" - "-m" email - "--webroot" "-w" webroot - "--cert-name" name - "-d" (string-join domains ",")) - (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '()) - (if deploy-hook `("--deploy-hook" ,deploy-hook) '()))))) + (if challenge + (append + (list name certbot "certonly" "-n" "--agree-tos" + "-m" email + "--manual" + (string-append "--preferred-challenges=" challenge) + "--cert-name" name + "-d" (string-join domains ",")) + (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '()) + (if authentication-hook + `("--manual-auth-hook" ,authentication-hook) + '()) + (if cleanup-hook `("--manual-cleanup-hook" ,cleanup-hook) '()) + (if deploy-hook `("--deploy-hook" ,deploy-hook) '())) + (append + (list name certbot "certonly" "-n" "--agree-tos" + "-m" email + "--webroot" "-w" webroot + "--cert-name" name + "-d" (string-join domains ",")) + (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '()) + (if deploy-hook `("--deploy-hook" ,deploy-hook) '())))))) certificates))) (program-file "certbot-command" -- cgit v1.2.3 From 92eb600f8a94afa36142f8f145efaa485b632433 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 19 Apr 2019 22:20:03 +0200 Subject: gnu: knot-service: Add includes field in configuration. * gnu/services/dns.scm (knot-configuration): Add includes field. (verify-knot-configuration): Check includes content. (knot-config-file): Serialize includes. * doc/guix.texi (DNS Services): Document it. --- doc/guix.texi | 13 +++++++++++++ gnu/services/dns.scm | 8 ++++++++ 2 files changed, 21 insertions(+) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index dbbb811a60..2d5ec867ea 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19843,6 +19843,19 @@ The Knot package. @item @code{run-directory} (default: @code{"/var/run/knot"}) The run directory. This directory will be used for pid file and sockets. +@item @code{includes} (default: @code{'()}) +A list of strings or file-like objects denoting other files that must be +included at the top of the configuration file. + +@cindex secrets, Knot service +This can be used to manage secrets out-of-band. For example, secret +keys may be stored in an out-of-band file not managed by Guix, and +thus not visible in @file{/gnu/store}---e.g., you could store secret +key configuration in @file{/etc/knot/secrets.conf} and add this file +to the @code{includes} list. + +It can also be used to add configuration not supported by this interface. + @item @code{listen-v4} (default: @code{"0.0.0.0"}) An ip address on which to listen. diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index 1ef754b360..445e03570a 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm @@ -207,6 +207,8 @@ (default knot)) (run-directory knot-configuration-run-directory (default "/var/run/knot")) + (includes knot-configuration-includes + (default '())) (listen-v4 knot-configuration-listen-v4 (default "0.0.0.0")) (listen-v6 knot-configuration-listen-v6 @@ -296,6 +298,8 @@ (error-out "knot configuration field must be a package.")) (unless (string? (knot-configuration-run-directory config)) (error-out "run-directory must be a string.")) + (unless (list? (knot-configuration-includes config)) + (error-out "includes must be a list of strings or file-like objects.")) (unless (list? (knot-configuration-keys config)) (error-out "keys must be a list of knot-key-configuration.")) (for-each (lambda (key) (verify-knot-key-configuration key)) @@ -529,6 +533,10 @@ #~(begin (call-with-output-file #$output (lambda (port) + (if (knot-configuration-includes config) + (for-each (lambda (inc) + (format port "include: ~a\n" inc)) + (knot-configuration-includes config))) (format port "server:\n") (format port " rundir: ~a\n" #$(knot-configuration-run-directory config)) (format port " user: knot\n") -- cgit v1.2.3 From 94e1439800f8cdb5693ef0acb95465d09652e5cd Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 26 Apr 2019 18:07:46 +0200 Subject: services: cups-pk-helper: Export. * gnu/services/desktop.scm (cups-pk-helper-service-type): Export. --- gnu/services/desktop.scm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gnu/services') diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 578095b146..f31dbc112e 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -103,6 +103,8 @@ accountsservice-service-type accountsservice-service + cups-pk-helper-service-type + gnome-desktop-configuration gnome-desktop-configuration? gnome-desktop-service -- cgit v1.2.3 From e379d1b5efad293951fd35920bbf142376058696 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 26 Apr 2019 18:36:44 +0200 Subject: gnu: dns: Fix configuration formating. * gnu/services/dns.scm (format-string-list): Fix formating of lists with only one symbol. --- gnu/services/dns.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index 445e03570a..1613325645 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm @@ -336,7 +336,7 @@ (fold (lambda (x1 x2) (string-append (if (symbol? x1) (symbol->string x1) x1) ", " (if (symbol? x2) (symbol->string x2) x2))) - (car l) (cdr l)) + (if (symbol? (car l)) (symbol->string (car l)) (car l)) (cdr l)) "]")))) (define (knot-acl-config acls) -- cgit v1.2.3 From 74685a4369033e79a776c5dec1c8480e8b446f6b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 26 Apr 2019 23:46:20 +0200 Subject: services: file-system: Filter what goes to /etc/fstab. Fixes a longstanding issue whereby, due to our long fstab that included pseudo file systems like cgroup mounts, graphical file managers would display all of these. Initially reported at . * gnu/services/base.scm (file-system-fstab-entries): New procedure. (file-system-service-type): Use it to extend FSTAB-SERVICE-TYPE. --- gnu/services/base.scm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 65f7ff29c8..952f6f9ab2 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -510,13 +510,30 @@ FILE-SYSTEM." (cons* sink user-unmount (map file-system-shepherd-service file-systems)))) +(define (file-system-fstab-entries file-systems) + "Return the subset of @var{file-systems} that should have an entry in +@file{/etc/fstab}." + ;; /etc/fstab is about telling fsck(8), mount(8), and umount(8) about + ;; relevant file systems they'll have to deal with. That excludes "pseudo" + ;; file systems. + ;; + ;; In particular, things like GIO (part of GLib) use it to determine the set + ;; of mounts, which is then used by graphical file managers and desktop + ;; environments to display "volume" icons. Thus, we really need to exclude + ;; those pseudo file systems from the list. + (remove (lambda (file-system) + (or (member (file-system-type file-system) + %pseudo-file-system-types) + (memq 'bind-mount (file-system-flags file-system)))) + file-systems)) + (define file-system-service-type (service-type (name 'file-systems) (extensions (list (service-extension shepherd-root-service-type file-system-shepherd-services) (service-extension fstab-service-type - identity) + file-system-fstab-entries) ;; Have 'user-processes' depend on 'file-systems'. (service-extension user-processes-service-type -- cgit v1.2.3 From 435551f0faccb4f91cadc709ffb9819d850d7e69 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 27 Apr 2019 00:19:41 +0200 Subject: services: knot: Fix configuration file generation. Fixes a regression introduced in 92eb600f8a94afa36142f8f145efaa485b632433. * gnu/services/dns.scm (knot-config-file): Add ungexp around call to 'knot-configuration-includes'. --- gnu/services/dns.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index 1613325645..3aa97680a9 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm @@ -533,10 +533,9 @@ #~(begin (call-with-output-file #$output (lambda (port) - (if (knot-configuration-includes config) - (for-each (lambda (inc) - (format port "include: ~a\n" inc)) - (knot-configuration-includes config))) + (for-each (lambda (inc) + (format port "include: ~a\n" inc)) + '#$(knot-configuration-includes config)) (format port "server:\n") (format port " rundir: ~a\n" #$(knot-configuration-run-directory config)) (format port " user: knot\n") -- cgit v1.2.3 From 6cd7b1be7ea2b675e369c6cbb35b31b3c496648b Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sat, 27 Apr 2019 12:56:25 +0200 Subject: gnu: knot: Add configuration fields. * gnu/services/dns.scm (knot-zone-configuration)[zonefile-load] [journal-content, max-journal-usage, max-journal-depth, max-zone-size]: New fields. (knot-zone-config): Serialize them. * doc/guix.texi (DNS Services): Document them. --- doc/guix.texi | 39 +++++++++++++++++++++++++ gnu/services/dns.scm | 80 ++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 95 insertions(+), 24 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index e3bd9915bc..d9473a1820 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19829,6 +19829,45 @@ When set, this forbids queries of the ANY type. The delay between a modification in memory and on disk. 0 means immediate synchronization. +@item @code{zonefile-load} (default: @code{#f}) +The way the zone file contents are applied during zone load. Possible values +are: + +@itemize +@item @code{#f} for using the default value from Knot, +@item @code{'none} for not using the zone file at all, +@item @code{'difference} for computing the difference between already available +contents and zone contents and applying it to the current zone contents, +@item @code{'difference-no-serial} for the same as @code{'difference}, but +ignoring the SOA serial in the zone file, while the server takes care of it +automatically. +@item @code{'whole} for loading zone contents from the zone file. +@end itemize + +@item @code{journal-content} (default: @code{#f}) +The way the journal is used to store zone and its changes. Possible values +are @code{'none} to not use it at all, @code{'changes} to store changes and +@code{'all} to store contents. @code{#f} does not set this option, so the +default value from Knot is used. + +@item @code{max-journal-usage} (default: @code{#f}) +The maximum size for the journal on disk. @code{#f} does not set this option, +so the default value from Knot is used. + +@item @code{max-journal-depth} (default: @code{#f}) +The maximum size of the history. @code{#f} does not set this option, so the +default value from Knot is used. + +@item @code{max-zone-size} (default: @code{#f}) +The maximum size of the zone file. This limit is enforced for incoming +transfer and updates. @code{#f} does not set this option, so the default +value from Knot is used. + +@item @code{dnssec-policy} (default: @code{#f}) +A reference to a @code{knot-policy-configuration} record, or the special +name @code{"default"}. If the value is @code{#f}, there is no dnssec signing +on this zone. + @item @code{serial-policy} (default: @code{'increment}) A policy between @code{'increment} and @code{'unixtime}. diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index 3aa97680a9..0d660dea29 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm @@ -163,30 +163,40 @@ (define-record-type* knot-zone-configuration make-knot-zone-configuration knot-zone-configuration? - (domain knot-zone-configuration-domain - (default "")) - (file knot-zone-configuration-file - (default "")) ; the file where this zone is saved. - (zone knot-zone-configuration-zone - (default (zone-file))) ; initial content of the zone file - (master knot-zone-configuration-master - (default '())) - (ddns-master knot-zone-configuration-ddns-master - (default #f)) - (notify knot-zone-configuration-notify - (default '())) - (acl knot-zone-configuration-acl - (default '())) - (semantic-checks? knot-zone-configuration-semantic-checks? - (default #f)) - (disable-any? knot-zone-configuration-disable-any? - (default #f)) - (zonefile-sync knot-zone-configuration-zonefile-sync - (default 0)) - (dnssec-policy knot-zone-configuration-dnssec-policy - (default #f)) - (serial-policy knot-zone-configuration-serial-policy - (default 'increment))) + (domain knot-zone-configuration-domain + (default "")) + (file knot-zone-configuration-file + (default "")) ; the file where this zone is saved. + (zone knot-zone-configuration-zone + (default (zone-file))) ; initial content of the zone file + (master knot-zone-configuration-master + (default '())) + (ddns-master knot-zone-configuration-ddns-master + (default #f)) + (notify knot-zone-configuration-notify + (default '())) + (acl knot-zone-configuration-acl + (default '())) + (semantic-checks? knot-zone-configuration-semantic-checks? + (default #f)) + (disable-any? knot-zone-configuration-disable-any? + (default #f)) + (zonefile-sync knot-zone-configuration-zonefile-sync + (default 0)) + (zonefile-load knot-zone-configuration-zonefile-load + (default #f)) + (journal-content knot-zone-configuration-journal-content + (default #f)) + (max-journal-usage knot-zone-configuration-max-journal-usage + (default #f)) + (max-journal-depth knot-zone-configuration-max-journal-depth + (default #f)) + (max-zone-size knot-zone-configuration-max-zone-size + (default #f)) + (dnssec-policy knot-zone-configuration-dnssec-policy + (default #f)) + (serial-policy knot-zone-configuration-serial-policy + (default 'increment))) (define-record-type* knot-remote-configuration make-knot-remote-configuration @@ -494,6 +504,12 @@ (acl (list #$@(knot-zone-configuration-acl zone))) (semantic-checks? #$(knot-zone-configuration-semantic-checks? zone)) (disable-any? #$(knot-zone-configuration-disable-any? zone)) + (zone-file-sync #$(knot-zone-configuration-zonefile-sync zone)) + (zone-file-load #$(knot-zone-configuration-zonefile-load zone)) + (journal-content #$(knot-zone-configuration-journal-content zone)) + (max-journal-usage #$(knot-zone-configuration-max-journal-usage zone)) + (max-journal-depth #$(knot-zone-configuration-max-journal-depth zone)) + (max-zone-size #$(knot-zone-configuration-max-zone-size zone)) (dnssec-policy #$(knot-zone-configuration-dnssec-policy zone)) (serial-policy '#$(knot-zone-configuration-serial-policy zone))) (format #t " - domain: ~a\n" domain) @@ -520,6 +536,22 @@ (knot-zone-configuration-acl zone)))) (format #t " semantic-checks: ~a\n" (if semantic-checks? "on" "off")) (format #t " disable-any: ~a\n" (if disable-any? "on" "off")) + (if zonefile-sync + (format #t " zonefile-sync: ~a\n" zonefile-sync)) + (if zonefile-load + (format #t " zonefile-load: ~a\n" + (symbol->string zonefile-load))) + (if journal-content + (format #t " journal-content: ~a\n" + (symbol->string journal-content))) + (if max-journal-usage + (format #t " max-journal-usage: ~a\n" max-journal-usage)) + (if max-journal-depth + (format #t " max-journal-depth: ~a\n" max-journal-depth)) + (if max-zone-size + (format #t " max-zone-size: ~a\n" max-zone-size)) + (if + (format #t " : ~a\n" )) (if dnssec-policy (begin (format #t " dnssec-signing: on\n") -- cgit v1.2.3 From b8e2bd4fc89f7fd60f74949563fb834dbd8f7660 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sat, 27 Apr 2019 15:47:28 +0200 Subject: gnu: knot: Fix typos. * gnu/services/dns.scm: Fix typos. --- gnu/services/dns.scm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index 0d660dea29..5f37cb0782 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm @@ -504,8 +504,8 @@ (acl (list #$@(knot-zone-configuration-acl zone))) (semantic-checks? #$(knot-zone-configuration-semantic-checks? zone)) (disable-any? #$(knot-zone-configuration-disable-any? zone)) - (zone-file-sync #$(knot-zone-configuration-zonefile-sync zone)) - (zone-file-load #$(knot-zone-configuration-zonefile-load zone)) + (zonefile-sync #$(knot-zone-configuration-zonefile-sync zone)) + (zonefile-load '#$(knot-zone-configuration-zonefile-load zone)) (journal-content #$(knot-zone-configuration-journal-content zone)) (max-journal-usage #$(knot-zone-configuration-max-journal-usage zone)) (max-journal-depth #$(knot-zone-configuration-max-journal-depth zone)) @@ -550,8 +550,6 @@ (format #t " max-journal-depth: ~a\n" max-journal-depth)) (if max-zone-size (format #t " max-zone-size: ~a\n" max-zone-size)) - (if - (format #t " : ~a\n" )) (if dnssec-policy (begin (format #t " dnssec-signing: on\n") -- cgit v1.2.3 From cee06123c8262ccadf1b5dad9d49e48a5504473a Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 28 Apr 2019 11:49:56 +0200 Subject: gnu: Remove unused module reference. * gnu/services/web.scm: Remove reference to (gnu packages guile). --- gnu/services/web.scm | 1 - 1 file changed, 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/web.scm b/gnu/services/web.scm index b6ebe90774..84294db53b 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -34,7 +34,6 @@ #:use-module (gnu packages admin) #:use-module (gnu packages web) #:use-module (gnu packages php) - #:use-module (gnu packages guile) #:use-module (gnu packages logging) #:use-module (guix records) #:use-module (guix modules) -- cgit v1.2.3 From b901b72545ba780741113519a10a11ea6d69e42d Mon Sep 17 00:00:00 2001 From: Diego Nicola Barbato Date: Sat, 27 Apr 2019 19:45:47 +0200 Subject: services: slim: Honor the value of slim from slim-configuration. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously setting the slim field in slim-configuration would have no effect. * gnu/services/xorg.scm (slim-shepherd-service): Remove unused let binding for slim. Use (slim-configuration-slim config) instead of the default slim. Signed-off-by: Ludovic Courtès --- gnu/services/xorg.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index d4e73c13b4..44dcec4ec9 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -502,7 +502,6 @@ desktop session from the system or user profile will be used." (define slim.cfg (let ((xinitrc (xinitrc #:fallback-session (slim-configuration-auto-login-session config))) - (slim (slim-configuration-slim config)) (xauth (slim-configuration-xauth config)) (startx (xorg-start-command (slim-configuration-xorg config))) (shepherd (slim-configuration-shepherd config)) @@ -547,7 +546,9 @@ reboot_cmd " shepherd "/sbin/reboot\n" (false-if-exception (delete-file "/var/run/slim.lock")) (fork+exec-command - (list (string-append #$slim "/bin/slim") "-nodaemon") + (list (string-append #$(slim-configuration-slim config) + "/bin/slim") + "-nodaemon") #:environment-variables (list (string-append "SLIM_CFGFILE=" #$slim.cfg) #$@(if theme -- cgit v1.2.3