services: 'mingetty-service' no longer takes monadic values.

* gnu/services/base.scm (mingetty-service): Change default value of
  #:motd from a monadic value to a <plain-file>.  Assume MOTD to be a
  file-like object.  Assume LOGIN-PROGRAM is a gexp or #f.
  (%base-services): Use 'plain-file' instead of 'text-file' for motd.
* gnu/system/linux.scm (unix-pam-service): Update docstring to mention
  that MOTD is a file-like object.
* doc/guix.texi (Base Services): Adjust 'mingetty-service' documentation
  accordingly.
This commit is contained in:
Ludovic Courtès 2015-09-07 22:44:26 +02:00
parent 5fbbd29f74
commit daa48c3179
3 changed files with 8 additions and 15 deletions

View file

@ -5699,7 +5699,7 @@ automatically. @var{login-pause?} can be set to @code{#t} in conjunction with
@var{auto-login}, in which case the user will have to press a key before the @var{auto-login}, in which case the user will have to press a key before the
login shell is launched. login shell is launched.
When true, @var{login-program} is a gexp or a monadic gexp denoting the name When true, @var{login-program} is a gexp denoting the name
of the log-in program (the default is the @code{login} program from the Shadow of the log-in program (the default is the @code{login} program from the Shadow
tool suite.) tool suite.)

View file

@ -357,7 +357,7 @@ (define* (console-font-service tty #:optional (font "LatGrkCyr-8x16"))
(define* (mingetty-service tty (define* (mingetty-service tty
#:key #:key
(motd (text-file "motd" "Welcome.\n")) (motd (plain-file "motd" "Welcome.\n"))
auto-login auto-login
login-program login-program
login-pause? login-pause?
@ -374,19 +374,12 @@ (define* (mingetty-service tty
@var{auto-login}, in which case the user will have to press a key before the @var{auto-login}, in which case the user will have to press a key before the
login shell is launched. login shell is launched.
When true, @var{login-program} is a gexp or a monadic gexp denoting the name When true, @var{login-program} is a gexp denoting the name
of the log-in program (the default is the @code{login} program from the Shadow of the log-in program (the default is the @code{login} program from the Shadow
tool suite.) tool suite.)
@var{motd} is a monadic value containing a text file to use as @var{motd} is a file-like object to use as the ``message of the day''."
the ``message of the day''." (with-monad %store-monad
(mlet %store-monad ((motd motd)
(login-program (cond ((gexp? login-program)
(return login-program))
((not login-program)
(return #f))
(else
login-program))))
(return (return
(service (service
(documentation (string-append "Run mingetty on " tty ".")) (documentation (string-append "Run mingetty on " tty "."))
@ -861,7 +854,7 @@ (define requirement
(define %base-services (define %base-services
;; Convenience variable holding the basic services. ;; Convenience variable holding the basic services.
(let ((motd (text-file "motd" " (let ((motd (plain-file "motd" "
This is the GNU operating system, welcome!\n\n"))) This is the GNU operating system, welcome!\n\n")))
(list (console-font-service "tty1") (list (console-font-service "tty1")
(console-font-service "tty2") (console-font-service "tty2")

View file

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -136,7 +136,7 @@ (module "pam_unix.so"))))
(lambda* (name #:key allow-empty-passwords? motd) (lambda* (name #:key allow-empty-passwords? motd)
"Return a standard Unix-style PAM service for NAME. When "Return a standard Unix-style PAM service for NAME. When
ALLOW-EMPTY-PASSWORDS? is true, allow empty passwords. When MOTD is true, it ALLOW-EMPTY-PASSWORDS? is true, allow empty passwords. When MOTD is true, it
should be the name of a file used as the message-of-the-day." should be a file-like object used as the message-of-the-day."
;; See <http://www.linux-pam.org/Linux-PAM-html/sag-configuration-example.html>. ;; See <http://www.linux-pam.org/Linux-PAM-html/sag-configuration-example.html>.
(let ((name* name)) (let ((name* name))
(pam-service (pam-service