diff mbox

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

Message ID 87pm98oh6w.fsf@gnu.org
State New
Headers show

Commit Message

Janneke Nieuwenhuizen March 16, 2023, 3:21 p.m. UTC
Jan Nieuwenhuizen writes:

> Ludovic Courtès writes:
>
>> Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
>>
>>> From: "Janneke Nieuwenhuizen" <janneke@gnu.org>
>>>
>>> * gnu/home/services/media.scm: New file.
>>> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
>>> * doc/guix.texi (Media Home Services): Document it in new subsection.
>>
>> Please also add the new file to ‘po/guix/POTFILES.in’ so descriptions
>> can be translated.  Otherwise LGTM!
>
> Great, done.
>
>> In the meantime I realized I don’t have to push it on your behalf, so
>> I’ll let you take care of it—sorry for the confusion!
>
> Thanks, pushed to master as
>
>     70056b1b2beebbc9f8ea2c34eacc57f379368ab3

Well, it seems I added a dependency to the shepherd, module (shepherd
support), for things like

    %user-runtime-dir

I locally applied the attached patch to add Shepherd as an input (not
sure if that would be OK), but now `make update-guix-package' fails:

--8<---------------cut here---------------start------------->8---
$ make update-guix-package
git rev-parse HEAD
bd086f1718123a4d180aa6f2178828a83025ab35
./pre-inst-env "/gnu/store/f4w31qrim35yfnppacfmig491x1nwi3x-profile/bin/guile"			\
   ./build-aux/update-guix-package.scm	\
   "`git rev-parse HEAD`"
error: Failed to find the origin git remote.
make: *** [Makefile:7178: update-guix-package] Error 1
--8<---------------cut here---------------end--------------->8---

Not sure what to do, possibly best to revert the home services patches
again until we have (consensus on a) fix.

Greetings,
Janneke

Comments

Ludovic Courtès March 16, 2023, 4:16 p.m. UTC | #1
Hi again,

Jannneke Nieuwenhuizen <janneke@gnu.org> skribis:

>>> In the meantime I realized I don’t have to push it on your behalf, so
>>> I’ll let you take care of it—sorry for the confusion!
>>
>> Thanks, pushed to master as
>>
>>     70056b1b2beebbc9f8ea2c34eacc57f379368ab3
>
> Well, it seems I added a dependency to the shepherd, module (shepherd
> support), for things like
>
>     %user-runtime-dir

I pushed a fix as be7e2bf7ebc10bb4e5808ddeabc4b914f575865f, tested with
‘guix home container’.

> I locally applied the attached patch to add Shepherd as an input (not
> sure if that would be OK), but now `make update-guix-package' fails:

Guix in general on the “host side” should not depend on the Shepherd,
there’s no reason to do so.

The solution for Home or System services is to depend on the Shepherd
but only in the run-time code stage.  This is what I did in
be7e2bf7ebc10bb4e5808ddeabc4b914f575865f: code that needs to refer to
‘%user-runtime-dir’ is staged such that it will look up that variable at
run time, when the user ‘shepherd’ process is started.

That’s really what we want here, because it also ensures that the code
sees the right value for ‘%user-runtime-dir’ (otherwise it would see the
configuration-time value, which could be different).

Apologies for overlooking that!

Ludo’.
Janneke Nieuwenhuizen March 17, 2023, 11:57 a.m. UTC | #2
Ludovic Courtès writes:

Hello, 

> Jannneke Nieuwenhuizen <janneke@gnu.org> skribis:
>
[..]
>> Well, it seems I added a dependency to the shepherd, module (shepherd
>> support), for things like
>>
>>     %user-runtime-dir
>
> I pushed a fix as be7e2bf7ebc10bb4e5808ddeabc4b914f575865f, tested with
> ‘guix home container’.

Thank you!

>> I locally applied the attached patch to add Shepherd as an input (not
>> sure if that would be OK), but now `make update-guix-package' fails:
>
> Guix in general on the “host side” should not depend on the Shepherd,
> there’s no reason to do so.
>
> The solution for Home or System services is to depend on the Shepherd
> but only in the run-time code stage.  This is what I did in
> be7e2bf7ebc10bb4e5808ddeabc4b914f575865f: code that needs to refer to
> ‘%user-runtime-dir’ is staged such that it will look up that variable at
> run time, when the user ‘shepherd’ process is started.

Oh, that's so nice!

> That’s really what we want here, because it also ensures that the code
> sees the right value for ‘%user-runtime-dir’ (otherwise it would see the
> configuration-time value, which could be different).
>
> Apologies for overlooking that!

Well, I also failed to see that I pulled in the Shepherd as a dependency
until sarg "complained" about a missing file on IRC.  Simply copied this
from my direct Shepherd solution, ugh.  Sorry!

Greetings,
Janneke
diff mbox

Patch

From bd086f1718123a4d180aa6f2178828a83025ab35 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
Date: Thu, 16 Mar 2023 16:08:01 +0100
Subject: [PATCH] gnu: guix: Add shepherd as input dependency.

The home services depend on (shepherd support).

* gnu/packages/package-management.scm (guix)[inputs]: Add shepherd-0.9.
---
 gnu/packages/package-management.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index d27c8a91ef..8a05955d1a 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -12,7 +12,7 @@ 
 ;;; Copyright © 2019-2023 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de>
 ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;; Copyright © 2020 Jesse Gibbons <jgibbons2357+guix@gmail.com>
 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
@@ -41,6 +41,7 @@  (define-module (gnu packages package-management)
   #:use-module (gnu artwork)
   #:use-module (gnu packages)
   #:use-module (gnu packages acl)
+  #:use-module (gnu packages admin)
   #:use-module (gnu packages attr)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages autotools)
@@ -462,7 +463,8 @@  (define code
          ("disarchive" ,disarchive)               ;for 'guix perform-download'
          ("guile-lzma" ,guile-lzma)               ;for Disarchive
 
-         ("glibc-utf8-locales" ,glibc-utf8-locales)))
+         ("glibc-utf8-locales" ,glibc-utf8-locales)
+         ("shepherd" ,shepherd-0.9)))
       (propagated-inputs
        `(("guile-gnutls" ,guile-gnutls)
          ;; Avahi requires "glib" which doesn't cross-compile yet.
-- 
2.39.1