From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: =?utf-8?Q?It=E2=80=99s?= building! Date: Sun, 22 Jan 2017 17:02:25 +0100 Message-ID: <87d1ff13se.fsf@elephly.net> References: <871svvrddj.fsf@gmail.com> <8760l7w88s.fsf@wasp.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVKbI-0006t1-56 for guix-devel@gnu.org; Sun, 22 Jan 2017 11:02:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cVKbE-0001q5-Va for guix-devel@gnu.org; Sun, 22 Jan 2017 11:02:40 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:21049) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cVKbE-0001q1-Nd for guix-devel@gnu.org; Sun, 22 Jan 2017 11:02:36 -0500 In-reply-to: <8760l7w88s.fsf@wasp.i-did-not-set--mail-host-address--so-tickle-me> 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: ng0 Cc: guix-devel@gnu.org, Maxim Cournoyer ng0 writes: > For me it fails, I tried to adopt this to my > %desktop-services-sans-ntpd but I haven't found the right way to > make use of it: > > (define %desktop-services-sans-ntpd > ;; List of services typically useful for a "desktop" use case. > (cons* (slim-service) > (screen-locker-service slock) > (screen-locker-service xlockmore "xlock") > (avahi-service) > (wicd-service) > (udisks-service) > (upower-service) > (colord-service) > (geoclue-service) > (polkit-service) > (elogind-service) > (dbus-service) > (guix-service-type config => This isn’t going to work because you ripped this chunk from a “modify-services” expression. > Identation broken because this happens when you copy from emacs > with X into terminal emacs. You can use C-M-q to reindent an expression. > Obviously this fails because "config" is not known. That’s because you’re not doing this within “modify-services”. > I'm open for ideas on how to erase ntp from the services in a > better way, I'm running a replacement for ntpd. You can use regular Scheme to filter lists, for example: (filter (compose not (cut eq? 'ntp <>) service-type-name service-kind) %desktop-services) This means: run through all elements of “%desktop-services”, extract the service type (“service-kind”), extract the type name from the kind (“service-type-name”), check if it’s equal to 'ntp (“(cut eq? 'ntp <>)”), then throw it out (“not”). The first argument to “filter” is just a big function. -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net