From mboxrd@z Thu Jan 1 00:00:00 1970 From: swedebugia@riseup.net Subject: Re: Deleting services from %desktop-services in operating system declaration Date: Mon, 25 Jan 2016 12:20:02 +0100 Message-ID: References: <87io2nu95d.fsf@gnu.org> <6dc1e0b7fdda09d86a990c97484b5964@riseup.net> <87zivw6ycr.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNfBo-0002Ub-J8 for help-guix@gnu.org; Mon, 25 Jan 2016 06:20:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aNfBk-0004zd-Ee for help-guix@gnu.org; Mon, 25 Jan 2016 06:20:08 -0500 In-Reply-To: <87zivw6ycr.fsf@gmail.com> 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: Alex Kost Cc: help-guix On 2016-01-23 17:43, Alex Kost wrote: > swedebugia@riseup.net (2016-01-23 16:09 +0300) wrote: >=20 >> On 2016-01-21 00:24, ludo@gnu.org wrote: >>> swedebugia@riseup.net skribis: >>>=20 >>>> I have trouble getting the syntax right to delete avahi and wicd=20 >>>> from >>>> my config.scm. >>>=20 >>> The correct syntax would be: >>>=20 >>> (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))) >>=20 >> 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 >=20 > 'remove' procedure is from (srfi srfi-1) module, so you need to use it > in your config (see below). >=20 > Note that after fixing it, you'll get complaints about other unbound > variables: >=20 > - 'avahi-service-type': it is from (gnu services avahi); >=20 > - 'tor-service': it is from (gnu services networking); >=20 > - 'wicd-service-type': it is also from (gnu services networking), but=20 > it > is not exported (I think we should fix it), so now you have to use it > like this: >=20 > (@@ (gnu services networking) wicd-service-type) >=20 > which means: "give me 'wicd-service-type' from (gnu services > networking) module, and I don't care if it's not exported". >=20 >> Config here: https://paste.debian.net/367385/ >=20 > I paste your config here for convenience: >=20 >> (use-modules (gnu) (gnu system nss)) >=20 > (use-modules > (gnu) > (gnu system nss) > (srfi srfi-1)) >=20 >> (use-service-modules desktop) >> (use-package-modules xfce ratpoison certs) >=20 >> (operating-system >> (host-name "unknown") >> (timezone "Europe/Stockholm") >> (locale "en_US.UTF-8") >=20 >> ;; 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")) >=20 >> (file-system >> (device "home") >> (title 'label) >> (mount-point "/home") >> (type "ext4")) >> %base-file-systems)) >=20 >> (swap-devices '("/dev/sdb3")) >=20 >> (users (cons (user-account >> (name "sdb") >> (comment "swedebugia") >> (group "users") >> (supplementary-groups '("wheel" "netdev" >> "audio" "video")) >> (home-directory "/home/sdb")) >> %base-user-accounts)) >=20 >> ;; 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)) >=20 >> ;; 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)) >=20 > You shouldn't (!) use 'services' (or any other operating-system field > more than *ONCE*). You can combine 'cons*' and 'remove' like this: >=20 > (services > (cons* (tor-service) > (remove (lambda (service) > (or (eq? (service-kind service) > avahi-service-type) > (eq? (service-kind service) > (@@ (gnu services networking)=20 > wicd-service-type)) > (eq? (service-kind service) > (@@ (gnu services networking)=20 > ntp-service-type)))) > %desktop-services))) Thanks for the tip on how to combine them! >=20 > Note: if you want to remove wicd service, you also need to remove ntp > service, otherwise you'll get: >=20 > guix system: error: service 'ntpd' requires 'networking', which is=20 > undefined I got this error a couple of times. Thanks for the explanation - this=20 was really helpful in getting my config to work properly. I decided to keep wicd after all and just removed avahi. It seems that=20 avahi is also not exported. The full config with my comments is found here:=20 https://paste.debian.net/368031/ I'm effectively learning Scheme/Guile while trying to hack GuixSD and I=20 like it :D cheers sdb