Hello! Mathieu Othacehe <m.othac...@gmail.com> 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’.