@@ -18509,6 +18509,14 @@ the 'root' account has just been created.
@item @code{terminals} (default: @code{'()})
List of @code{greetd-terminal-configuration} per terminal for which
@code{greetd} should be started.
+
+@item @code{greeter-groups} (default: @code{'()})
+List of groups which should be added to @code{greeter} user. For instance:
+@lisp
+(greeter-groups '("seat" "video"))
+@end lisp
+Note that, however it will fail if @code{seatd-service-type} is not present,
+or to be more specific, @code{seat} group is not present.
@end table
@end deftp
@@ -2918,17 +2918,6 @@ (define (make-greetd-terminal-configuration-file config)
"user = " default-session-user "\n"
"command = " default-session-command "\n")))
-(define %greetd-accounts
- (list (user-account
- (name "greeter")
- (group "greeter")
- ;; video group is required for graphical greeters.
- (supplementary-groups '("video"))
- (system? #t))
- (user-group
- (name "greeter")
- (system? #t))))
-
(define %greetd-file-systems
(list (file-system
(device "none")
@@ -2956,7 +2945,16 @@ (define-record-type* <greetd-configuration>
greetd-configuration?
(motd greetd-motd (default %default-motd))
(allow-empty-passwords? greetd-allow-empty-passwords? (default #t))
- (terminals greetd-terminals (default '())))
+ (terminals greetd-terminals (default '()))
+ (greeter-groups greetd-greeter-groups (default '())))
+
+(define (greetd-accounts-service config)
+ (list (user-group (name "greeter") (system? #t))
+ (user-account
+ (name "greeter")
+ (group "greeter")
+ (supplementary-groups (greetd-greeter-groups config))
+ (system? #t))))
(define (make-greetd-pam-mount-conf-file config)
(computed-file
@@ -3033,7 +3031,7 @@ (define greetd-service-type
login manager daemon.")
(extensions
(list
- (service-extension account-service-type (const %greetd-accounts))
+ (service-extension account-service-type greetd-accounts-service)
(service-extension file-system-service-type (const %greetd-file-systems))
(service-extension etc-service-type greetd-etc-service)
(service-extension pam-root-service-type greetd-pam-service)
@@ -122,6 +122,7 @@ (define %minimal-services
(service seatd-service-type)
(service greetd-service-type
(greetd-configuration
+ (greeter-groups '("input" "video"))
(terminals
(list
;; we can make any terminal active by default
@@ -286,6 +287,12 @@ (define (greetd-pid-to-sock pid)
(marionette-type "echo alice > /run/user/1000/test\n" marionette)
(file-get-all-strings "/run/user/1000/test")))
+ (test-equal "check greeter user has correct groups"
+ "greeter input video\n"
+ (begin
+ (marionette-type "id -Gn greeter > /run/user/1000/greeter-groups\n" marionette)
+ (file-get-all-strings "/run/user/1000/greeter-groups")))
+
(test-assert "screendump"
(begin
(marionette-control (string-append "screendump " #$output