GNU bug report logs -
#58818
[PATCH 0/1] gnu: home: greetd-service-type: Add gexp compilers for sessions.
Previous Next
Reported by: "(" <paren <at> disroot.org>
Date: Thu, 27 Oct 2022 17:37:02 UTC
Severity: normal
Tags: patch
Done: Andrew Tropin <andrew <at> trop.in>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 58818 in the body.
You can then email your comments to 58818 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#58818
; Package
guix-patches
.
(Thu, 27 Oct 2022 17:37:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"(" <paren <at> disroot.org>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Thu, 27 Oct 2022 17:37:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Heya Guix!
This patch changes greetd-service-type to use gexp compilers to turn
session records into program-files, instead of an ad-hoc sanitiser
procedure.
( (1):
gnu: home: greetd-service-type: Add gexp compilers for sessions.
gnu/services/base.scm | 65 ++++++++++++++++++++-----------------------
1 file changed, 30 insertions(+), 35 deletions(-)
base-commit: 78d4a08ac3a1de481bc56eef967a2e5ed2a912d5
--
2.38.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#58818
; Package
guix-patches
.
(Thu, 27 Oct 2022 17:39:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 58818 <at> debbugs.gnu.org (full text, mbox):
* gnu/home/services/base.scm (make-greetd-agreety-session-command,
greetd-wlgreet-sway-session-command,
make-greetd-default-session-command): Remove variables.
(greetd-agreety-session-compiler,
greetd-wlgreet-sway-session-compiler): New gexp compilers.
(greetd-terminal-configuration)[default-session-command]<sanitize>:
Remove it.
---
gnu/services/base.scm | 65 ++++++++++++++++++++-----------------------
1 file changed, 30 insertions(+), 35 deletions(-)
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index d3e3335030..3bf924b8f1 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -2900,11 +2900,18 @@ (define greetd-agreety-tty-xdg-session-command
(quote (#$@extra-env)))
(apply execl #$command #$command (list #$@args)))))))
-(define (make-greetd-agreety-session-command config command)
- (let ((agreety (file-append (greetd-agreety config) "/bin/agreety")))
- (program-file
- "agreety-command"
- #~(execl #$agreety #$agreety "-c" #$command))))
+(define-gexp-compiler (greetd-agreety-session-compiler
+ (session <greetd-agreety-session>)
+ system target)
+ (let ((agreety (file-append (greetd-agreety session)
+ "/bin/agreety"))
+ (command ((if (greetd-agreety-xdg-env? session)
+ greetd-agreety-tty-xdg-session-command
+ greetd-agreety-tty-session-command)
+ session)))
+ (lower-object
+ (program-file "agreety-command"
+ #~(execl #$agreety #$agreety "-c" #$command)))))
(define-record-type* <greetd-wlgreet-session>
greetd-wlgreet-session make-greetd-wlgreet-session
@@ -2991,37 +2998,26 @@ (define (make-wlgreet-sway-configuration-file session)
"exec \"" wlgreet " --config " wlgreet-config "; "
swaymsg " exit\"\n")))
-(define (greetd-wlgreet-sway-session-command session)
+(define-gexp-compiler (greetd-wlgreet-sway-session-compiler
+ (session <greetd-wlgreet-sway-session>)
+ system target)
(let ((sway (file-append (greetd-wlgreet-sway-session-sway session)
"/bin/sway"))
(config (make-wlgreet-sway-configuration-file session)))
- (program-file "wlgreet-sway-session-command"
- #~(let* ((log-file (open-output-file
- (string-append "/tmp/sway-greeter."
- (number->string (getpid))
- ".log")))
- (username (getenv "USER"))
- (useruid (number->string (passwd:uid (getpwuid username)))))
- ;; redirect stdout/err to log-file
- (dup2 (fileno log-file) 1)
- (dup2 1 2)
- (sleep 1) ;give seatd/logind some time to start up
- (setenv "XDG_RUNTIME_DIR" (string-append "/run/user/" useruid))
- (execl #$sway #$sway "-d" "-c" #$config)))))
-
-(define (make-greetd-default-session-command config-or-command)
- (cond ((greetd-agreety-session? config-or-command)
- (cond ((greetd-agreety-xdg-env? config-or-command)
- (make-greetd-agreety-session-command
- config-or-command
- (greetd-agreety-tty-xdg-session-command config-or-command)))
- (#t
- (make-greetd-agreety-session-command
- config-or-command
- (greetd-agreety-tty-session-command config-or-command)))))
- ((greetd-wlgreet-sway-session? config-or-command)
- (greetd-wlgreet-sway-session-command config-or-command))
- (#t config-or-command)))
+ (lower-object
+ (program-file "wlgreet-sway-session-command"
+ #~(let* ((log-file (open-output-file
+ (string-append "/tmp/sway-greeter."
+ (number->string (getpid))
+ ".log")))
+ (username (getenv "USER"))
+ (useruid (number->string (passwd:uid (getpwuid username)))))
+ ;; redirect stdout/err to log-file
+ (dup2 (fileno log-file) 1)
+ (dup2 1 2)
+ (sleep 1) ;give seatd/logind some time to start up
+ (setenv "XDG_RUNTIME_DIR" (string-append "/run/user/" useruid))
+ (execl #$sway #$sway "-d" "-c" #$config))))))
(define-record-type* <greetd-terminal-configuration>
greetd-terminal-configuration make-greetd-terminal-configuration
@@ -3035,8 +3031,7 @@ (define-record-type* <greetd-terminal-configuration>
(terminal-switch greetd-terminal-switch (default #f))
(default-session-user greetd-default-session-user (default "greeter"))
(default-session-command greetd-default-session-command
- (default (greetd-agreety-session))
- (sanitize make-greetd-default-session-command)))
+ (default (greetd-agreety-session))))
(define (default-config-file-name config)
(string-join (list "config-" (greetd-terminal-vt config) ".toml") ""))
--
2.38.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#58818
; Package
guix-patches
.
(Wed, 02 Nov 2022 14:02:02 GMT)
Full text and
rfc822 format available.
Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 2022-10-27 18:38, "\( via Guix-patches" via wrote:
> * gnu/home/services/base.scm (make-greetd-agreety-session-command,
It should be gnu/services/base.scm, whithout home.
> greetd-wlgreet-sway-session-command,
> make-greetd-default-session-command): Remove variables.
> (greetd-agreety-session-compiler,
> greetd-wlgreet-sway-session-compiler): New gexp compilers.
> (greetd-terminal-configuration)[default-session-command]<sanitize>:
> Remove it.
> ---
> gnu/services/base.scm | 65 ++++++++++++++++++++-----------------------
> 1 file changed, 30 insertions(+), 35 deletions(-)
>
> diff --git a/gnu/services/base.scm b/gnu/services/base.scm
> index d3e3335030..3bf924b8f1 100644
> --- a/gnu/services/base.scm
> +++ b/gnu/services/base.scm
> @@ -2900,11 +2900,18 @@ (define greetd-agreety-tty-xdg-session-command
> (quote (#$@extra-env)))
> (apply execl #$command #$command (list #$@args)))))))
>
> -(define (make-greetd-agreety-session-command config command)
> - (let ((agreety (file-append (greetd-agreety config) "/bin/agreety")))
> - (program-file
> - "agreety-command"
> - #~(execl #$agreety #$agreety "-c" #$command))))
> +(define-gexp-compiler (greetd-agreety-session-compiler
> + (session <greetd-agreety-session>)
> + system target)
> + (let ((agreety (file-append (greetd-agreety session)
> + "/bin/agreety"))
> + (command ((if (greetd-agreety-xdg-env? session)
> + greetd-agreety-tty-xdg-session-command
> + greetd-agreety-tty-session-command)
> + session)))
> + (lower-object
> + (program-file "agreety-command"
> + #~(execl #$agreety #$agreety "-c" #$command)))))
>
> (define-record-type* <greetd-wlgreet-session>
> greetd-wlgreet-session make-greetd-wlgreet-session
> @@ -2991,37 +2998,26 @@ (define (make-wlgreet-sway-configuration-file session)
> "exec \"" wlgreet " --config " wlgreet-config "; "
> swaymsg " exit\"\n")))
>
> -(define (greetd-wlgreet-sway-session-command session)
> +(define-gexp-compiler (greetd-wlgreet-sway-session-compiler
> + (session <greetd-wlgreet-sway-session>)
> + system target)
> (let ((sway (file-append (greetd-wlgreet-sway-session-sway session)
> "/bin/sway"))
> (config (make-wlgreet-sway-configuration-file session)))
> - (program-file "wlgreet-sway-session-command"
> - #~(let* ((log-file (open-output-file
> - (string-append "/tmp/sway-greeter."
> - (number->string (getpid))
> - ".log")))
> - (username (getenv "USER"))
> - (useruid (number->string (passwd:uid (getpwuid username)))))
> - ;; redirect stdout/err to log-file
> - (dup2 (fileno log-file) 1)
> - (dup2 1 2)
> - (sleep 1) ;give seatd/logind some time to start up
> - (setenv "XDG_RUNTIME_DIR" (string-append "/run/user/" useruid))
> - (execl #$sway #$sway "-d" "-c" #$config)))))
> -
> -(define (make-greetd-default-session-command config-or-command)
> - (cond ((greetd-agreety-session? config-or-command)
> - (cond ((greetd-agreety-xdg-env? config-or-command)
> - (make-greetd-agreety-session-command
> - config-or-command
> - (greetd-agreety-tty-xdg-session-command config-or-command)))
> - (#t
> - (make-greetd-agreety-session-command
> - config-or-command
> - (greetd-agreety-tty-session-command config-or-command)))))
> - ((greetd-wlgreet-sway-session? config-or-command)
> - (greetd-wlgreet-sway-session-command config-or-command))
> - (#t config-or-command)))
> + (lower-object
> + (program-file "wlgreet-sway-session-command"
> + #~(let* ((log-file (open-output-file
> + (string-append "/tmp/sway-greeter."
> + (number->string (getpid))
> + ".log")))
> + (username (getenv "USER"))
> + (useruid (number->string (passwd:uid (getpwuid username)))))
> + ;; redirect stdout/err to log-file
> + (dup2 (fileno log-file) 1)
> + (dup2 1 2)
> + (sleep 1) ;give seatd/logind some time to start up
> + (setenv "XDG_RUNTIME_DIR" (string-append "/run/user/" useruid))
> + (execl #$sway #$sway "-d" "-c" #$config))))))
>
> (define-record-type* <greetd-terminal-configuration>
> greetd-terminal-configuration make-greetd-terminal-configuration
> @@ -3035,8 +3031,7 @@ (define-record-type* <greetd-terminal-configuration>
> (terminal-switch greetd-terminal-switch (default #f))
> (default-session-user greetd-default-session-user (default "greeter"))
> (default-session-command greetd-default-session-command
> - (default (greetd-agreety-session))
> - (sanitize make-greetd-default-session-command)))
> + (default (greetd-agreety-session))))
>
> (define (default-config-file-name config)
> (string-join (list "config-" (greetd-terminal-vt config) ".toml") ""))
I didn't test it, but this change looks good. Also CCed muradm.
I can take a deeper look and try it out later this week if nobody else
will do it earlier.
--
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#58818
; Package
guix-patches
.
(Wed, 02 Nov 2022 14:02:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#58818
; Package
guix-patches
.
(Wed, 02 Nov 2022 16:45:02 GMT)
Full text and
rfc822 format available.
Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):
On Wed Nov 2, 2022 at 2:00 PM GMT, Andrew Tropin wrote:
> It should be gnu/services/base.scm, whithout home.
Oops! :)
-- (
Information forwarded
to
guix-patches <at> gnu.org
:
bug#58818
; Package
guix-patches
.
(Wed, 02 Nov 2022 16:45:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#58818
; Package
guix-patches
.
(Wed, 09 Nov 2022 07:35:02 GMT)
Full text and
rfc822 format available.
Message #23 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 2022-10-27 18:38, guix-patches <at> gnu.org wrote:
> * gnu/home/services/base.scm (make-greetd-agreety-session-command,
> greetd-wlgreet-sway-session-command,
> make-greetd-default-session-command): Remove variables.
> (greetd-agreety-session-compiler,
> greetd-wlgreet-sway-session-compiler): New gexp compilers.
> (greetd-terminal-configuration)[default-session-command]<sanitize>:
> Remove it.
> ---
> gnu/services/base.scm | 65 ++++++++++++++++++++-----------------------
> 1 file changed, 30 insertions(+), 35 deletions(-)
>
> diff --git a/gnu/services/base.scm b/gnu/services/base.scm
> index d3e3335030..3bf924b8f1 100644
> --- a/gnu/services/base.scm
> +++ b/gnu/services/base.scm
> @@ -2900,11 +2900,18 @@ (define greetd-agreety-tty-xdg-session-command
> (quote (#$@extra-env)))
> (apply execl #$command #$command (list #$@args)))))))
>
> -(define (make-greetd-agreety-session-command config command)
> - (let ((agreety (file-append (greetd-agreety config) "/bin/agreety")))
> - (program-file
> - "agreety-command"
> - #~(execl #$agreety #$agreety "-c" #$command))))
> +(define-gexp-compiler (greetd-agreety-session-compiler
> + (session <greetd-agreety-session>)
> + system target)
> + (let ((agreety (file-append (greetd-agreety session)
> + "/bin/agreety"))
> + (command ((if (greetd-agreety-xdg-env? session)
> + greetd-agreety-tty-xdg-session-command
> + greetd-agreety-tty-session-command)
> + session)))
> + (lower-object
> + (program-file "agreety-command"
> + #~(execl #$agreety #$agreety "-c" #$command)))))
>
> (define-record-type* <greetd-wlgreet-session>
> greetd-wlgreet-session make-greetd-wlgreet-session
> @@ -2991,37 +2998,26 @@ (define (make-wlgreet-sway-configuration-file session)
> "exec \"" wlgreet " --config " wlgreet-config "; "
> swaymsg " exit\"\n")))
>
> -(define (greetd-wlgreet-sway-session-command session)
> +(define-gexp-compiler (greetd-wlgreet-sway-session-compiler
> + (session <greetd-wlgreet-sway-session>)
> + system target)
> (let ((sway (file-append (greetd-wlgreet-sway-session-sway session)
> "/bin/sway"))
> (config (make-wlgreet-sway-configuration-file session)))
> - (program-file "wlgreet-sway-session-command"
> - #~(let* ((log-file (open-output-file
> - (string-append "/tmp/sway-greeter."
> - (number->string (getpid))
> - ".log")))
> - (username (getenv "USER"))
> - (useruid (number->string (passwd:uid (getpwuid username)))))
> - ;; redirect stdout/err to log-file
> - (dup2 (fileno log-file) 1)
> - (dup2 1 2)
> - (sleep 1) ;give seatd/logind some time to start up
> - (setenv "XDG_RUNTIME_DIR" (string-append "/run/user/" useruid))
> - (execl #$sway #$sway "-d" "-c" #$config)))))
> -
> -(define (make-greetd-default-session-command config-or-command)
> - (cond ((greetd-agreety-session? config-or-command)
> - (cond ((greetd-agreety-xdg-env? config-or-command)
> - (make-greetd-agreety-session-command
> - config-or-command
> - (greetd-agreety-tty-xdg-session-command config-or-command)))
> - (#t
> - (make-greetd-agreety-session-command
> - config-or-command
> - (greetd-agreety-tty-session-command config-or-command)))))
> - ((greetd-wlgreet-sway-session? config-or-command)
> - (greetd-wlgreet-sway-session-command config-or-command))
> - (#t config-or-command)))
> + (lower-object
> + (program-file "wlgreet-sway-session-command"
> + #~(let* ((log-file (open-output-file
> + (string-append "/tmp/sway-greeter."
> + (number->string (getpid))
> + ".log")))
> + (username (getenv "USER"))
> + (useruid (number->string (passwd:uid (getpwuid username)))))
> + ;; redirect stdout/err to log-file
> + (dup2 (fileno log-file) 1)
> + (dup2 1 2)
> + (sleep 1) ;give seatd/logind some time to start up
> + (setenv "XDG_RUNTIME_DIR" (string-append "/run/user/" useruid))
> + (execl #$sway #$sway "-d" "-c" #$config))))))
>
> (define-record-type* <greetd-terminal-configuration>
> greetd-terminal-configuration make-greetd-terminal-configuration
> @@ -3035,8 +3031,7 @@ (define-record-type* <greetd-terminal-configuration>
> (terminal-switch greetd-terminal-switch (default #f))
> (default-session-user greetd-default-session-user (default "greeter"))
> (default-session-command greetd-default-session-command
> - (default (greetd-agreety-session))
> - (sanitize make-greetd-default-session-command)))
> + (default (greetd-agreety-session))))
>
> (define (default-config-file-name config)
> (string-join (list "config-" (greetd-terminal-vt config) ".toml") ""))
Applied, tested agreety session, adjusted commit message, pushed as
fdc9e1b27edfb3df51d391364bcbc50e9cd1de40.
Thank you!
--
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#58818
; Package
guix-patches
.
(Wed, 09 Nov 2022 07:35:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
58818 <at> debbugs.gnu.org and "(" <paren <at> disroot.org>
Request was from
Andrew Tropin <andrew <at> trop.in>
to
control <at> debbugs.gnu.org
.
(Wed, 09 Nov 2022 07:35:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#58818
; Package
guix-patches
.
(Wed, 09 Nov 2022 07:42:02 GMT)
Full text and
rfc822 format available.
Message #31 received at submit <at> debbugs.gnu.org (full text, mbox):
On Wed Nov 9, 2022 at 7:33 AM GMT, Andrew Tropin wrote:
> Thank you!
Thanks!
-- (
Information forwarded
to
guix-patches <at> gnu.org
:
bug#58818
; Package
guix-patches
.
(Wed, 09 Nov 2022 07:42:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 07 Dec 2022 12:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 273 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.