guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Invoking user shepherd; Was: Re: Defining *user* services in Guix


From: Ludovic Courtès
Subject: Re: Invoking user shepherd; Was: Re: Defining *user* services in Guix
Date: Tue, 13 Jun 2017 10:00:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Hello!

Mathieu Othacehe <address@hidden> skribis:

> I wrote a first draft of user services a month ago. The idea here is
> that guix user -r user-manifest.scm generates a script that lauches a
> user shepherd.
>
> For instance with the following user-manifest.scm :
>
> (define (redshift-service config)
>   (list (shepherd-service
>          (documentation "Run redshift.")
>          (provision '(redshift-test))
>          (requirement '())
>          (start #~(make-forkexec-constructor
>                    (list (string-append #$redshift "/bin/redshift")
>                          "-l" "48:2")))
>          (stop  #~(make-kill-destructor)))))
>
> (define redshift-service-type
>   (service-type
>    (name 'test-user)
>    (extensions
>     (list
>      (service-extension shepherd-user-service-type
>                         test-shepherd-service)))))
>
> (user-configuration
>  (services (list (service redshift-service-type #f))))
>
> I get a script that lauches shepherd himself starting redshift.

So you do “guix user user-manifest.scm” and it generates shepherd.conf
and spawns shepherd, right?  Sounds pretty cool!

> The plan here was to add a symlink, (don't know where !), pointing to
> the last generated shepherd script, and have the user start shepherd by
> executing the script pointed by the symlink in his .xinitrc for
> instance.

Maybe ~/.config/guix/services/start could be that symlink (and an
indirect GC root.)

Nice work!

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]