all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Deleting unnecessary services from %desktop-services
@ 2018-11-27 19:38 znavko
  2018-11-27 22:46 ` Pierre Neidhardt
  0 siblings, 1 reply; 9+ messages in thread
From: znavko @ 2018-11-27 19:38 UTC (permalink / raw)
  To: Help Guix

[-- Attachment #1: Type: text/plain, Size: 2291 bytes --]

Hello, Guix Help! Today I have a time to renew my attempts removing networkmanager, cups, avahi-daemon, ntpd.
Pierre Neidhardt advised here https://lists.gnu.org/archive/html/help-guix/2018-09/msg00079.html <https://lists.gnu.org/archive/html/help-guix/2018-09/msg00079.html> but now my config looks like this:

  (services (cons*  ;;(tor-service)
                    (service postgresql-service-type)
                    (xfce-desktop-service)
                    (modify-services %desktop-services
                        (elogind-service-type
                            c => (elogind-configuration
                                (handle-lid-switch 'ignore)))
                    );;end of moify desktop-srvices
  ));;end of services

When I try function (remove), I have an error

  (services (cons*  ;;(tor-service)
                    (service postgresql-service-type)
                    (xfce-desktop-service)
     (remove (lambda (service)
               (eq? (service-kind service) network-manager-service-type))

                    (modify-services %desktop-services
                        (elogind-service-type
                            c => (elogind-configuration
                                (handle-lid-switch 'ignore)))
                    );;end of moify desktop-srvices
);end of remove
  ));;end of services
# guix system reconfigure /etc/config.scm
/etc/config.scm:86:20: error: remove: unbound variable
hint: Did you forget `(use-modules (srfi srfi-1))'?
And when I add it, guix requires module networking, but adding of it gives:
# guix system reconfigure /etc/config.scm
guix system: error: service 'ntpd' requires 'networking', which is not provided by any service

Is it possible to delete these, and how?

Also, how to rescue my system when I will not have a possibility to use network at all. How then use usb-stick with guixsd and reconfigure my system with my previous config?


[-- Attachment #2: Type: text/html, Size: 4158 bytes --]

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

* Re: Deleting unnecessary services from %desktop-services
  2018-11-27 19:38 Deleting unnecessary services from %desktop-services znavko
@ 2018-11-27 22:46 ` Pierre Neidhardt
  2018-11-29  7:09   ` znavko
  0 siblings, 1 reply; 9+ messages in thread
From: Pierre Neidhardt @ 2018-11-27 22:46 UTC (permalink / raw)
  To: znavko; +Cc: Help Guix

[-- Attachment #1: Type: text/plain, Size: 946 bytes --]

To use 'remove' you need to import the srfi-1 module indeed.

> guix system: error: service 'ntpd' requires 'networking', which is not
> provided by any service

This is telling you that you can't have the ntpd service if you remove the
network stack, so
- either remove ntpd
- or add another network stack that provides 'networking' (maybe wicd or the
like).

> Also, how to rescue my system when I will not have a possibility to use
> network at all. How then use usb-stick with guixsd and reconfigure my system
> with my previous config?

Is it a hardware / kernel issue?  Or do you mean that network manager will be
gone?

For the latter, iproute2, wpa_supplicant and friends should still be available for
you to connect manually.

When it comes to system rescue, you should be able to boot the former system
generations from the bootloader.  Isn't this working for you?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: Deleting unnecessary services from %desktop-services
  2018-11-27 22:46 ` Pierre Neidhardt
@ 2018-11-29  7:09   ` znavko
  2018-11-30  2:55     ` Ricardo Wurmus
  0 siblings, 1 reply; 9+ messages in thread
From: znavko @ 2018-11-29  7:09 UTC (permalink / raw)
  Cc: Help Guix

[-- Attachment #1: Type: text/plain, Size: 1701 bytes --]

Guile Manual says 'remove' returns elements. But I need to remove elements. 

"remove pred lst
remove! pred lstReturn a list containing all elements from lst which do not satisfy the predicate pred.
The elements in the result list have the same order as in lst. The order in which pred
is applied to the list elements is not specified.
remove! is allowed, but not required to modify the structure of the input list."


  (services (cons*  ;;(tor-service)
                    (service postgresql-service-type)
                    (xfce-desktop-service)
                    (modify-services      
                      (remove (lambda (service)
                        (eq? (service-kind service) 
                               avahi-service-type ntp-service-type networking))
                        %desktop-services
                      );end of remove
                      (elogind-service-type
                        c => (elogind-configuration (handle-lid-switch 'ignore)))
                    );;end of modify desktop-srvices
  ));;end of services


So all of them rests:

# guix system reconfigure /etc/config.scm --substitute-urls="http://berlin.guixsd.org <http://berlin.guixsd.org>"
...
shepherd: Service networking has been started.
shepherd: Service ntpd has been started.
shepherd: Service avahi-daemon has been started.

  Avahi-daemon rests, and ntpd rests. Sorry, I need to define this in the manual. 

[-- Attachment #2: Type: text/html, Size: 3153 bytes --]

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

* Re: Deleting unnecessary services from %desktop-services
  2018-11-29  7:09   ` znavko
@ 2018-11-30  2:55     ` Ricardo Wurmus
  2018-12-01  5:06       ` znavko
  0 siblings, 1 reply; 9+ messages in thread
From: Ricardo Wurmus @ 2018-11-30  2:55 UTC (permalink / raw)
  To: znavko; +Cc: Help Guix


znavko@tutanota.com writes:

> Guile Manual says 'remove' returns elements. But I need to remove elements.

“remove” does what you want.  The “services” field expects a list of
services.  When using “remove” on a list of services it returns a new
list of (possibly fewer) services.  That’s exactly what you want.

“remove!”, on the other hand, mutates an existing value; you would need
to have it operate on an existing variable to mutate it.  “remove” is
much more elegant.

--
Ricardo

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

* Re: Deleting unnecessary services from %desktop-services
  2018-11-30  2:55     ` Ricardo Wurmus
@ 2018-12-01  5:06       ` znavko
  2018-12-01 13:47         ` Joshua Branson
  0 siblings, 1 reply; 9+ messages in thread
From: znavko @ 2018-12-01  5:06 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Help Guix

[-- Attachment #1: Type: text/plain, Size: 2385 bytes --]

Hello, Ricardo Wurmus! ok, thank you. But now I've not achieved what I need. avahi-damon, ntpd, networking rest in my system. 

  (services (cons*  ;;(tor-service)
                    (service postgresql-service-type)
                    (xfce-desktop-service)
                    (modify-services      
                      (remove (lambda (service)
                        (eq? (service-kind service) 
                               avahi-service-type ntp-service-type networking))
                        %desktop-services
                      );end of remove
                      (elogind-service-type
                        c => (elogind-configuration (handle-lid-switch 'ignore)))
                    );;end of modify desktop-services
  ));;end of services

Also they are mentioned in use-modules:

(use-modules (gnu) (gnu system nss)
             (gnu services desktop)
             (srfi srfi-1) ;;for remove function
             (gnu services networking) ;;for remove ntp
             (gnu services avahi) ;;for remove avahi
             (gnu services xorg)
             (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: 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 <mailto:rekado@elephly.net>:

>
> znavko@tutanota.com <mailto:znavko@tutanota.com>>  writes:
>
>> Guile Manual says 'remove' returns elements. But I need to remove elements.
>>
>
> “remove” does what you want.  The “services” field expects a list of
> services.  When using “remove” on a list of services it returns a new
> list of (possibly fewer) services.  That’s exactly what you want.
>
> “remove!”, on the other hand, mutates an existing value; you would need
> to have it operate on an existing variable to mutate it.  “remove” is
> much more elegant.
>
> --
> Ricardo
>


[-- Attachment #2: Type: text/html, Size: 4860 bytes --]

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

* Re: Deleting unnecessary services from %desktop-services
  2018-12-01  5:06       ` znavko
@ 2018-12-01 13:47         ` Joshua Branson
  2018-12-01 15:28           ` znavko
  0 siblings, 1 reply; 9+ messages in thread
From: Joshua Branson @ 2018-12-01 13:47 UTC (permalink / raw)
  To: help-guix

<znavko@tutanota.com> writes:

> Hello, Ricardo Wurmus! ok, thank you. But now I've not achieved what I need. avahi-damon, ntpd, networking rest in my system. 

I thought that Pierre answered that for you:

> guix system: error: service 'ntpd' requires 'networking', which is not
> provided by any service

This is telling you that you can't have the ntpd service if you remove the
network stack, so
- either remove ntpd
- or add another network stack that provides 'networking' (maybe wicd or the
like).

>
>   (services (cons*  ;;(tor-service)
>                     (service postgresql-service-type)
>                     (xfce-desktop-service)
>                     (modify-services      
>                       (remove (lambda (service)
>                         (eq? (service-kind service) 
>                                avahi-service-type ntp-service-type networking))
>                         %desktop-services
>                       );end of remove
>                       (elogind-service-type
>                         c => (elogind-configuration (handle-lid-switch 'ignore)))
>                     );;end of modify desktop-services
>   ));;end of services
>
> Also they are mentioned in use-modules:
>
> (use-modules (gnu) (gnu system nss)
>              (gnu services desktop)
>              (srfi srfi-1) ;;for remove function
>              (gnu services networking) ;;for remove ntp
>              (gnu services avahi) ;;for remove avahi
>              (gnu services xorg)
>              (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: unbound variable avahi-service-type, ntp-service-type, networking. 
> So, how to correct I do not know.

I think that you have to have those modules defined so you can remove
the services.  Having that use modules line won't mean those services
are run.

>
> 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 elements.
>
>  “remove” does what you want. The “services” field expects a list of
>  services. When using “remove” on a list of services it returns a new
>  list of (possibly fewer) services. That’s exactly what you want.
>
>  “remove!”, on the other hand, mutates an existing value; you would need
>  to have it operate on an existing variable to mutate it. “remove” is
>  much more elegant.
>
>  --
>  Ricardo

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

* Re: Deleting unnecessary services from %desktop-services
  2018-12-01 13:47         ` Joshua Branson
@ 2018-12-01 15:28           ` znavko
  2018-12-01 20:07             ` Ricardo Wurmus
  0 siblings, 1 reply; 9+ messages in thread
From: znavko @ 2018-12-01 15:28 UTC (permalink / raw)
  To: Joshua Branson; +Cc: Help Guix

[-- Attachment #1: Type: text/plain, Size: 1968 bytes --]


Yes, you are right. I do not need all these services:

- avahi-daemon ,
- ntpd,
- networking

But this config does not remove them:

  (services (cons*  ;;(tor-service)
                    (service postgresql-service-type)
                    (xfce-desktop-service)
                    (modify-services      
                      (remove! (lambda (service)
                        (eq? (service-kind service) 
                               avahi-service-type ntp-service-type ntpd networking))
                        %desktop-services
                      );end of remove
                      (elogind-service-type
                        c => (elogind-configuration (handle-lid-switch 'ignore)))
                    );;end of modify desktop-srvices
  ));;end of services

# guix system reconfigure /etc/config.scm
...
upgrade, and restart each service that was not automatically restarted.
shepherd: Evaluating user expression (let* ((services (map primitive-load (?))) # ?) ?).
shepherd: Service user-homes could not be started.
shepherd: Service term-auto could not be started.
shepherd: Service wpa-supplicant has been started.
shepherd: Service networking has been started.
shepherd: Service ntpd has been started.
shepherd: Service avahi-daemon has been started.

# herd status
...
 + avahi-daemon
 + networking
 + ntpd


My question is how to remove at all these services: avahi, ntpd, networking. My current config does not fulfill this.

I need only these packages: wpa_supplicant, dhclient, and graphical services from %desktop services. So I need %desktop-services, but want to remove avahi, ntpd and networking from that list.
Would you correct my config?

[-- Attachment #2: Type: text/html, Size: 4287 bytes --]

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

* Re: Deleting unnecessary services from %desktop-services
  2018-12-01 15:28           ` znavko
@ 2018-12-01 20:07             ` Ricardo Wurmus
  2018-12-02 16:09               ` znavko
  0 siblings, 1 reply; 9+ messages in thread
From: Ricardo Wurmus @ 2018-12-01 20:07 UTC (permalink / raw)
  To: znavko; +Cc: Help Guix, Joshua Branson


znavko@tutanota.com writes:

>  (remove! (lambda (service)
>  (eq? (service-kind service)
>  avahi-service-type ntp-service-type ntpd networking))
>  %desktop-services
>  )

This doesn’t work as you are asking if (service-kind service) is the
same as “avahi-service-type” AND “ntp-service-type” AND “ntpd” AND
“networking”.  This will never be true.  Use “member” instead.

(Also, you should probably use “remove” instead of “remove!”.) 

--
Ricardo

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

* Re: Deleting unnecessary services from %desktop-services
  2018-12-01 20:07             ` Ricardo Wurmus
@ 2018-12-02 16:09               ` znavko
  0 siblings, 0 replies; 9+ messages in thread
From: znavko @ 2018-12-02 16:09 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Help Guix

[-- Attachment #1: Type: text/plain, Size: 3787 bytes --]

Hello, Ricardo Wurmus! With your responses I actually could delete avahi and ntp services. Thank you!

But the 'networking' service is quite more difficult to configure. Please, what is wrong here:

  (packages (cons* nss-certs         ;for HTTPS access
                   gvfs              ;for user mounts
           wpa-supplicant
           isc-dhcp
                   %base-packages))
  (services (cons*  
                    (service postgresql-service-type)
                    (xfce-desktop-service)
                    (modify-services      
                      ;;(remove (lambda (service)
                      ;;  (eq? (service-kind service)
                      ;;    wpa-supplicant-service-type))
                        (remove (lambda (service)
                          (eq? (service-kind service)
                            static-networking-service-type))
                          (remove (lambda (service)
                            (eq? (service-kind service)
                              ntp-service-type))
                            (remove (lambda (service)
                              (eq? (service-kind service)
                                avahi-service-type))
                              %desktop-services
                            );end of remove avahi
                          );end of remove2 ntp
                        );end of remove3 networking
                      ;);end of remove4 wpa-supplicant
                      (elogind-service-type
                        c => (elogind-configuration (handle-lid-switch 'ignore)))
                    );;end of modify desktop-services
  ));;end of services


# guix system reconfigure /etc/config.scm
guix system: error: service 'networking' requires 'wpa-supplicant', which is not provided by any service
# guix system reconfigure /etc/config.scm
guix system: error: service 'wpa-supplicant' requires 'loopback', which is not provided by any service


There is no difference if I type  'remove wpa-supplicant' first and then networking or vice versa: first networking and then wpa-supplicant. There are errors because of requirements, that I do not know how to bypass.

How to delete networking and wpa-supplicant services? 

The problem is that  I am running wpa-supplicant manually now, while I do not know how to configure its service to use my wpa.conf. And I want to have package wpa-supplicant but no service that really appears in boot process and take 2-3 seconds waiting.

znavko.

Dec 1, 2018, 11:07 PM by rekado@elephly.net:

>
> znavko@tutanota.com <mailto:znavko@tutanota.com>>  writes:
>
>> (remove! (lambda (service)
>>  (eq? (service-kind service)
>>  avahi-service-type ntp-service-type ntpd networking))
>>  %desktop-services
>>  )
>>
>
> This doesn’t work as you are asking if (service-kind service) is the
> same as “avahi-service-type” AND “ntp-service-type” AND “ntpd” AND
> “networking”.  This will never be true.  Use “member” instead.
>
> (Also, you should probably use “remove” instead of “remove!”.) 
>
> --
> Ricardo
>


[-- Attachment #2: Type: text/html, Size: 8560 bytes --]

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

end of thread, other threads:[~2018-12-02 16:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-27 19:38 Deleting unnecessary services from %desktop-services znavko
2018-11-27 22:46 ` Pierre Neidhardt
2018-11-29  7:09   ` znavko
2018-11-30  2:55     ` Ricardo Wurmus
2018-12-01  5:06       ` znavko
2018-12-01 13:47         ` Joshua Branson
2018-12-01 15:28           ` znavko
2018-12-01 20:07             ` Ricardo Wurmus
2018-12-02 16:09               ` znavko

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.