~ruther/guix-local

72996cd573f90aeaec88fa1de9f2382b96a7864d — Danny Milosavljevic 10 months ago 227fb11
services: greetd: Support initial-session.

* gnu/services/base.scm (<greetd-terminal-configuration>): Add
initial-session-user, initial-session-command.
* doc/guix.texi (Base Services): Document them.

Change-Id: Iaf7a8203f34794bc36b031166e1ff7005d7a7104
2 files changed, 23 insertions(+), 3 deletions(-)

M doc/guix.texi
M gnu/services/base.scm
M doc/guix.texi => doc/guix.texi +9 -0
@@ 20896,6 20896,15 @@ Make this terminal active on start of @code{greetd}.
Whether to source @file{/etc/profile} and @file{~/.profile}, when they
exist.

@item @code{initial-session-user} (default: @samp{#f})
The user to use for running the initial session, if any.

@item @code{initial-session-command} (default: @code{#f})
The command to run the first time the greeter starts up, to auto-login.
For that to be useful, you should also set @code{initial-session-user}.
Then, greetd will automatically log in with that user and execute that command.
When you eventually log out again, the regular greeter will appear.

@item @code{default-session-user} (default: @samp{"greeter"})
The user to use for running the greeter.


M gnu/services/base.scm => gnu/services/base.scm +14 -3
@@ 3954,7 3954,10 @@ to handle."
  (source-profile? greetd-source-profile? (default #t))
  (default-session-user greetd-default-session-user (default "greeter"))
  (default-session-command greetd-default-session-command
    (default (greetd-agreety-session))))
    (default (greetd-agreety-session)))
  (initial-session-user greetd-initial-session-user (default #f))
  (initial-session-command greetd-initial-session-command
    (default #f)))

(define (default-config-file-name config)
  (string-join (list "config-" (greetd-terminal-vt config) ".toml") ""))


@@ 3969,7 3972,9 @@ to handle."
       (terminal-vt (greetd-terminal-vt config))
       (terminal-switch (greetd-terminal-switch config))
       (default-session-user (greetd-default-session-user config))
       (default-session-command (greetd-default-session-command config)))
       (default-session-command (greetd-default-session-command config))
       (initial-session-user (greetd-initial-session-user config))
       (initial-session-command (greetd-initial-session-command config)))
    (mixed-text-file
     config-file-name
     "[general]\n"


@@ 3979,7 3984,13 @@ to handle."
     "switch = " (if terminal-switch "true" "false") "\n"
     "[default_session]\n"
     "user = " default-session-user "\n"
     "command = " default-session-command "\n")))
     "command = " default-session-command "\n"
     (if (and initial-session-user initial-session-command)
         (string-append
          "[initial_session]\n"
          "user = " initial-session-user "\n"
          "command = " initial-session-command "\n")
         ""))))

(define %greetd-file-systems
  (list (file-system