From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 4LdoGLY3VmDcLgAA0tVLHw (envelope-from ) for ; Sat, 20 Mar 2021 17:58:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id MihAFLY3VmDcawAAB5/wlQ (envelope-from ) for ; Sat, 20 Mar 2021 17:58:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 70F1511100 for ; Sat, 20 Mar 2021 18:58:13 +0100 (CET) Received: from localhost ([::1]:60070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNfrX-0001eT-LT for larch@yhetil.org; Sat, 20 Mar 2021 13:58:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNfrJ-0001eJ-AT for help-guix@gnu.org; Sat, 20 Mar 2021 13:57:57 -0400 Received: from knopi.disroot.org ([178.21.23.139]:40260) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNfrG-00038F-Ow for help-guix@gnu.org; Sat, 20 Mar 2021 13:57:57 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id F20BF57A21; Sat, 20 Mar 2021 18:57:50 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2RtvBjJtOuEN; Sat, 20 Mar 2021 18:57:48 +0100 (CET) Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1616263068; bh=b8AL7GCi9S9QOLzUlgC4ZrL2Ugyb/G5MqDVdNGAG0DY=; h=Date:From:Subject:To:In-Reply-To:References; b=GrsBYEcsHkP7eScXioK9rFHoL4MLmcl3lYuW4VIytSVEnKf28Vt0/k6uELWkRNSRL kK2eDIRu077Aq5zYkM9DevgRc0lyVFY37wKLClhT15/NrMXFZ/sTC6p+l19mNw5Smz mtJ3xUSFnoik3stk88uLV3ja1vnelIGsecTbC+JuOii0RvkOoXa83vVcOn/Nw7JS4o yX8w7a4LNvLBxZIygp5inVzOK4sMHpVUYc5YK5H2LkuR9ucX5oe9E/cMb3D8zgKu5R s1gUqg7JSX5RxdW4PrMeBorhxfa7ZjbRLZ0KXPfSp9JfM30KKeE3qVRjvbb6lev/AP IEE+AJ+uSP/nA== Date: Sat, 20 Mar 2021 17:57:48 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: znavko@disroot.org Message-ID: <2b01aae61171d0009e919a6b81278766@disroot.org> Subject: Re: How to remove extension from service definition? To: "Joshua Branson" , "znavko--- via" In-Reply-To: <87tup7pa17.fsf@dismail.de> References: <87tup7pa17.fsf@dismail.de> <625a13ff6694092e358b373102a26dbd@disroot.org> Received-SPF: pass client-ip=178.21.23.139; envelope-from=znavko@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1616263093; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=8aG1pBnmSBZw/vkODHZUQF7Y7I6okdvbXswlFdHsXDM=; b=X1FLNrMR6xC2mQ9m6hOqpfVNbSHcablqAfWAEViAHNo4qR4gVh/zRAc1Ot7SyZn7Qt6XYo o3x9Dpy2dSewA2Nq41ViJLfhMuIJt6MvmTeVDy1FSYaXgDY1sTpaSvbcb0rj55KNoJkTPO vgd+XQjBPkBSL75zhySbMpxON34wMA+vFBhvsydX7GcJDShRik6cynuBYIkXjf14ewRKG1 tLDXszlUtw45EhbmfhLQ/hIMeI4AydiMfxc1A52bkWA/Xgp2HlYKe8qYzJpFuASFyCJwK0 oz6WtzGYBjMDqQEEr8dDT7HPKb07KOqGNZPzutChyWqCcYI5ua1x5RRKW6fnOw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616263093; a=rsa-sha256; cv=none; b=Du+CMeNWDui7zICh+vlGKZDIDdoBKBHxUCtxKBjE8vMbNewUHsY23LG3kjqYUE+OjMQca4 zg7FknRjN96ImRCjz1RvXweX/OOsHac+Oej5bm5iJvs8tjjQksBSr1G5r5N5Iz3Mwn3TLF 3g39ns4CcszFnXTKpOuOu3Ng8uSZCsw/BlRAD/Qd/H6T+u9xVLinXCgw+ZpFdmroCZ8Y73 b8E0YHYf6MVO2CiNGnofRi2rYnq+JKVd9bvSpOpojJg8DDtljfZAfBA4xCTVTEy+o7iGoR RhXdLO+VBE24xWNW6jFtZKGFGQZmRnT5tPl+NVIVQyH2MmwZr2Bb1s3ImBv0eQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=disroot.org header.s=mail header.b=GrsBYEcs; dmarc=pass (policy=quarantine) header.from=disroot.org; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -1.61 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=disroot.org header.s=mail header.b=GrsBYEcs; dmarc=pass (policy=quarantine) header.from=disroot.org; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 70F1511100 X-Spam-Score: -1.61 X-Migadu-Scanner: scn0.migadu.com X-TUID: WswjIl3PhaIa Hello, Joshua!=0AI see your code is elegant and represents solution of a = task:=0Aremove 'network-manager-service-type' from %desktop-services vari= able=0A=0AI've already got this solution here in Guix-help and I use it = =0Ain every config.scm example placed to my git:=0Ahttps://gitgud.io/znav= ko/guix-configs=0A=0ANow I faced to another interestng task:=0A1. I use %= desktop-services that declares 'network-manager-applet' =0Aas extension o= f 'profile-service-type' here [1]=0A2. I use 'xfce-desktop-service-type' = that has 'profile-service-type'=0Aas an extension [2]=0A3. I cannot just = simply remove 'profile-service-type' because it is =0Areally important [3= ]=0A4. I need to remove 'network-manager-applet' from the extensions list= =0Ain 'profile-service-type' declared here [4]=0A=0AYou gave me and idea = to work with variables.=0AI could just redefine some variable, for exampl= e copy =0Adesctop.scm to my local machine and include it to my config=0Aa= nd code it without those lines that include 'network-manager-applet'.=0AB= ut I see this approach is not elegant, as Russians say 'a dog-nail'.=0A= =0AI seek elegant academical solution, as programmers say 'linux-way'.=0A= =0AI alwasy ask here and got solutions, but here I started to read=0ALisp= manual, then I will read Scheme manual, then Guile manual=0Aand then Gui= x manual and Guix repository to discover that only =0Afuncion-antidote fo= r this peace of code [4]:=0A=0A(define %desktop-services=0A ;; List of s= ervices typically useful for a "desktop" use case.=0A (cons*=0A...=0A = (simple-service 'network-manager-applet=0A profile-service-ty= pe=0A (list network-manager-applet))))=0A=0A=0ADo you know some = Guix function for remove extension?=0AIf you have a snippet for remove ex= tension from service it=0Awill be very exact I want.=0A=0A=0A[1] https://= git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/desktop.scm#n1260=0A= [2] https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/desktop.= scm#n1004=0A[3] https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/servi= ces.scm#n810=0A[4] https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/se= rvices/desktop.scm#n1260=0A=0A=0AMarch 19, 2021 4:07 PM, "Joshua Branson"= wrote:=0A=0A> znavko--- via wri= tes:=0A> =0A>> Hello! I wish to remove network-manager-applet extension f= rom=0A>> profile-service-type=0A>> which is in the list of extensions of= =0A>> xfce-desktop-service-type [1] and [2]=0A>> =0A>> And also I want to= see the result.=0A>> =0A>> I try it unsuccessfully like this:=0A>> =0A>>= $ guile=0A>>> (use-modules (gnu) (gnu services) (gnu services desktop) (= srfi srfi-1))=0A>>> xfce-desktop-service-type=0A>> =0A>> $1 =3D #=0A>>> (remove (lambda (service) (eq? (se= rvice-kind service) profile-service-type))=0A>>> xfce-desktop-service-typ= e)=0A>> =0A>> ice-9/boot-9.scm:1669:16: In procedure raise-exception:=0A>= > In procedure remove: Wrong type argument in position 2: #=0A> =0A> (remove (lambda (service) (eq? (servi= ce-kind service) profile-service-type)) %desktop-services)=0A> =0A> "work= s for me." Though you get a HUGE output. I didn't check the=0A> output to= make sure it was removed. Also just removing all=0A> profile-service-typ= e(s) might be a REALLY BAD idea. I wouldn't know=0A> exactly why it would= be bad, but it might remove lots of system services.=0A> =0A>> Entering = a new prompt. Type `,bt' for a backtrace or `,q' to continue.=0A>> Also I= cannot remove service from %desktop-services asI usually do in config.sc= m:=0A>>> (remove (lambda (service) (member (service-kind service) (list n= etwork-manager-service-type=0A>>> bluetooth-service))) %desktop-services)= =0A>> =0A>> ;;; :19:57: warning: possibly unbound variable `networ= k-manager-service-type'=0A>> ice-9/boot-9.scm:1669:16: In procedure raise= -exception:=0A>> error: network-manager-service-type: unbound variable=0A= >> Can you show me how ot interact with guile ? And how to remove service= extensionsand also=0A>> how to look at xfce-desktop-service-type content= s?=0A> =0A> So the problem with it not knowing that 'network-manager-serv= ice-type'=0A> is a variable is because you have not included the file tha= t specifies=0A> that network-manager-service-type is a variable. So how d= o we discover=0A> what file has network-manager-service-type defined as a= variable?=0A> =0A> $ guix system search network-manager=0A> name: networ= k-manager=0A> location: gnu/services/networking.scm:1120:4=0A> extends: s= hepherd-root dbus polkit account activate session-environment profile=0A>= shepherdnames: networking=0A> description: Run NetworkManager (https://w= iki.gnome.org/Projects/NetworkManager), a network=0A> management daemon t= hat aims to=0A> + simplify wired and wireless networking.=0A> relevance: = 15=0A> =0A> You can see that it's located in gnu/services/networking.scm.= Where is=0A> bluetooth defined?=0A> =0A> $ guix system search bluetooth= =0A> name: bluetooth=0A> location: gnu/services/desktop.scm:467:2=0A> ext= ends: dbus udev etc shepherd-root=0A> shepherdnames: bluetooth=0A> descri= ption: Run the `bluetoothd' daemon, which manages all the Bluetooth devic= es and provides a=0A> number of D-Bus interfaces.=0A> relevance: 19=0A> = =0A> Ahh. gnu/services/desktop.scm.=0A> =0A> so=0A> =0A> $ guile=0A> sche= me@(guile-user) > ,use(gnu services networking)=0A> scheme@(guile-user) >= ,use(gnu services desktop)=0A> scheme@(guile-user) > (remove (lambda (se= rvice) (member (service-kind service) (list=0A> network-manager-service-t= ype bluetooth-service))) %desktop-services)=0A> =0A> Best of luck!=0A> = =0A> --=0A> Joshua Branson (joshuaBPMan in #guix)=0A> Sent from Emacs and= Gnus=0A> https://gnucode.me=0A> https://video.hardlimit.com/accounts/jos= hua_branson/video-channels=0A> https://propernaming.org=0A> "You can have= whatever you want, as long as you help=0A> enough other people get what = they want." - Zig Ziglar