Advertisement
Guest User

os-part function

a guest
Mar 5th, 2020
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 1.78 KB | None | 0 0
  1. (define (os-part inherit-list packages services)
  2.   (if (null? inherit-list)
  3.       (lambda () (list (cons packages-keyword packages)
  4.                   (cons services-keyword services)))
  5.       (lambda () (let ((inherited ((car inherit-list))))
  6.               ((os-part (cdr inherit-list)
  7.                         (append (or (assoc-ref inherited packages-keyword) #nil)
  8.                                 packages)
  9.                         (append (or (assoc-ref inherited services-keyword) #nil)
  10.                                 services)))))))
  11.  
  12. ;;;; example usage: no-desktop-environment.scm
  13.  
  14. (os-part (list
  15.           ;; Other os-part files can be loaded here. ex.
  16.           ;; (load "./other-os-part.scm")
  17.           )
  18.          (list
  19.           compton
  20.           slock
  21.           gnome-icon-theme
  22.           brightnessctl)
  23.          (cons*
  24.           (service
  25.            slim-service-type
  26.            (slim-configuration
  27.             (xorg-configuration
  28.              (xorg-configuration
  29.               (extra-config '("
  30.                         Section \"Device\"
  31.                        
  32.                             Identifier \"Intel Graphics\"
  33.                        
  34.                             Driver \"intel\"
  35.                        
  36.                             Option \"TearFree\" \"false\"
  37.                        
  38.                         EndSection
  39.                         "))))))
  40.           (remove
  41.            (lambda (service)
  42.              (eq? (service-kind service) gdm-service-type))
  43.            (modify-services %desktop-services
  44.              (udev-service-type
  45.               config =>
  46.  
  47.               (udev-configuration
  48.                (inherit config)
  49.                (rules (cons brightnessctl
  50.                             (udev-configuration-rules config)))))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement