all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: swedebugia@riseup.net
Cc: help-guix <help-guix@gnu.org>
Subject: Re: Deleting services from %desktop-services in operating system declaration
Date: Sat, 23 Jan 2016 19:43:00 +0300	[thread overview]
Message-ID: <87zivw6ycr.fsf@gmail.com> (raw)
In-Reply-To: <6dc1e0b7fdda09d86a990c97484b5964@riseup.net> (swedebugia@riseup.net's message of "Sat, 23 Jan 2016 14:09:58 +0100")

swedebugia@riseup.net (2016-01-23 16:09 +0300) wrote:

> On 2016-01-21 00:24, ludo@gnu.org wrote:
>> swedebugia@riseup.net skribis:
>>
>>> I have trouble getting the syntax right to delete avahi and wicd from
>>> my config.scm.
>>
>> The correct syntax would be:
>>
>>   (operating-system
>>     ;; …
>>     (services (remove (lambda (service)
>>                         (or (eq? (service-kind service)
>>                                  wicd-service-type)
>>                             (eq? (service-kind service)
>>                                  avahi-service-type)))
>>                       %desktop-services)))
>
> I tried this and got this error:
> # guix system reconfigure /etc/config/config.scm
> guix system: error: failed to load '/etc/config/config.scm':
> /etc/config/config.scm:48:12: In procedure #<procedure a7c3530 ()>:
> /etc/config/config.scm:48:12: In procedure module-lookup: Unbound
> variable: remove

'remove' procedure is from (srfi srfi-1) module, so you need to use it
in your config (see below).

Note that after fixing it, you'll get complaints about other unbound
variables:

- 'avahi-service-type': it is from (gnu services avahi);

- 'tor-service': it is from (gnu services networking);

- 'wicd-service-type': it is also from (gnu services networking), but it
  is not exported (I think we should fix it), so now you have to use it
  like this:

  (@@ (gnu services networking) wicd-service-type)

  which means: "give me 'wicd-service-type' from (gnu services
  networking) module, and I don't care if it's not exported".

> Config here: https://paste.debian.net/367385/

I paste your config here for convenience:

> (use-modules (gnu) (gnu system nss))

(use-modules
 (gnu)
 (gnu system nss)
 (srfi srfi-1))

> (use-service-modules desktop)
> (use-package-modules xfce ratpoison certs)

> (operating-system
>   (host-name "unknown")
>   (timezone "Europe/Stockholm")
>   (locale "en_US.UTF-8")

>   ;; Assuming /dev/sdX is the target hard disk, and "root" is
>   ;; the label of the target root file system.
>   (bootloader (grub-configuration (device "/dev/sda")))
>   (file-systems (cons* (file-system
>                         (device "guix")
>                         (title 'label)
>                         (mount-point "/")
>                         (type "ext4"))

>   		      (file-system
>                         (device "home")
>                         (title 'label)
>                         (mount-point "/home")
>                         (type "ext4"))
>                       %base-file-systems))

>   (swap-devices '("/dev/sdb3"))

>   (users (cons (user-account
>                 (name "sdb")
>                 (comment "swedebugia")
>                 (group "users")
>                 (supplementary-groups '("wheel" "netdev"
>                                         "audio" "video"))
>                 (home-directory "/home/sdb"))
>                %base-user-accounts))

>   ;; Add Xfce and Ratpoison; that allows us to choose
>   ;; sessions using either of these at the log-in screen.
>   (packages (cons* xfce ratpoison    ;desktop environments
>                    nss-certs         ;for HTTPS access
>                    %base-packages))

>   ;; Use the "desktop" services, which include the X11
>   ;; log-in service, networking with Wicd, and more.
>   (services (remove (lambda (service)
>                         (or (eq? (service-kind service)
>                                  wicd-service-type)
>                             (eq? (service-kind service)
>                                  avahi-service-type)))
>                       %desktop-services))
>   (services (cons* (tor-service) %desktop-services))

You shouldn't (!) use 'services' (or any other operating-system field
more than *ONCE*).  You can combine 'cons*' and 'remove' like this:

  (services
   (cons* (tor-service)
          (remove (lambda (service)
                    (or (eq? (service-kind service)
                             avahi-service-type)
                        (eq? (service-kind service)
                             (@@ (gnu services networking) wicd-service-type))
                        (eq? (service-kind service)
                             (@@ (gnu services networking) ntp-service-type))))
                  %desktop-services)))

Note: if you want to remove wicd service, you also need to remove ntp
service, otherwise you'll get:

  guix system: error: service 'ntpd' requires 'networking', which is undefined

>   ;; Allow resolution of '.local' host names with mDNS.
>   (name-service-switch %mdns-host-lookup-nss))

-- 
Alex

  reply	other threads:[~2016-01-23 16:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20 12:42 Deleting services from %desktop-services in operating system declaration swedebugia
2016-01-20 13:28 ` Efraim Flashner
2016-01-20 14:17 ` Thompson, David
2016-01-20 23:24 ` Ludovic Courtès
2016-01-23 13:09   ` swedebugia
2016-01-23 16:43     ` Alex Kost [this message]
2016-01-25 11:20       ` swedebugia
2016-01-25 22:52         ` Alex Kost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zivw6ycr.fsf@gmail.com \
    --to=alezost@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=swedebugia@riseup.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.