Subject: [PATCH 7/7] doc: Add desktop seatd-service-type and greetd-service-type.

From: muradm <[email-masked]>
Date: Mon, 9 Aug 2021 22:18:03 +0300

* doc/guix.texi (Desktop Services): Provide documentation for
seatd-service-type and greetd-service-type including configuration
and sample usage.
---
 doc/guix.texi | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 151 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 4eb5324b51..6c76a8d68a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -94,6 +94,7 @@ Copyright @copyright{} 2021 Xinglu Chen@*
 Copyright @copyright{} 2021 Raghav Gururajan@*
 Copyright @copyright{} 2021 Domagoj Stolfa@*
 Copyright @copyright{} 2021 Hui Lu@*
+Copyright @copyright{} 2021 muradm@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -19694,6 +19695,156 @@ and ``passwd'' is with the value @code{passwd}.
 @end table
 @end deftp
 
+@defvr {Scheme Variable} seatd-service-type
+A minimal seat management daemon, and a universal seat management library.
+
+Seat management takes care of mediating access to shared devices (graphics,
+input), without requiring the applications needing access to be root.
+
+In general should be used as replacement to @code{elogind-service-type}.
+And currently should be used with @code{greetd-service-type}.
+
+@lisp
+
+(append
+  (list
+   ;; make sure seatd is running
+   (service seatd-service-type)
+
+   ;; let's make terminals 1, 2 and 3 be an XDG terminal
+   ;; with XDG variables set on login.
+   (service greetd-service-type
+            (greetd-configuration
+             (terminal-vt "1")
+             (default-session-command greetd-agreety-tty-xdg-session)))
+   (service greetd-service-type
+            (greetd-configuration
+             (terminal-vt "2")
+             (default-session-command greetd-agreety-tty-xdg-session)))
+   (service greetd-service-type
+            (greetd-configuration
+             (terminal-vt "3")
+             (default-session-command greetd-agreety-tty-xdg-session)))
+
+   ;; let's make terminals 4, 5 and 6 be a plain bash terminal session
+   (service greetd-service-type
+            (greetd-configuration (terminal-vt "4")))
+   (service greetd-service-type
+            (greetd-configuration (terminal-vt "5")))
+   (service greetd-service-type
+            (greetd-configuration (terminal-vt "6"))))
+
+  (modify-services %desktop-services
+    ;; seatd/greetd combination can replace these
+    (delete elogind-service-type)
+    (delete agetty-service-type)
+    (delete mingetty-service-type)))
+
+@end lisp
+
+@end defvr
+
+@deftp {Data Type} seatd-configuration
+Configuration record for the seatd daemon service.
+
+@table @asis
+@item @code{seatd} (default: @code{seatd})
+The seatd package to use.
+
+@item @code{user} (default: @samp{"root"})
+User to own the seatd socket.
+
+@item @code{group} (default: @samp{"users"})
+Group to own the seatd socket.
+
+@item @code{socket} (default: @samp{"/run/seatd/socket"})
+Where to create the seatd socket.
+
+@end table
+@end deftp
+
+@defvr {Scheme Variable} greetd-service-type
+greetd is a minimal and flexible login manager daemon that makes no
+assumptions about what you want to launch.
+
+If you can run it from your shell in a TTY, greetd can start it. If it
+can be taught to speak a simple JSON-based IPC protocol, then it can
+be a greeter.
+@end defvr
+
+@deftp {Data Type} greetd-configuration
+Configuration record for the greetd daemon service.
+
+@table @asis
+@item @code{greetd} (default: @code{greetd})
+The greetd package to use.
+
+@item @code{config-file-name}
+Configuration file name to use for greetd daemon. Generally, autogenerated
+derivation based on @code{terminal-vt} value.
+
+@item @code{terminal-vt} (default: @samp{"7"})
+The VT to run on. Use of a specific VT with appropriate conflict avoidance
+is recommended.
+
+@item @code{default-session-user} (default: @samp{"greeter"})
+The user to use for running the greeter.
+
+@item @code{default-session-command} (default: @code{greetd-agreety-tty-session})
+The command-line to run to start the default session.
+
+Possible values are:
+
+@itemize @bullet
+@item
+@code{greetd-agreety-tty-session} - bash terminal session
+
+@item
+@code{greetd-agreety-tty-xdg-session} - bash terminal session with XDG environment
+
+@item
+@code{greetd-agreety-session} - custom instance of terminal session
+@end itemize
+
+@end table
+@end deftp
+
+@deftp {Data Type} greetd-agreety-session
+Configuration record for the agreety greetd greeter.
+
+@table @asis
+@item @code{package} (default: @code{bash})
+The package of command.
+
+@item @code{command-bin} (default: @samp{"/bin/bash"})
+Path to binary relative to @code{package}.
+
+@item @code{command-args} (default: @code{'("-l")})
+Command arguments to pass to command.
+
+@item @code{extra-env} (default: @code{'()})
+Extra environment variables to set on login.
+
+@item @code{command-generator}
+Function that receives instance of this configuration as an argument and
+returns @code{program-file} that can be used with @code{agreety} greeter.
+
+Both @code{greetd-agreety-tty-session} and @code{greetd-agreety-tty-xdg-session}
+uses @code{greetd-agreety-session} under the hood.
+
+@end table
+@end deftp
+
+@defvr {Scheme Variable} greetd-agreety-tty-session
+Provides instance of @code{greetd-agreety-session} which starts @samp{"bash -l"}
+on login.
+@end defvr
+
+@defvr {Scheme Variable} greetd-agreety-tty-xdg-session
+Provides instance of @code{greetd-agreety-session} which starts @samp{"bash -l"}
+on login. Additionally, will set @code{XDG_SESSION_ID}, @code{XDG_SESSION_TYPE} and
+@code{XDG_RUNTIME_DIR} environment variables for session.
+@end defvr
 
 @node Sound Services
 @subsection Sound Services
-- 
2.32.0