alezost / guix.el

Emacs interface for GNU Guix package manager
https://emacs-guix.gitlab.io/website/
GNU General Public License v3.0
141 stars 16 forks source link

Implement the Emacs interface for the GNU Shepherd #10

Closed wigust closed 6 years ago

wigust commented 6 years ago

Hello,

What do you think about implementing the Emacs interface for the GNU Shepherd?

Feautures:

Thanks, Oleg.

alezost commented 6 years ago

I also had this idea in the past, but I was too lazy to implement it :-)

Anyway since Shepherd is another piece of software, I think this Emacs interface should be a separate package (not a part of Emacs-Guix).

BTW there would be a problem with such Shepherd interface: if I understand correctly, you could only control user services with it, but not the system services, as you have to be root to make operations on the system services.

Or did you mean an interface for the "user Shepherd"? If so, implementing a bare minimum of features for such Emacs-Shepherd (or whatever) package would be rather easy.

wigust commented 6 years ago

Alex Kost notifications@github.com writes:

I also had this idea in the past, but I was too lazy to implement it :-)

Anyway since Shepherd is another piece of software, I think this Emacs interface should be a separate package (not a part of Emacs-Guix).

Agreed, but there are some only Guix features which could be implemented as well. Here is a one:

$ guix system search web
name: nginx
location: gnu/services/web.scm:319:2
extends: shepherd-root activate account
relevance: 1

name: fcgiwrap
location: gnu/services/web.scm:381:2
extends: shepherd-root account
relevance: 1

We could have a main separate package and an addition in this project though.

BTW there would be a problem with such Shepherd interface: if I understand correctly, you could only control user services with it, but not the system services, as you have to be root to make operations on the system services.

Yes. Is it problem? We already have only root operations, for example switching GuixSD system generations in M-x guix-system-generations.

Or did you mean an interface for the "user Shepherd"? If so, implementing a bare minimum of features for such Emacs-Shepherd (or whatever) package would be rather easy.

At least user's Shepherd will be useful.

Maybe we can even have something like Customize Group interface, but for services. So you could start writing new services by changing variables in forms.

Oleg.

alezost commented 6 years ago

Oleg Pykhalov (2017-11-01 03:16 +0000) wrote:

Alex Kost notifications@github.com writes:

I also had this idea in the past, but I was too lazy to implement it :-)

Anyway since Shepherd is another piece of software, I think this Emacs interface should be a separate package (not a part of Emacs-Guix).

Agreed, but there are some only Guix features which could be implemented as well. Here is a one:

$ guix system search web name: nginx location: gnu/services/web.scm:319:2 extends: shepherd-root activate account relevance: 1

name: fcgiwrap location: gnu/services/web.scm:381:2 extends: shepherd-root account relevance: 1

All such Guix features related to Shepherd make sense only for the "root" (system) Shepherd. And as you noticed I am very skeptical about making Emacs package that is intended to work from a root Emacs. I don't like to run software from root, especially such "big" one as Emacs.

We could have a main separate package and an addition in this project though.

I believe this Emacs interface for Shepherd should be a separate package, I don't see how it can be integrated with Emacs-Guix. Anyway it is too early to talk about it, at first Emacs-Shepherd (or whatever it would be named) should appear :-)

BTW there would be a problem with such Shepherd interface: if I understand correctly, you could only control user services with it, but not the system services, as you have to be root to make operations on the system services.

Yes. Is it problem?

IMO, it is not a problem, it is a blocker! Who would use Emacs package that requires running Emacs as root?

We already have only root operations, for example switching GuixSD system generations in M-x guix-system-generations.

These operations were not implemented specifically, they were "inherited" from M-x guix-generations, so these features costed nothing, but I doubt that many users run emacs as root to remove system generations, for example.

Or did you mean an interface for the "user Shepherd"? If so, implementing a bare minimum of features for such Emacs-Shepherd (or whatever) package would be rather easy.

At least user's Shepherd will be useful.

Maybe we can even have something like Customize Group interface, but for services. So you could start writing new services by changing variables in forms.

Wow, unexpected idea! I'm not a fan of "Customize" interface, so it is too radical for me, but this is interesting.

P.S. Sorry if this message sounds harsh. The reason is: several months ago I completely lost any interest in software activity, so currently my policy is to write as less code as possible :smile:

-- Alex

Ambrevar commented 6 years ago

What about adding Guix support to daemon.el?

Regarding the root issue: isn't it possible to use TRAMP to execute only the required commands as root?

alezost commented 6 years ago

What about adding Guix support to daemon.el?

Oh, thanks for pointing! Hopefully, someone will add support for Shepherd/Guix service management to that package ;-)

Regarding the root issue: isn't it possible to use TRAMP to execute only the required commands as root?

If I understand correctly, this is exactly what they use in daemons--sudo procedure:

https://github.com/cbowdon/daemons.el/blob/master/daemons.el#L238-L241

Ambrevar commented 6 years ago

I've opened an issue upstream about it: https://github.com/cbowdon/daemons.el/issues/7.

alezost commented 6 years ago

Sorry, I am closing this issue. Nowadays Emacs-Guix has a way to look at services (M-x guix-all-services for example). As for interacting with Shepherd, I'm afraid it is not going to be supported: as I wrote, I think an interface for Shepherd should be a separate project.