GNU bug report logs

#78261 [PATCH] services: greetd: Add support for initial session.

PackageSource(s)Maintainer(s)
guix-patches PTS Buildd Popcon
Reply or subscribe to this bug. View this bug as an mbox, status mbox, or maintainer mbox

Report forwarded to gabriel@erlikon.ch, ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org:
bug#78261; Package guix-patches. (Mon, 05 May 2025 14:41:02 GMT) (full text, mbox, link).


Acknowledgement sent to Benjamin <benjamin@uvy.fr>:
New bug report received and forwarded. Copy sent to gabriel@erlikon.ch, ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org. (Mon, 05 May 2025 14:41:02 GMT) (full text, mbox, link).


Message #5 received at submit@debbugs.gnu.org (full text, mbox, reply):

From: Benjamin <benjamin@uvy.fr>
To: guix-patches@gnu.org
Cc: Benjamin <benjamin@uvy.fr>
Subject: [PATCH] services: greetd: Add support for initial session.
Date: Mon, 5 May 2025 16:40:23 +0200
This commit adds initial_session section to greetd configuration file.

This optional section describes the initial session, commonly
referred to as "auto-login".

* gnu/services/base.scm (greetd-terminal-configuration): Add initial-session-user
and initial-session-command fields.
* doc/guix.texi: Document the new fields.

Change-Id: I84d6860bfe459f3cae07f5932920741fd5a60899
---
 doc/guix.texi         | 12 ++++++++++++
 gnu/services/base.scm | 20 ++++++++++++++++----
 2 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 7f796c5fc94..b69298eb5fb 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -20844,6 +20844,18 @@ Base Services
 @code{greetd-wlgreet-sway-session}, @code{greetd-gtkgreet-sway-session}
 or a file-like object to use as greeter.
 
+@item @code{initial-session-user} (default: @code{#f})
+The user to use for running the initial session.
+
+@code{initial-session-command} must also be defined.
+
+@item @code{initial-session-command} (default: @code{(greetd-agreety-session)})
+The command-line that greetd will run to start the initial session, e.g.
+@code{(file-append sway "/bin/sway")}.
+The initial session will be started exactly once when greetd is initially launched.
+
+@code{initial-session-user} must also be defined.
+
 @end table
 @end deftp
 
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 650121be8f1..56cb5206af9 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -3941,7 +3941,10 @@ (define-record-type* <greetd-terminal-configuration>
   (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") ""))
@@ -3956,8 +3959,11 @@ (define (make-greetd-terminal-configuration-file config)
        (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)))
-    (mixed-text-file
+       (default-session-command (greetd-default-session-command config))
+       (initial-session-user (greetd-initial-session-user config))
+       (initial-session-command (greetd-initial-session-command config)))
+    (apply mixed-text-file
+     (cons*
      config-file-name
      "[general]\n"
      "source_profile = " (if source-profile? "true" "false") "\n"
@@ -3966,7 +3972,13 @@ (define (make-greetd-terminal-configuration-file config)
      "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)
+       (list
+         "[initial_session]\n"
+         "user = " initial-session-user "\n"
+         "command = " initial-session-command "\n")
+       (list))))))
 
 (define %greetd-file-systems
   (list (file-system

base-commit: 17119f1a35b7bff683f2f8f2b5db09b4634283e6
-- 
2.49.0





Information forwarded to guix-patches@gnu.org:
bug#78261; Package guix-patches. (Sat, 02 Aug 2025 12:36:02 GMT) (full text, mbox, link).


Message #8 received at 78261@debbugs.gnu.org (full text, mbox, reply):

From: "Benjamin" <benjamin@uvy.fr>
To: <78261@debbugs.gnu.org>
Subject: Close this patch
Date: Sat, 02 Aug 2025 14:34:43 +0200
This issue can be closed.

It has been done in 72996cd573f90aeaec88fa1de9f2382b96a7864d




Reply sent to Andreas Enge <andreas@enge.fr>:
You have taken responsibility. (Sat, 02 Aug 2025 19:01:02 GMT) (full text, mbox, link).


Notification sent to Benjamin <benjamin@uvy.fr>:
bug acknowledged by developer. (Sat, 02 Aug 2025 19:01:02 GMT) (full text, mbox, link).


Message #13 received at 78261-done@debbugs.gnu.org (full text, mbox, reply):

From: Andreas Enge <andreas@enge.fr>
To: 78261-done@debbugs.gnu.org
Subject: Close
Date: Sat, 2 Aug 2025 21:00:28 +0200
Closing as requested.

Andreas





bug archived. Request was from Debbugs Internal Request <help-debbugs@gnu.org> to internal_control@debbugs.gnu.org. (Sun, 31 Aug 2025 11:24:15 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Mon Sep 8 20:47:23 2025; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.