services.scm 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (gnu installer services)
  19. #:use-module (guix records)
  20. #:export (<desktop-environment>
  21. desktop-environment
  22. make-desktop-environment
  23. desktop-environment-name
  24. desktop-environment-snippet
  25. %desktop-environments
  26. desktop-environments->configuration))
  27. (define-record-type* <desktop-environment>
  28. desktop-environment make-desktop-environment
  29. desktop-environment?
  30. (name desktop-environment-name) ;string
  31. (snippet desktop-environment-snippet)) ;symbol
  32. ;; This is the list of desktop environments supported as services.
  33. (define %desktop-environments
  34. (list
  35. (desktop-environment
  36. (name "GNOME")
  37. (snippet '(gnome-desktop-service)))
  38. (desktop-environment
  39. (name "Xfce")
  40. (snippet '(xfce-desktop-service)))
  41. (desktop-environment
  42. (name "MATE")
  43. (snippet '(mate-desktop-service)))
  44. (desktop-environment
  45. (name "Enlightenment")
  46. (snippet '(service enlightenment-desktop-service-type)))))
  47. (define (desktop-environments->configuration desktop-environments)
  48. "Return the configuration field for DESKTOP-ENVIRONMENTS."
  49. (let ((snippets
  50. (map desktop-environment-snippet desktop-environments)))
  51. `(,@(if (null? snippets)
  52. '()
  53. `((services (cons* ,@snippets
  54. %desktop-services)))))))