unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* How to remove extension from service definition?
@ 2021-03-09 17:46 znavko--- via
  2021-03-19 13:07 ` Joshua Branson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: znavko--- via @ 2021-03-09 17:46 UTC (permalink / raw)
  To: help-guix

Hello! I wish to remove network-manager-applet extension from
profile-service-type 
which is in the list of extensions of
xfce-desktop-service-type [1] and [2]

And also I want to see the result.

I try it unsuccessfully like this:

$ guile
> (use-modules (gnu) (gnu services) (gnu services desktop) (srfi srfi-1))
> xfce-desktop-service-type
$1 = #<service-type xfce-desktop 7f6c0a4b1000>
> (remove (lambda (service) (eq? (service-kind service) profile-service-type)) xfce-desktop-service-type)
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
In procedure remove: Wrong type argument in position 2: #<service-type xfce-desktop 7f6c0a4b1000>

Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
Also I cannot remove service from %desktop-services asI usually do in config.scm:
> (remove (lambda (service) (member (service-kind service) (list network-manager-service-type bluetooth-service))) %desktop-services)
;;; <stdin>:19:57: warning: possibly unbound variable `network-manager-service-type'
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
error: network-manager-service-type: unbound variable
Can you show me how ot interact with guile ? And how to remove service extensionsand also 
how to look at xfce-desktop-service-type contents?
[1] https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/desktop.scm#n1260 (https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/desktop.scm#n1260)
[2] https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/desktop.scm#n1004 (https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/desktop.scm#n1004)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to remove extension from service definition?
  2021-03-09 17:46 How to remove extension from service definition? znavko--- via
@ 2021-03-19 13:07 ` Joshua Branson
  2021-03-20 17:57 ` znavko
  2021-03-21  1:08 ` jbranso
  2 siblings, 0 replies; 4+ messages in thread
From: Joshua Branson @ 2021-03-19 13:07 UTC (permalink / raw)
  To: znavko--- via; +Cc: znavko

znavko--- via <help-guix@gnu.org> writes:

> Hello! I wish to remove network-manager-applet extension from
> profile-service-type
> which is in the list of extensions of
> xfce-desktop-service-type [1] and [2]
>
> And also I want to see the result.
>
> I try it unsuccessfully like this:
>
> $ guile
>> (use-modules (gnu) (gnu services) (gnu services desktop) (srfi srfi-1))
>> xfce-desktop-service-type
> $1 = #<service-type xfce-desktop 7f6c0a4b1000>
>> (remove (lambda (service) (eq? (service-kind service) profile-service-type)) xfce-desktop-service-type)
> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> In procedure remove: Wrong type argument in position 2: #<service-type xfce-desktop 7f6c0a4b1000>

 (remove (lambda (service) (eq? (service-kind service) profile-service-type)) %desktop-services)

"works for me."  Though you get a HUGE output.  I didn't check the
output to make sure it was removed.  Also just removing all
profile-service-type(s) might be a REALLY BAD idea.  I wouldn't know
exactly why it would be bad, but it might remove lots of system services.

>
> Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
> Also I cannot remove service from %desktop-services asI usually do in config.scm:
>> (remove (lambda (service) (member (service-kind service) (list network-manager-service-type bluetooth-service))) %desktop-services)
> ;;; <stdin>:19:57: warning: possibly unbound variable `network-manager-service-type'
> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> error: network-manager-service-type: unbound variable
> Can you show me how ot interact with guile ? And how to remove service extensionsand also
> how to look at xfce-desktop-service-type contents?

So the problem with it not knowing that 'network-manager-service-type'
is a variable is because you have not included the file that specifies
that network-manager-service-type is a variable.  So how do we discover
what file has network-manager-service-type defined as a variable?

$ guix system search network-manager
name: network-manager
location: gnu/services/networking.scm:1120:4
extends: shepherd-root dbus polkit account activate session-environment profile
shepherdnames: networking
description: Run NetworkManager (https://wiki.gnome.org/Projects/NetworkManager), a network management daemon that aims to
+ simplify wired and wireless networking.
relevance: 15

You can see that it's located in gnu/services/networking.scm.  Where is
bluetooth defined?

$ guix system search bluetooth
name: bluetooth
location: gnu/services/desktop.scm:467:2
extends: dbus udev etc shepherd-root
shepherdnames: bluetooth
description: Run the `bluetoothd' daemon, which manages all the Bluetooth devices and provides a number of D-Bus interfaces.
relevance: 19

Ahh.  gnu/services/desktop.scm.

so

$ guile
scheme@(guile-user) > ,use(gnu services networking)
scheme@(guile-user) > ,use(gnu services desktop)
scheme@(guile-user) > (remove (lambda (service) (member (service-kind service) (list network-manager-service-type bluetooth-service))) %desktop-services)

Best of luck!

--
Joshua Branson (joshuaBPMan in #guix)
Sent from Emacs and Gnus
  https://gnucode.me
  https://video.hardlimit.com/accounts/joshua_branson/video-channels
  https://propernaming.org
  "You can have whatever you want, as long as you help
enough other people get what they want." - Zig Ziglar


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to remove extension from service definition?
  2021-03-09 17:46 How to remove extension from service definition? znavko--- via
  2021-03-19 13:07 ` Joshua Branson
@ 2021-03-20 17:57 ` znavko
  2021-03-21  1:08 ` jbranso
  2 siblings, 0 replies; 4+ messages in thread
From: znavko @ 2021-03-20 17:57 UTC (permalink / raw)
  To: Joshua Branson, znavko--- via

Hello, Joshua!
I see your code is elegant and represents solution of a task:
remove 'network-manager-service-type' from %desktop-services variable

I've already got this solution here in Guix-help and I use it 
in every config.scm example placed to my git:
https://gitgud.io/znavko/guix-configs

Now I faced to another interestng task:
1. I use %desktop-services that declares 'network-manager-applet' 
as extension of 'profile-service-type' here [1]
2. I use 'xfce-desktop-service-type' that has 'profile-service-type'
as an extension [2]
3. I cannot just simply remove 'profile-service-type' because it is 
really important [3]
4. I need to remove 'network-manager-applet' from the extensions list
in 'profile-service-type' declared here [4]

You gave me and idea to work with variables.
I could just redefine some variable, for example copy 
desctop.scm to my local machine and include it to my config
and code it without those lines that include 'network-manager-applet'.
But I see this approach is not elegant, as Russians say 'a dog-nail'.

I seek elegant academical solution, as programmers say 'linux-way'.

I alwasy ask here and got solutions, but here I started to read
Lisp manual, then I will read Scheme manual, then Guile manual
and then Guix manual and Guix repository to discover that only 
funcion-antidote for this peace of code [4]:

(define %desktop-services
  ;; List of services typically useful for a "desktop" use case.
  (cons*
...
      (simple-service 'network-manager-applet
          profile-service-type
          (list network-manager-applet))))


Do you know some Guix function for remove extension?
If you have a snippet for remove extension from service it
will be very exact I want.


[1] https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/desktop.scm#n1260
[2] https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/desktop.scm#n1004
[3] https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services.scm#n810
[4] https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/desktop.scm#n1260


March 19, 2021 4:07 PM, "Joshua Branson" <jbranso@dismail.de> wrote:

> znavko--- via <help-guix@gnu.org> writes:
> 
>> Hello! I wish to remove network-manager-applet extension from
>> profile-service-type
>> which is in the list of extensions of
>> xfce-desktop-service-type [1] and [2]
>> 
>> And also I want to see the result.
>> 
>> I try it unsuccessfully like this:
>> 
>> $ guile
>>> (use-modules (gnu) (gnu services) (gnu services desktop) (srfi srfi-1))
>>> xfce-desktop-service-type
>> 
>> $1 = #<service-type xfce-desktop 7f6c0a4b1000>
>>> (remove (lambda (service) (eq? (service-kind service) profile-service-type))
>>> xfce-desktop-service-type)
>> 
>> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
>> In procedure remove: Wrong type argument in position 2: #<service-type xfce-desktop 7f6c0a4b1000>
> 
> (remove (lambda (service) (eq? (service-kind service) profile-service-type)) %desktop-services)
> 
> "works for me." Though you get a HUGE output. I didn't check the
> output to make sure it was removed. Also just removing all
> profile-service-type(s) might be a REALLY BAD idea. I wouldn't know
> exactly why it would be bad, but it might remove lots of system services.
> 
>> Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
>> Also I cannot remove service from %desktop-services asI usually do in config.scm:
>>> (remove (lambda (service) (member (service-kind service) (list network-manager-service-type
>>> bluetooth-service))) %desktop-services)
>> 
>> ;;; <stdin>:19:57: warning: possibly unbound variable `network-manager-service-type'
>> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
>> error: network-manager-service-type: unbound variable
>> Can you show me how ot interact with guile ? And how to remove service extensionsand also
>> how to look at xfce-desktop-service-type contents?
> 
> So the problem with it not knowing that 'network-manager-service-type'
> is a variable is because you have not included the file that specifies
> that network-manager-service-type is a variable. So how do we discover
> what file has network-manager-service-type defined as a variable?
> 
> $ guix system search network-manager
> name: network-manager
> location: gnu/services/networking.scm:1120:4
> extends: shepherd-root dbus polkit account activate session-environment profile
> shepherdnames: networking
> description: Run NetworkManager (https://wiki.gnome.org/Projects/NetworkManager), a network
> management daemon that aims to
> + simplify wired and wireless networking.
> relevance: 15
> 
> You can see that it's located in gnu/services/networking.scm. Where is
> bluetooth defined?
> 
> $ guix system search bluetooth
> name: bluetooth
> location: gnu/services/desktop.scm:467:2
> extends: dbus udev etc shepherd-root
> shepherdnames: bluetooth
> description: Run the `bluetoothd' daemon, which manages all the Bluetooth devices and provides a
> number of D-Bus interfaces.
> relevance: 19
> 
> Ahh. gnu/services/desktop.scm.
> 
> so
> 
> $ guile
> scheme@(guile-user) > ,use(gnu services networking)
> scheme@(guile-user) > ,use(gnu services desktop)
> scheme@(guile-user) > (remove (lambda (service) (member (service-kind service) (list
> network-manager-service-type bluetooth-service))) %desktop-services)
> 
> Best of luck!
> 
> --
> Joshua Branson (joshuaBPMan in #guix)
> Sent from Emacs and Gnus
> https://gnucode.me
> https://video.hardlimit.com/accounts/joshua_branson/video-channels
> https://propernaming.org
> "You can have whatever you want, as long as you help
> enough other people get what they want." - Zig Ziglar


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to remove extension from service definition?
  2021-03-09 17:46 How to remove extension from service definition? znavko--- via
  2021-03-19 13:07 ` Joshua Branson
  2021-03-20 17:57 ` znavko
@ 2021-03-21  1:08 ` jbranso
  2 siblings, 0 replies; 4+ messages in thread
From: jbranso @ 2021-03-21  1:08 UTC (permalink / raw)
  To: znavko, znavko--- via

March 20, 2021 1:57 PM, znavko@disroot.org wrote:

> Hello, Joshua!
> Now I faced to another interestng task:
> 1. I use %desktop-services that declares 'network-manager-applet' 
> as extension of 'profile-service-type' here [1]
> 2. I use 'xfce-desktop-service-type' that has 'profile-service-type'
> as an extension [2]
> 3. I cannot just simply remove 'profile-service-type' because it is 
> really important [3]
> 4. I need to remove 'network-manager-applet' from the extensions list
> in 'profile-service-type' declared here [4]
> Do you know some Guix function for remove extension?
> If you have a snippet for remove extension from service it
> will be very exact I want.

I don't really know of the elegant way to do what you want.  :(  I
currently am running nm-applet, but sway doesn't officially support it.
I don't know how to elegantly remove it from my config either.  :(

Best of luck!


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-21  1:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09 17:46 How to remove extension from service definition? znavko--- via
2021-03-19 13:07 ` Joshua Branson
2021-03-20 17:57 ` znavko
2021-03-21  1:08 ` jbranso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).