summaryrefslogtreecommitdiff
path: root/doc/guix-cookbook.texi
diff options
context:
space:
mode:
authorJoshua Branson <jbranso@gnucode.me>2021-07-06 21:39:09 -0400
committerLeo Prikler <leo.prikler@student.tugraz.at>2021-07-07 11:13:38 +0200
commitc2ff06e5e410e615397b9df901af8028a64b3d82 (patch)
tree666339fdcca64d967f72ef04c404a249b1e94d51 /doc/guix-cookbook.texi
parenteac82c0e0a9f5afb5452928acf9b84cbc019c81c (diff)
doc: Add guide showing auto-login on a specific TTY to the cookbook.
This is a follow-up to the discussion in <https://bugs.gnu.org/48974>. * doc/guix-cookbook.texi (System Configuration): Add a brief guide that explains auto login a user to one TTY. * doc/guix.texi (System Services): Add an texinfo anchor, so that the cookbook entry "Auto Login a User to a Specific TTY" can refer back to the precise point that the GNU Guix Reference manual. Also add a reference to the cookbook that shows how to auto login a specific user to one TTY. Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
Diffstat (limited to 'doc/guix-cookbook.texi')
-rw-r--r--doc/guix-cookbook.texi51
1 files changed, 49 insertions, 2 deletions
diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi
index 1cddaa7faf..2e627ecc51 100644
--- a/doc/guix-cookbook.texi
+++ b/doc/guix-cookbook.texi
@@ -17,6 +17,7 @@ Copyright @copyright{} 2020 Marcin Karpezo@*
Copyright @copyright{} 2020 Brice Waegeneire@*
Copyright @copyright{} 2020 André Batista@*
Copyright @copyright{} 2020 Christopher Lemmer Webber
+Copyright @copyright{} 2021 Joshua Branson@*
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -85,8 +86,8 @@ Packaging
System Configuration
-* Customizing the Kernel:: Creating and using a custom Linux kernel
-
+* Auto-Login to a Specific TTY:: Automatically Login a User to a Specific TTY
+* Customizing the Kernel:: Creating and using a custom Linux kernel on Guix System.
@end detailmenu
@end menu
@@ -1353,6 +1354,7 @@ chapter is to demonstrate some advanced configuration concepts.
reference.
@menu
+* Auto-Login to a Specific TTY:: Automatically Login a User to a Specific TTY
* Customizing the Kernel:: Creating and using a custom Linux kernel on Guix System.
* Guix System Image API:: Customizing images to target specific platforms.
* Connecting to Wireguard VPN:: Connecting to a Wireguard VPN.
@@ -1363,6 +1365,51 @@ reference.
* Setting up NGINX with Lua:: Configuring NGINX web-server to load Lua modules.
@end menu
+@node Auto-Login to a Specific TTY
+@section Auto-Login to a Specific TTY
+
+While the Guix manual explains auto-login one user to @emph{all} TTYs (
+@pxref{auto-login to TTY,,, guix, GNU Guix Reference Manual}), some
+might prefer a situation, in which one user is logged into one TTY with
+the other TTYs either configured to login different users or no one at
+all. Note that one can auto-login one user to any TTY, but it is
+usually advisable to avoid @code{tty1}, which, by default, is used to
+log warnings and errors.
+
+Here is how one might set up auto login for one user to one tty:
+
+@lisp
+(define (auto-login-to-tty config tty user)
+ (if (string=? tty (mingetty-configuration-tty config))
+ (mingetty-configuration
+ (inherit config)
+ (auto-login user))
+ config))
+
+(define %my-services
+ (modify-services %base-services
+ ;; @dots{}
+ (mingetty-service-type config =>
+ (auto-login-to-tty
+ config "tty3" "alice"))))
+
+(operating-system
+ ;; @dots{}
+ (services %my-services))
+@end lisp
+
+One could also @code{compose} (@pxref{Higher-Order Functions,,, guile,
+The Guile Reference Manual}) @code{auto-login-to-tty} to login multiple
+users to multiple ttys.
+
+Finally, here is a note of caution. Setting up auto login to a TTY,
+means that anyone can turn on your computer and run commands as your
+regular user.
+However, if you have an encrypted root partition, and thus already need
+to enter a passphrase when the system boots, auto-login might be a
+convenient option.
+
+
@node Customizing the Kernel
@section Customizing the Kernel