diff mbox series

[bug#57692] home: shepherd: Add shepherd/init.scm to XDG_CONFIG_HOME.

Message ID 87v8pwg1n7.fsf@trop.in
State Accepted
Headers show
Series [bug#57692] home: shepherd: Add shepherd/init.scm to XDG_CONFIG_HOME. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Andrew Tropin Sept. 9, 2022, 12:42 p.m. UTC
* gnu/home/services/shepherd.scm: Add shepherd/init.scm to XDG_CONFIG_HOME.
---
Without this change it's not possible to start shepherd manually.  Even
if we disable extension of home-run-on-first-login-service-type via
(home-shepherd-configuration-auto-start? #f), we don't know what
shepherd configuration file to specify to shepherd --config.

 gnu/home/services/shepherd.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Liliana Marie Prikler Sept. 9, 2022, 3:15 p.m. UTC | #1
Am Freitag, dem 09.09.2022 um 15:42 +0300 schrieb Andrew Tropin:
> 
> * gnu/home/services/shepherd.scm: Add shepherd/init.scm to
> XDG_CONFIG_HOME.
Should be

* gnu/home/services/shepherd.scm (add-shepherd-configuration): New
variable.
(home-shepherd-service-type)[extensions]: Add home-xdg-configuration-
files-service-type.

Note that I'm less sure on the second entry here, you might have to
refer to add-shepherd-configuration.

I'd personally prefer "shepherd-configuration-files" as a name for the
procedure or "shepherd-xdg-configuration-files" if we're super strict.

Other than that LGTM. 

Cheers
Andrew Tropin Sept. 9, 2022, 7:22 p.m. UTC | #2
On 2022-09-09 17:15, Liliana Marie Prikler wrote:

> Am Freitag, dem 09.09.2022 um 15:42 +0300 schrieb Andrew Tropin:
>> 
>> * gnu/home/services/shepherd.scm: Add shepherd/init.scm to
>> XDG_CONFIG_HOME.
> Should be
>
> * gnu/home/services/shepherd.scm (add-shepherd-configuration): New
> variable.
> (home-shepherd-service-type)[extensions]: Add home-xdg-configuration-
> files-service-type.

Right, will adjust it, thank you!

>
> Note that I'm less sure on the second entry here, you might have to
> refer to add-shepherd-configuration.
>
> I'd personally prefer "shepherd-configuration-files" as a name for the
> procedure or "shepherd-xdg-configuration-files" if we're super strict.

Sounds good.

>
> Other than that LGTM.
>
> Cheers
>
diff mbox series

Patch

diff --git a/gnu/home/services/shepherd.scm b/gnu/home/services/shepherd.scm
index 62ab0aadc6..c17ec2b0f5 100644
--- a/gnu/home/services/shepherd.scm
+++ b/gnu/home/services/shepherd.scm
@@ -130,12 +130,21 @@  (define (ensure-shepherd-gexp config)
         #$(reload-configuration-gexp config)
         #$(launch-shepherd-gexp config)))
 
+(define (add-shepherd-configuration config)
+  (let* ((shepherd (home-shepherd-configuration-shepherd config))
+         (services (home-shepherd-configuration-services config)))
+    `(("shepherd/init.scm"
+       ,(home-shepherd-configuration-file services shepherd)))))
+
 (define-public home-shepherd-service-type
   (service-type (name 'home-shepherd)
                 (extensions
                  (list (service-extension
                         home-run-on-first-login-service-type
                         launch-shepherd-gexp)
+                       (service-extension
+                        home-xdg-configuration-files-service-type
+                        add-shepherd-configuration)
                        (service-extension
                         home-activation-service-type
                         ensure-shepherd-gexp)