From mboxrd@z Thu Jan 1 00:00:00 1970 From: Subject: Re: Deleting unnecessary services from %desktop-services Date: Sat, 1 Dec 2018 06:06:59 +0100 (CET) Message-ID: References: <> <87bm6am94n.fsf@ambrevar.xyz> <> <87efb32s1f.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_61778_993695019.1543640820215" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSxdf-0005nK-Iq for help-guix@gnu.org; Sat, 01 Dec 2018 00:16:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSxdc-00007i-F5 for help-guix@gnu.org; Sat, 01 Dec 2018 00:16:23 -0500 Received: from w1.tutanota.de ([81.3.6.162]:43120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSxdc-00007W-5F for help-guix@gnu.org; Sat, 01 Dec 2018 00:16:20 -0500 Received: from w2.tutanota.de (unknown [192.168.1.163]) by w1.tutanota.de (Postfix) with ESMTP id 36265FBF142 for ; Sat, 1 Dec 2018 05:07:00 +0000 (UTC) In-Reply-To: <87efb32s1f.fsf@elephly.net> 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" To: Ricardo Wurmus Cc: Help Guix ------=_Part_61778_993695019.1543640820215 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, Ricardo Wurmus! ok, thank you. But now I've not achieved what I need= . avahi-damon, ntpd, networking rest in my system.=20 =C2=A0 (services (cons*=C2=A0 ;;(tor-service) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (service postgresql-service-type) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (xfce-desktop-service) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (modify-services=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=20 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (remove (lambda (servic= e) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (eq? (servi= ce-kind service)=20 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 avahi-service-type ntp-service-type networki= ng)) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 %desktop-se= rvices =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 );end of remove =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (elogind-service-type =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 c =3D> (elo= gind-configuration (handle-lid-switch 'ignore))) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 );;end of modify desktop-services =C2=A0 ));;end of services Also they are mentioned in use-modules: (use-modules (gnu) (gnu system nss) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (g= nu services desktop) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (s= rfi srfi-1) ;;for remove function =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (g= nu services networking) ;;for remove ntp =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (g= nu services avahi) ;;for remove avahi =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (g= nu services xorg) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (g= nu services databases);;for postgres ) (use-service-modules desktop) (use-package-modules certs gnome) But if I delete this use-modules lines, remove line will give the errors: u= nbound variable avahi-service-type, ntp-service-type, networking.=20 So, how to correct I do not know. Nov 30, 2018, 5:55 AM by rekado@elephly.net : > > znavko@tutanota.com > writes: > >> Guile Manual says 'remove' returns elements. But I need to remove elemen= ts. >> > > =E2=80=9Cremove=E2=80=9D does what you want. The =E2=80=9Cservices=E2=80= =9D field expects a list of > services. When using =E2=80=9Cremove=E2=80=9D on a list of services it r= eturns a new > list of (possibly fewer) services. That=E2=80=99s exactly what you want. > > =E2=80=9Cremove!=E2=80=9D, on the other hand, mutates an existing value; = you would need > to have it operate on an existing variable to mutate it. =E2=80=9Cremove= =E2=80=9D is > much more elegant. > > -- > Ricardo > ------=_Part_61778_993695019.1543640820215 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello, Ricardo Wurmus! ok, thank you. But now I've not = achieved what I need. avahi-damon, ntpd, networking rest in my system.

  (service= s (cons*  ;;(tor-service)
      &nb= sp;            = (service postgresql-service-type)
      = ;            &n= bsp; (xfce-desktop-service)
       =              (m= odify-services     
    =             &nb= sp;     (remove (lambda (service)
  &nbs= p;            &= nbsp;        (eq? (service-kind service)=
           &n= bsp;            = ;       avahi-service-type ntp-service-type n= etworking))
         &nbs= p;            &= nbsp; %desktop-services
       &nbs= p;            &= nbsp; );end of remove
        =             &nb= sp; (elogind-service-type
       &n= bsp;            = ;    c =3D> (elogind-configuration (handle-lid-switch 'ig= nore)))
          &n= bsp;         );;end of modify deskt= op-services
  ));;end of services
=
Also they are mentioned in use-modules:

(use-modules (g= nu) (gnu system nss)
        &= nbsp;    (gnu services desktop)
    = ;         (srfi srfi-1) ;;for remov= e function
          = ;   (gnu services networking) ;;for remove ntp
  &= nbsp;          (gnu services a= vahi) ;;for remove avahi
       &nb= sp;     (gnu services xorg)
   &nbs= p;         (gnu services databases)= ;;for postgres
)
(use-service-modules desktop)
(use-package-= modules certs gnome)

But if I delete this use-modules lines, remove line will give the errors:=20 unbound variable avahi-service-type, ntp-service-type, networking.
So, how to correct I do not know.


Nov 30, 2018, 5:55 AM by rekado@elephly.net:

znavko@tutanota.com writes:
Guile Manual says 'remove' returns elements. But I need to remove ele= ments.

=E2=80=9Cremove=E2=80=9D does what you want. The =E2=80=9Cservices=E2=80= =9D field expects a list of
services. When = using =E2=80=9Cremove=E2=80=9D on a list of services it returns a new
=
list of (possibly fewer) services. That=E2=80=99= s exactly what you want.

=E2=80=9Cremove!=E2=80=9D, on the other hand, mutates an exist= ing value; you would need
to have it operate= on an existing variable to mutate it. =E2=80=9Cremove=E2=80=9D is
much more elegant.
<= br />
--
Ricardo

------=_Part_61778_993695019.1543640820215--