From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Deleting services from %desktop-services in operating system declaration Date: Sat, 23 Jan 2016 19:43:00 +0300 Message-ID: <87zivw6ycr.fsf@gmail.com> References: <87io2nu95d.fsf@gnu.org> <6dc1e0b7fdda09d86a990c97484b5964@riseup.net> 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]:38395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aN1HE-0007fY-UW for help-guix@gnu.org; Sat, 23 Jan 2016 11:43:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aN1HB-0003zQ-Nq for help-guix@gnu.org; Sat, 23 Jan 2016 11:43:04 -0500 In-Reply-To: <6dc1e0b7fdda09d86a990c97484b5964@riseup.net> (swedebugia@riseup.net's message of "Sat, 23 Jan 2016 14:09:58 +0100") 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 swedebugia@riseup.net (2016-01-23 16:09 +0300) wrote: > On 2016-01-21 00:24, ludo@gnu.org wrote: >> swedebugia@riseup.net skribis: >> >>> I have trouble getting the syntax right to delete avahi and wicd from >>> my config.scm. >> >> The correct syntax would be: >> >> (operating-system >> ;; =E2=80=A6 >> (services (remove (lambda (service) >> (or (eq? (service-kind service) >> wicd-service-type) >> (eq? (service-kind service) >> avahi-service-type))) >> %desktop-services))) > > I tried this and got this error: > # guix system reconfigure /etc/config/config.scm > guix system: error: failed to load '/etc/config/config.scm': > /etc/config/config.scm:48:12: In procedure #: > /etc/config/config.scm:48:12: In procedure module-lookup: Unbound > variable: remove 'remove' procedure is from (srfi srfi-1) module, so you need to use it in your config (see below). Note that after fixing it, you'll get complaints about other unbound variables: - 'avahi-service-type': it is from (gnu services avahi); - 'tor-service': it is from (gnu services networking); - 'wicd-service-type': it is also from (gnu services networking), but it is not exported (I think we should fix it), so now you have to use it like this: (@@ (gnu services networking) wicd-service-type) which means: "give me 'wicd-service-type' from (gnu services networking) module, and I don't care if it's not exported". > Config here: https://paste.debian.net/367385/ I paste your config here for convenience: > (use-modules (gnu) (gnu system nss)) (use-modules (gnu) (gnu system nss) (srfi srfi-1)) > (use-service-modules desktop) > (use-package-modules xfce ratpoison certs) > (operating-system > (host-name "unknown") > (timezone "Europe/Stockholm") > (locale "en_US.UTF-8") > ;; Assuming /dev/sdX is the target hard disk, and "root" is > ;; the label of the target root file system. > (bootloader (grub-configuration (device "/dev/sda"))) > (file-systems (cons* (file-system > (device "guix") > (title 'label) > (mount-point "/") > (type "ext4")) > (file-system > (device "home") > (title 'label) > (mount-point "/home") > (type "ext4")) > %base-file-systems)) > (swap-devices '("/dev/sdb3")) > (users (cons (user-account > (name "sdb") > (comment "swedebugia") > (group "users") > (supplementary-groups '("wheel" "netdev" > "audio" "video")) > (home-directory "/home/sdb")) > %base-user-accounts)) > ;; Add Xfce and Ratpoison; that allows us to choose > ;; sessions using either of these at the log-in screen. > (packages (cons* xfce ratpoison ;desktop environments > nss-certs ;for HTTPS access > %base-packages)) > ;; Use the "desktop" services, which include the X11 > ;; log-in service, networking with Wicd, and more. > (services (remove (lambda (service) > (or (eq? (service-kind service) > wicd-service-type) > (eq? (service-kind service) > avahi-service-type))) > %desktop-services)) > (services (cons* (tor-service) %desktop-services)) You shouldn't (!) use 'services' (or any other operating-system field more than *ONCE*). You can combine 'cons*' and 'remove' like this: (services (cons* (tor-service) (remove (lambda (service) (or (eq? (service-kind service) avahi-service-type) (eq? (service-kind service) (@@ (gnu services networking) wicd-service-typ= e)) (eq? (service-kind service) (@@ (gnu services networking) ntp-service-type= )))) %desktop-services))) Note: if you want to remove wicd service, you also need to remove ntp service, otherwise you'll get: guix system: error: service 'ntpd' requires 'networking', which is undefi= ned > ;; Allow resolution of '.local' host names with mDNS. > (name-service-switch %mdns-host-lookup-nss)) --=20 Alex