mbox series

[bug#61483,0/5] Some basic Home Shepherd Services

Message ID 20230213164642.24419-1-janneke@gnu.org
Headers show
Series Some basic Home Shepherd Services | expand

Message

Janneke Nieuwenhuizen Feb. 13, 2023, 4:46 p.m. UTC
From: "Janneke Nieuwenhuizen" <janneke@gnu.org>

Hi!

I've been waiting for Guix Home to offer some basic shepherd services for most
used daemons, replacing the neat shepherd hack described in

    https://guix.gnu.org/en/blog/2020/gnu-shepherd-user-services/

that I've been using, and am a bit puzzled as to why this didn't happen.  Are
people using Guix Home?

Anyway, here's my attempt to address this, adding ssh-agent, git-daemon, and
also the probably less-used kodi and znc that I use on my home server.

To add a git-daemon and ssh-agent to your guix home profile, you need
a home-configuration.scm that has something like this:

--8<---------------cut here---------------start------------->8---
(use-modules (gnu home)
             (gnu home services shells)
             (gnu home services shepherd)
             (gnu home services shepherd-xyz)
             (gnu packages)
             (gnu packages base)
             (gnu services)
             (guix gexp))

(services
 (list (service home-shepherd-service-type)
       (service home-git-daemon-service-type)
       (service home-ssh-agent-service-type)))
--8<---------------cut here---------------end--------------->8---

The weird thing is that after running

    ./pre-inst-env guix home reconfigure home-configuration.scm

the shepherd starts automatically, starting ssh-agent and git-daemon.  Upon a
fresh login, however, it seems the shepherd must still be started manually,
kind of defeating its purpose as a home service...

Thoughts?

Greetings,
Janneke

Also pushed to https://gitlab.com/janneke/guix/-/commits/wip-home/

Janneke Nieuwenhuizen (5):
  DRAFT gnu: home: services: Add home-git-daemon-service-type.
  DRAFT gnu: home: services: Add home-ssh-agent-service-type.
  DRAFT gnu: home: services: Add home-znc-service-type.
  DRAFT gnu: home: services: Add home-kodi-service-type.
  DRAFT doc: Document Home Shepherd Services.

 doc/guix.texi                      |  90 ++++++++++-
 gnu/home/services/shepherd-xyz.scm | 239 +++++++++++++++++++++++++++++
 gnu/local.mk                       |   3 +-
 3 files changed, 330 insertions(+), 2 deletions(-)
 create mode 100644 gnu/home/services/shepherd-xyz.scm

Comments

Janneke Nieuwenhuizen Feb. 14, 2023, 3:14 p.m. UTC | #1
Jan (janneke) Nieuwenhuizen writes:

> The weird thing is that after running
>
>     ./pre-inst-env guix home reconfigure home-configuration.scm
>
> the shepherd starts automatically, starting ssh-agent and git-daemon.  Upon a
> fresh login, however, it seems the shepherd must still be started manually,
> kind of defeating its purpose as a home service...
>
> Thoughts?

Okay, after playing with this some more using a clean account all seems
to work fine.  Apparently there was some weird interaction with my
current shepherd-service setup interacted.

Greetings,
Janneke
Ludovic Courtès March 4, 2023, 5:01 p.m. UTC | #2
Howdy!

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

> I've been waiting for Guix Home to offer some basic shepherd services for most
> used daemons, replacing the neat shepherd hack described in
>
>     https://guix.gnu.org/en/blog/2020/gnu-shepherd-user-services/
>
> that I've been using, and am a bit puzzled as to why this didn't happen.  Are
> people using Guix Home?

I am!  :-)

Possible reasons not all the services described there made it into Guix
Home: (1) needs vary :-), (2) it’s possible to migrate incrementally,
with some things handled with Home while others are still managed “the
old way” (that’s what I do), and (3) rde is kinda “competing” with Home
by providing a whole bunch of services, giving less of an incentive to
migrate them (it’s an unfortunate issue we identified at the time Home
got merged).

But with contributions like these, the situation will improve!

> Anyway, here's my attempt to address this, adding ssh-agent, git-daemon, and
> also the probably less-used kodi and znc that I use on my home server.

Nice.

Ludo’.
Janneke Nieuwenhuizen March 5, 2023, 6:18 p.m. UTC | #3
Ludovic Courtès writes:

Hey!

> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> I've been waiting for Guix Home to offer some basic shepherd services for most
>> used daemons, replacing the neat shepherd hack described in
>>
>>     https://guix.gnu.org/en/blog/2020/gnu-shepherd-user-services/
>>
>> that I've been using, and am a bit puzzled as to why this didn't happen.  Are
>> people using Guix Home?
>
> I am!  :-)

Oh, good.  I'v been tempted for quite a while and will try to switch
when this patch series goes in.  I'll be moving bits the
executable/configuration bits (that are without secrets) from my
home.git to guix-home.

> Possible reasons not all the services described there made it into Guix
> Home: (1) needs vary :-),

yeah...could be I'm the only one using kodi and znc, but I expected
ssh-agent to be kinda popular...

> (2) it’s possible to migrate incrementally,
> with some things handled with Home while others are still managed “the
> old way” (that’s what I do),

That sounds like a stategy I'll be following too

> and (3) rde is kinda “competing” with Home by providing a whole bunch
> of services, giving less of an incentive to migrate them (it’s an
> unfortunate issue we identified at the time Home got merged).

Ouch, why that's...terrible?  Is there any reason stuff is not
contributed "up stream"? ;)

> But with contributions like these, the situation will improve!

Yay!  Let's go for that, then.

Greetings,
Janneke