channel

My GNU Guix channel
Log | Files | Refs | README

services.scm (5034B)


      1 (define-module (loquat services)
      2   #:use-module (guix gexp)
      3   #:use-module (gnu packages libusb)
      4   #:use-module (gnu packages linux)
      5   #:use-module (gnu packages nfs)
      6   #:use-module (gnu services)
      7   #:use-module (gnu services avahi)
      8   #:use-module (gnu services base)
      9   #:use-module (gnu services dbus)
     10   #:use-module (gnu services desktop)
     11   #:use-module (gnu services networking)
     12   #:use-module (gnu services sound)
     13   #:use-module (gnu services ssh)
     14   #:use-module (gnu system)
     15   #:use-module (gnu system privilege)
     16   #:use-module (loquat channels)
     17   #:export (%loquat-clergy-base-services
     18             %loquat-laity-base-services
     19             %loquat-desktop-services))
     20 
     21 ;; Provide substitutes for laity on the same network
     22 (define %loquat-clergy-base-services
     23   (append
     24     (list 
     25       ;; Host a local substitute server
     26       (service guix-publish-service-type
     27                (guix-publish-configuration
     28                  (host "0.0.0.0") ;; Open up to any connection
     29                  (advertise? #t))) ;; Allow automatic detection on other systems
     30       (service openssh-service-type
     31                (openssh-configuration
     32                  (password-authentication? #f))))
     33     (modify-services %base-services
     34       (guix-service-type
     35         config => (guix-configuration
     36                     (inherit config)
     37                     (channels %loquat-channels)
     38                     (substitute-urls %loquat-substitute-urls)
     39                     (authorized-keys %loquat-authorized-guix-keys))))))
     40 
     41 ;; Discover clergy on the local network and use them as a substitute
     42 (define %loquat-laity-base-services
     43     (modify-services %base-services
     44       ;; Authorize all the signing keys of the 'clergyman' systems 
     45       (guix-service-type
     46         config => (guix-configuration
     47                     (inherit config)
     48                     (channels %loquat-channels)
     49                     (substitute-urls %loquat-substitute-urls)
     50                     (discover? #t)
     51                     (authorized-keys %loquat-authorized-guix-keys)))))
     52 
     53 ;;; This is a slimmed-down DE-agnostic version of %desktop-services.
     54 ;;; It is meant to be built upon and does NOT include %base-services.
     55 ;;; TODO: Cleanup
     56 
     57 (define %loquat-desktop-services
     58   (list
     59     ;; Screen lockers are a pretty useful thing and these are small.
     60     ;;(service screen-locker-service-type
     61     ;;         (screen-locker-configuration
     62     ;;          (name "slock")
     63     ;;          (program (file-append slock "/bin/slock"))))
     64     ;;(service screen-locker-service-type
     65     ;;         (screen-locker-configuration
     66     ;;         (name "xlock")
     67     ;;         (program (file-append xlockmore "/bin/xlock"))))
     68 
     69     ;; Add udev rules for MTP devices so that non-root users can access
     70     ;; them.
     71     (simple-service 'mtp udev-service-type (list libmtp))
     72     ;; Add udev rules for scanners.
     73     (service sane-service-type)
     74     ;; Add polkit rules, so that non-root users in the wheel group can
     75     ;; perform administrative tasks (similar to "sudo").
     76     polkit-wheel-service
     77 
     78     ;; Allow desktop users to also mount NTFS and NFS file systems
     79     ;; without root.
     80     (simple-service 'mount-setuid-helpers privileged-program-service-type
     81                     (map file-like->setuid-program
     82                          (list (file-append nfs-utils "/sbin/mount.nfs")
     83                           (file-append ntfs-3g "/sbin/mount.ntfs-3g"))))
     84 
     85     ;; Add some of the artwork niceties for the desktop.
     86     (simple-service 'guix-artwork
     87                     profile-service-type
     88                     %base-packages-artwork)
     89 
     90     ;; This is a volatile read-write file system mounted at /var/lib/gdm,
     91     ;; to avoid GDM stale cache and permission issues.
     92     ;;gdm-file-system-service
     93 
     94     ;; Provides a nicer experience for VTE-using terminal emulators such
     95     ;; as GNOME Console, Xfce Terminal, etc.
     96     ;;(service vte-integration-service-type)
     97 
     98     ;; The global fontconfig cache directory can sometimes contain
     99     ;; stale entries, possibly referencing fonts that have been GC'd,
    100     ;; so mount it read-only.
    101     fontconfig-file-system-service
    102 
    103     ;; NetworkManager and its applet.
    104     (service network-manager-service-type)
    105     (service wpa-supplicant-service-type)    ;needed by NetworkManager
    106     ;;(simple-service 'network-manager-applet
    107     ;;                profile-service-type
    108     ;;                (list network-manager-applet))
    109     ;;(service modem-manager-service-type)
    110     (service usb-modeswitch-service-type)
    111 
    112     ;; The D-Bus clique.
    113     (service avahi-service-type)
    114     (service udisks-service-type)
    115     (service upower-service-type)
    116     (service accountsservice-service-type)
    117     ;;(service cups-service-type)
    118     ;;(service cups-pk-helper-service-type)
    119     (service colord-service-type)
    120     (service geoclue-service-type)
    121     (service polkit-service-type)
    122     (service elogind-service-type)
    123     (service dbus-root-service-type)
    124 
    125     (service ntp-service-type)
    126 
    127     ;;(service x11-socket-directory-service-type)
    128 
    129     (service pulseaudio-service-type)
    130     (service alsa-service-type)))