I'm trying to modify the list of services in my os-config, and I've run
into a bit of a problem. I've replaced my ntp-service with an
openntpd-service, but I'm having trouble with the syntax for removing
more services. Here's a snippet:

(use-modules (srfi srfi-1)


   (modify-services (delete (ntp-service) %desktop-services)
   ;(modify-services (fold delete %desktop-services
   ;                       '(
   ;                         (screen-locker-service slock)
   ;                         (screen-locker-service xlockmore "xlock")
   ;                         (ntp-service)
   ;                         )


The uncommented out code works and deletes (ntp-service) from
%desktop-servies as expected. When I comment that line out and put in
the multi-line version with fold then I find out that it doesn't work,
as evidenced by the error that I have two services providing ntpd (ntp
and openntpd).

I know I can put (modify-services (delete (service)
                                    (delete (other-service)
                                      (delete (third-service)

but I'd rather do it more cleanly with `fold' or something similar.

Efraim Flashner   <efr...@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
(use-modules (guix store)
             (gnu system nss)
             (gnu system locale)
             (srfi srfi-1))
(use-service-modules admin cups desktop mcron networking pm ssh xorg)
(use-package-modules bootloaders certs cups gnome linux video)

(define %btrfs-scrub
  #~(job '(next-hour '(3))
         (string-append #$btrfs-progs "/bin/btrfs scrub -c 3 start /")))

(define %btrfs-balance
  #~(job '(next-hour '(5))
         (string-append #$btrfs-progs "/bin/btrfs balance start -dusage=50 
-musage=70 /")))

(define my-xorg-modules
  ;; Only the modules on this laptop
  (fold delete %default-xorg-modules

  (host-name "macbook41")
  (timezone "Asia/Jerusalem")
  (locale "en_US.utf8")
    (list (locale-definition (source "en_US")
                             (name "en_US.utf8"))
          (locale-definition (source "he_IL")
                             (name "he_IL.utf8"))))

  ;; Assuming /dev/sdX is the target hard disk, and "my-root"
  ;; is the label of the target root file system.
  (bootloader (bootloader-configuration
                (bootloader grub-efi-bootloader)
                (target "/boot/efi")))

  (kernel-arguments '("zswap.enabled=1"
                      ;; Required to run X32 software and VMs
                      ;; https://wiki.debian.org/X32Port
                      ;; Still untested on GuixSD.

  (file-systems (cons* (file-system
                         (device "my-root")
                         (mount-point "/")
                         (type "btrfs")
                         (title 'label)
                         (options "autodefrag,compress=lzo,discard,ssd_spread"))
                         (device "none")
                         (mount-point "/var/guix/temproots")
                         (title 'device)
                         (type "tmpfs")
                         (check? #f))
                         (device (uuid "F010-1913" 'fat))
                         (title 'uuid)
                         (mount-point "/boot/efi")
                         (type "vfat"))

  (swap-devices '("/dev/sda2"))

  (users (cons (user-account
                (name "efraim")
                (comment "Efraim")
                (group "users")
                (supplementary-groups '("wheel" "netdev" "kvm"
                                        "lp" "lpadmin"
                                        "audio" "video"))
                (home-directory "/home/efraim"))

  ;; This is where we specify system-wide packages.
  (packages (cons* nss-certs         ;for HTTPS access
                   gvfs              ;for user mounts
                   libvdpau-va-gl    ;intel graphics vdpau

  (services (cons* (service enlightenment-desktop-service-type)
                   (console-keymap-service "il-heb")
                   (service guix-publish-service-type
                              (port 3000)))
                   (service openssh-service-type
                              (port-number 22)
                              (allow-empty-passwords? #f)
                              (password-authentication? #t)))

                   (tor-hidden-service "http"
                                       '((22 "")))

                   (service cups-service-type
                              (web-interface? #t)
                                (list cups-filters hplip))))

                   (service tlp-service-type)

                   (service rottlog-service-type)
                   (service mcron-service-type
                             (jobs (list %btrfs-scrub

                   (service openntpd-service-type
                              (listen-on '("" "::1"))
                              (allow-large-adjustment? #t)))

                   (modify-services (delete (ntp-service) %desktop-services)
                   ;(modify-services (fold delete %desktop-services
                   ;                       '(
                   ;                         (screen-locker-service slock)
                   ;                         (screen-locker-service xlockmore 
                   ;                         (ntp-service)
                   ;                         )
                   ;                       )
                     (guix-service-type config =>
                                          (inherit config)
;"https://bayfront.guixsd.org"; ; currently offline
; odroid-c2
                                                   ""; ; 
                                            '("--cores=1")))) ; we're on a 

                     (slim-service-type config =>
                                          (inherit config)
                                          (startx (xorg-start-command

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

Attachment: signature.asc
Description: PGP signature

Reply via email to