all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Problem on LXQt service definition
@ 2019-05-13 18:33 Reza Alizadeh Majd
  2019-05-15  3:28 ` Meiyo Peng
  0 siblings, 1 reply; 4+ messages in thread
From: Reza Alizadeh Majd @ 2019-05-13 18:33 UTC (permalink / raw)
  To: help-guix

Hi, 

I'll try to create a service for `lxqt-desktop` based on same definition on [nixos](https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/desktop-managers/lxqt.nix). 
but my service definition won't start and  here is my proposed definition for this service:


;;;
;;; LXQt desktop service.
;;;

(define-record-type* <lxqt-desktop-configuration> lxqt-desktop-configuration
  make-lxqt-desktop-configuration
  lxqt-desktop-configuration
  (lxqt-package lxqt-package (default lxqt)))

(define (lxqt-shepherd-service config)
  "Return a shepherd service for @command{lxqt-session}"
  (let ((lxqt-session ((package-direct-input-selector "lxqt-session") 
                       (lxqt-package config))))
    (list (shepherd-service
            (provision '(lxqt))
            ; (requirement '())
            (documentation "Run the lxqt session")
            (start #~(make-forkexec-constructor
                      (list(string-append #$lxqt-session "/bin/startlxqt"))
                      #:environment-variables
                      (list (string-append "XDG_CONFIG_DIRS=" 
                                           "$XDG_CONFIG_DIRS;/run/current-system/profile/etc/xdg")
                            (string-append "XDG_DATA_DIRS="
                                           "$XDG_DATA_DIRS;/run/current-system/profile/share"))
            (stop #~(make-kill-destructor))))))

(define lxqt-desktop-service-type
  (service-type
    (name 'lxqt-desktop)
    (extensions
      (list
            (service-extension shepherd-root-service-type
                               lxqt-shepherd-service)
            (service-extension profile-service-type
                               (compose list 
                                        lxqt-package))))
    (default-value (lxqt-desktop-configuration))
    (description "Run the LXQt desktop environment.")))

(define-deprecated (lxqt-desktop-service #:key 
                                         (config 
                                          (lxqt-desktop-configuration)))
  lxqt-desktop-service-type
  "Return a service that adds the @code{lxqt} package to the system profile, and 
extends polkit with the actions from @code{lxqt-policykit}."
  (service lxqt-desktop-service-type config))


could anyone help on this matter ? 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem on LXQt service definition
  2019-05-13 18:33 Problem on LXQt service definition Reza Alizadeh Majd
@ 2019-05-15  3:28 ` Meiyo Peng
  2019-05-15  9:47   ` Reza Alizadeh Majd
  0 siblings, 1 reply; 4+ messages in thread
From: Meiyo Peng @ 2019-05-15  3:28 UTC (permalink / raw)
  To: Reza Alizadeh Majd; +Cc: help-guix

Hi,

Reza Alizadeh Majd writes:

> I'll try to create a service for `lxqt-desktop` based on same definition on [nixos](https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/desktop-managers/lxqt.nix).
> but my service definition won't start and  here is my proposed definition for this service:

Thank you for your work on LXQt.

> ;;;
> ;;; LXQt desktop service.
> ;;;
>
> (define-record-type* <lxqt-desktop-configuration> lxqt-desktop-configuration
>   make-lxqt-desktop-configuration
>   lxqt-desktop-configuration
>   (lxqt-package lxqt-package (default lxqt)))
>
> (define (lxqt-shepherd-service config)
>   "Return a shepherd service for @command{lxqt-session}"
>   (let ((lxqt-session ((package-direct-input-selector "lxqt-session")
>                        (lxqt-package config))))
>     (list (shepherd-service
>             (provision '(lxqt))
>             ; (requirement '())
>             (documentation "Run the lxqt session")
>             (start #~(make-forkexec-constructor
>                       (list(string-append #$lxqt-session "/bin/startlxqt"))
>                       #:environment-variables
>                       (list (string-append "XDG_CONFIG_DIRS="
>                                            "$XDG_CONFIG_DIRS;/run/current-system/profile/etc/xdg")
>                             (string-append "XDG_DATA_DIRS="
>                                            "$XDG_DATA_DIRS;/run/current-system/profile/share"))
>             (stop #~(make-kill-destructor))))))

I don't think we should start the LXQt session from a shepherd service.
A desktop session should be started by a display manager like GDM or
SDDM.  A display manager can find these desktop sessions and provides
choices on login screen if a desktop package provides correct session
files in prefix/share/xsessions (or prefix/share/wayland-sessions for
wayland sessions).  I am not a nix expert but I think the nix file you
referred to tries to define a desktop session file for LXQt rather than
automatically start it upon system startup.

> (define lxqt-desktop-service-type
>   (service-type
>     (name 'lxqt-desktop)
>     (extensions
>       (list
>             (service-extension shepherd-root-service-type
>                                lxqt-shepherd-service)
>             (service-extension profile-service-type
>                                (compose list
>                                         lxqt-package))))
>     (default-value (lxqt-desktop-configuration))
>     (description "Run the LXQt desktop environment.")))
>
> (define-deprecated (lxqt-desktop-service #:key
>                                          (config
>                                           (lxqt-desktop-configuration)))
>   lxqt-desktop-service-type
>   "Return a service that adds the @code{lxqt} package to the system profile, and
> extends polkit with the actions from @code{lxqt-policykit}."
>   (service lxqt-desktop-service-type config))

Apparently we should not use (define-deprecated ...) to define new variables.

> could anyone help on this matter ?

What are you trying to achieve by adding the lxqt-desktop-service-type?


--
Meiyo Peng
https://www.pengmeiyu.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem on LXQt service definition
  2019-05-15  3:28 ` Meiyo Peng
@ 2019-05-15  9:47   ` Reza Alizadeh Majd
  2019-05-15 13:53     ` L p R n d n
  0 siblings, 1 reply; 4+ messages in thread
From: Reza Alizadeh Majd @ 2019-05-15  9:47 UTC (permalink / raw)
  To: Meiyo Peng; +Cc: help-guix

Hi, 

Thanks for your response. 

based on my researches about using LXQt as a service on guix (like other desktop services previously defined), I found following comment on LXQt's Github: https://github.com/lxqt/lxqt/issues/1521#issuecomment-405097453

It seems that I need to customize `$XDG_CONFIG_DIRS` in order to be able to load  session files from `prefix/etc/share` instead of `prefix/etc/xdg` but I couldn't find a proper way to do this, and  hoped that defining a shepherd service with modified environment variables in it's start script could help. 

do we have any reference about modification of environment variables during service start? 

Thanks,
Reza



On Wed, May 15, 2019, at 7:58 AM, Meiyo Peng wrote:
> Hi,
> 
> Reza Alizadeh Majd writes:
> 
> > I'll try to create a service for `lxqt-desktop` based on same definition on [nixos](https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/desktop-managers/lxqt.nix).
> > but my service definition won't start and  here is my proposed definition for this service:
> 
> Thank you for your work on LXQt.
> 
> > ;;;
> > ;;; LXQt desktop service.
> > ;;;
> >
> > (define-record-type* <lxqt-desktop-configuration> lxqt-desktop-configuration
> >   make-lxqt-desktop-configuration
> >   lxqt-desktop-configuration
> >   (lxqt-package lxqt-package (default lxqt)))
> >
> > (define (lxqt-shepherd-service config)
> >   "Return a shepherd service for @command{lxqt-session}"
> >   (let ((lxqt-session ((package-direct-input-selector "lxqt-session")
> >                        (lxqt-package config))))
> >     (list (shepherd-service
> >             (provision '(lxqt))
> >             ; (requirement '())
> >             (documentation "Run the lxqt session")
> >             (start #~(make-forkexec-constructor
> >                       (list(string-append #$lxqt-session "/bin/startlxqt"))
> >                       #:environment-variables
> >                       (list (string-append "XDG_CONFIG_DIRS="
> >                                            "$XDG_CONFIG_DIRS;/run/current-system/profile/etc/xdg")
> >                             (string-append "XDG_DATA_DIRS="
> >                                            "$XDG_DATA_DIRS;/run/current-system/profile/share"))
> >             (stop #~(make-kill-destructor))))))
> 
> I don't think we should start the LXQt session from a shepherd service.
> A desktop session should be started by a display manager like GDM or
> SDDM.  A display manager can find these desktop sessions and provides
> choices on login screen if a desktop package provides correct session
> files in prefix/share/xsessions (or prefix/share/wayland-sessions for
> wayland sessions).  I am not a nix expert but I think the nix file you
> referred to tries to define a desktop session file for LXQt rather than
> automatically start it upon system startup.
> 
> > (define lxqt-desktop-service-type
> >   (service-type
> >     (name 'lxqt-desktop)
> >     (extensions
> >       (list
> >             (service-extension shepherd-root-service-type
> >                                lxqt-shepherd-service)
> >             (service-extension profile-service-type
> >                                (compose list
> >                                         lxqt-package))))
> >     (default-value (lxqt-desktop-configuration))
> >     (description "Run the LXQt desktop environment.")))
> >
> > (define-deprecated (lxqt-desktop-service #:key
> >                                          (config
> >                                           (lxqt-desktop-configuration)))
> >   lxqt-desktop-service-type
> >   "Return a service that adds the @code{lxqt} package to the system profile, and
> > extends polkit with the actions from @code{lxqt-policykit}."
> >   (service lxqt-desktop-service-type config))
> 
> Apparently we should not use (define-deprecated ...) to define new variables.
> 
> > could anyone help on this matter ?
> 
> What are you trying to achieve by adding the lxqt-desktop-service-type?
> 
> 
> --
> Meiyo Peng
> https://www.pengmeiyu.com/
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem on LXQt service definition
  2019-05-15  9:47   ` Reza Alizadeh Majd
@ 2019-05-15 13:53     ` L p R n d n
  0 siblings, 0 replies; 4+ messages in thread
From: L p R n d n @ 2019-05-15 13:53 UTC (permalink / raw)
  To: Reza Alizadeh Majd; +Cc: help-guix

Hello

"Reza Alizadeh Majd" <r.majd@pantherx.org> writes:

> Hi, 
>
> Thanks for your response. 
>
> based on my researches about using LXQt as a service on guix (like other desktop
> services previously defined), I found following comment on LXQt's Github:
> https://github.com/lxqt/lxqt/issues/1521#issuecomment-405097453
>
> It seems that I need to customize `$XDG_CONFIG_DIRS` in order to be able to load
> session files from `prefix/etc/share` instead of `prefix/etc/xdg` but I couldn't
> find a proper way to do this, and hoped that defining a shepherd service with
> modified environment variables in it's start script could help.
>
> do we have any reference about modification of environment variables during service start? 
>
> Thanks,
> Reza
>

Sorry if I'm beside the point, just want to be sure, did you try to
get lxqt by just adding it to your system profile?
I tried lxqt once and I don't remember experiencing the problems
described in your link.

Also, from what I've seen in gnu/services/desktop.scm, desktop services are
often just polkit or dbus extensions, if some lxqt packages need a
special environment variable, another solution is to modify the package
definition with a `wrap-program` phase or something. This way, the
problem should be solved even if the user doesn't use the service.



Thanks,

L  p R n  d n

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-15 11:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-13 18:33 Problem on LXQt service definition Reza Alizadeh Majd
2019-05-15  3:28 ` Meiyo Peng
2019-05-15  9:47   ` Reza Alizadeh Majd
2019-05-15 13:53     ` L p R n d n

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.