[bug#57692] home: shepherd: Add shepherd/init.scm to XDG_CONFIG_HOME.
Commit Message
* 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
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
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
>
@@ -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)