Re: Deleting unnecessary services from %desktop-services

2018-12-02 Thread znavko
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 rek...@elephly.net:

>
> zna...@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
>



Re: Deleting unnecessary services from %desktop-services

2018-12-01 Thread Ricardo Wurmus


zna...@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




Re: Deleting unnecessary services from %desktop-services

2018-12-01 Thread znavko

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?


Re: Deleting unnecessary services from %desktop-services

2018-12-01 Thread Joshua Branson
 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 rek...@elephly.net:
>
>  zna...@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



Re: Deleting unnecessary services from %desktop-services

2018-11-30 Thread znavko
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 rek...@elephly.net :

>
> zna...@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
>



Re: Deleting unnecessary services from %desktop-services

2018-11-30 Thread Ricardo Wurmus


zna...@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




Re: Deleting unnecessary services from %desktop-services

2018-11-28 Thread znavko
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 "
...
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. 


Re: Deleting unnecessary services from %desktop-services

2018-11-27 Thread Pierre Neidhardt
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/


signature.asc
Description: PGP signature


Deleting unnecessary services from %desktop-services

2018-11-27 Thread znavko
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 
 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?