From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thompson, David" Subject: Re: Deleting services from %desktop-services in operating system declaration Date: Wed, 20 Jan 2016 09:17:15 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLtZV-0004NI-W8 for help-guix@gnu.org; Wed, 20 Jan 2016 09:17:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLtZU-0001uA-SA for help-guix@gnu.org; Wed, 20 Jan 2016 09:17:17 -0500 Received: from mail-yk0-x22c.google.com ([2607:f8b0:4002:c07::22c]:35242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLtZU-0001tf-GW for help-guix@gnu.org; Wed, 20 Jan 2016 09:17:16 -0500 Received: by mail-yk0-x22c.google.com with SMTP id x67so10732215ykd.2 for ; Wed, 20 Jan 2016 06:17:16 -0800 (PST) In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org To: swedebugia@riseup.net Cc: help-guix On Wed, Jan 20, 2016 at 7:42 AM, wrote: > Hi > > I have trouble getting the syntax right to delete avahi and wicd from my > config.scm. > > This did not work (inspecting with the REPL): > (services (cons* (tor-service) %desktop-services)) > (modify-services (alist-delete > wicd-service > %desktop-services)) > (modify-services (alist-delete > avahi-service > %desktop-services)) > > Neither this: > (services (cons* (tor-service) %desktop-services)) > (modify-services (alist-delete > wicd-service > avahi-service > %desktop-services)) > > The manual does not yet have examples of how to delete one or more entries > from the %base-services or other lists. > > Help would be appreciated :) First of all, %desktop-services is *not* an alist, so using alist-delete certainly won't work. Second, modify-services is *syntax*, so the form (alist-delete ...) is surely the wrong syntax. Below is the docstring for modify-services: Modify the services listed in SERVICES according to CLAUSES. Each clause must have the form: (TYPE VARIABLE => BODY) where TYPE is a service type, such as 'guix-service-type', and VARIABLE is an identifier that is bound within BODY to the value of the service of that TYPE. Consider this example: (modify-services %base-services (guix-service-type config => (guix-configuration (inherit config) (use-substitutes? #f) (extra-options '(\"--gc-keep-derivations\")))) (mingetty-service-type config => (mingetty-configuration (inherit config) (motd (plain-file \"motd\" \"Hi there!\"))))) It changes the configuration of the GUIX-SERVICE-TYPE instance, and that of all the MINGETTY-SERVICE-TYPE instances. This is a shorthand for (map (lambda (svc) ...) %base-services). Hopefully that provides enough of an example for you! You can retrieve the documentation associated with an object at the Guile REPL. Here's how you'd get this one: $ ./pre-inst-env guile GNU Guile 2.0.11 Copyright (C) 1995-2014 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> ,use (gnu services) scheme@(guile-user)> ,describe modify-services - Dave