From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Invoking user shepherd; Was: Re: Defining *user* services in Guix Date: Tue, 13 Jun 2017 10:00:51 +0200 Message-ID: <87o9ts48r0.fsf@gnu.org> References: <87o9vowfn0.fsf@gmail.com> <20170422203131.610f2a30@scratchpost.org> <878tmsghzk.fsf@gnu.org> <87inlvdr76.fsf@gmail.com> <87r30hbbi7.fsf@gmail.com> <87fugwsx2s.fsf@elephly.net> <8737cu7z0s.fsf@gnu.org> <877f24pnem.fsf@gmail.com> <87mvavk243.fsf@gnu.org> <20170611032900.6ac194b9@scratchpost.org> <877f0iorer.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKgl0-00028y-5d for guix-devel@gnu.org; Tue, 13 Jun 2017 04:01:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKgkw-0000oo-U4 for guix-devel@gnu.org; Tue, 13 Jun 2017 04:00:58 -0400 In-Reply-To: <877f0iorer.fsf@gmail.com> (Mathieu Othacehe's message of "Sun, 11 Jun 2017 10:33:00 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Mathieu Othacehe Cc: guix-devel@gnu.org Hello! Mathieu Othacehe 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 =E2=80=9Cguix user user-manifest.scm=E2=80=9D and it generates sh= epherd.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=E2=80=99.