desktop.scm 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com>
  4. ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
  5. ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
  6. ;;; Copyright © 2017, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  7. ;;; Copyright © 2017 Nikita <nikita@n0.is>
  8. ;;; Copyright © 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
  9. ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
  10. ;;; Copyright © 2017, 2019 Christopher Baines <mail@cbaines.net>
  11. ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
  12. ;;; Copyright © 2019 David Wilson <david@daviwil.com>
  13. ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
  14. ;;; Copyright © 2020 Reza Alizadeh Majd <r.majd@pantherx.org>
  15. ;;;
  16. ;;; This file is part of GNU Guix.
  17. ;;;
  18. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  19. ;;; under the terms of the GNU General Public License as published by
  20. ;;; the Free Software Foundation; either version 3 of the License, or (at
  21. ;;; your option) any later version.
  22. ;;;
  23. ;;; GNU Guix is distributed in the hope that it will be useful, but
  24. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  25. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. ;;; GNU General Public License for more details.
  27. ;;;
  28. ;;; You should have received a copy of the GNU General Public License
  29. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  30. (define-module (gnu services desktop)
  31. #:use-module (gnu services)
  32. #:use-module (gnu services shepherd)
  33. #:use-module (gnu services base)
  34. #:use-module (gnu services dbus)
  35. #:use-module (gnu services avahi)
  36. #:use-module (gnu services xorg)
  37. #:use-module (gnu services networking)
  38. #:use-module (gnu services sound)
  39. #:use-module ((gnu system file-systems)
  40. #:select (%elogind-file-systems file-system))
  41. #:use-module (gnu system)
  42. #:use-module (gnu system shadow)
  43. #:use-module (gnu system pam)
  44. #:use-module (gnu packages glib)
  45. #:use-module (gnu packages admin)
  46. #:use-module (gnu packages cups)
  47. #:use-module (gnu packages freedesktop)
  48. #:use-module (gnu packages gnome)
  49. #:use-module (gnu packages xfce)
  50. #:use-module (gnu packages avahi)
  51. #:use-module (gnu packages xdisorg)
  52. #:use-module (gnu packages scanner)
  53. #:use-module (gnu packages suckless)
  54. #:use-module (gnu packages linux)
  55. #:use-module (gnu packages libusb)
  56. #:use-module (gnu packages lxqt)
  57. #:use-module (gnu packages mate)
  58. #:use-module (gnu packages nfs)
  59. #:use-module (gnu packages enlightenment)
  60. #:use-module (guix deprecation)
  61. #:use-module (guix records)
  62. #:use-module (guix packages)
  63. #:use-module (guix store)
  64. #:use-module (guix utils)
  65. #:use-module (guix gexp)
  66. #:use-module (srfi srfi-1)
  67. #:use-module (ice-9 match)
  68. #:export (<upower-configuration>
  69. upower-configuration
  70. upower-configuration?
  71. upower-configuration-upower
  72. upower-configuration-watts-up-pro?
  73. upower-configuration-poll-batteries?
  74. upower-configuration-ignore-lid?
  75. upower-configuration-use-percentage-for-policy?
  76. upower-configuration-percentage-low
  77. upower-configuration-percentage-critical
  78. upower-configuration-percentage-action
  79. upower-configuration-time-low
  80. upower-configuration-time-critical
  81. upower-configuration-time-action
  82. upower-configuration-critical-power-action
  83. upower-service-type
  84. udisks-configuration
  85. udisks-configuration?
  86. udisks-service
  87. udisks-service-type
  88. colord-service-type
  89. geoclue-application
  90. geoclue-configuration
  91. geoclue-configuration?
  92. %standard-geoclue-applications
  93. geoclue-service
  94. geoclue-service-type
  95. bluetooth-service-type
  96. bluetooth-configuration
  97. bluetooth-configuration?
  98. bluetooth-service
  99. elogind-configuration
  100. elogind-configuration?
  101. elogind-service
  102. elogind-service-type
  103. %fontconfig-file-system
  104. fontconfig-file-system-service
  105. accountsservice-service-type
  106. accountsservice-service
  107. cups-pk-helper-service-type
  108. sane-service-type
  109. gnome-desktop-configuration
  110. gnome-desktop-configuration?
  111. gnome-desktop-service
  112. gnome-desktop-service-type
  113. mate-desktop-configuration
  114. mate-desktop-configuration?
  115. mate-desktop-service
  116. mate-desktop-service-type
  117. lxqt-desktop-configuration
  118. lxqt-desktop-configuration?
  119. lxqt-desktop-service-type
  120. xfce-desktop-configuration
  121. xfce-desktop-configuration?
  122. xfce-desktop-service
  123. xfce-desktop-service-type
  124. x11-socket-directory-service
  125. enlightenment-desktop-configuration
  126. enlightenment-desktop-configuration?
  127. enlightenment-desktop-service-type
  128. inputattach-configuration
  129. inputattach-configuration?
  130. inputattach-service-type
  131. polkit-wheel-service
  132. gnome-keyring-configuration
  133. gnome-keyring-configuration?
  134. gnome-keyring-service-type
  135. %desktop-services))
  136. ;;; Commentary:
  137. ;;;
  138. ;;; This module contains service definitions for a "desktop" environment.
  139. ;;;
  140. ;;; Code:
  141. ;;;
  142. ;;; Helpers.
  143. ;;;
  144. (define (bool value)
  145. (if value "true\n" "false\n"))
  146. (define (package-direct-input-selector input)
  147. (lambda (package)
  148. (match (assoc-ref (package-direct-inputs package) input)
  149. ((package . _) package))))
  150. ;;;
  151. ;;; Upower D-Bus service.
  152. ;;;
  153. (define-record-type* <upower-configuration>
  154. upower-configuration make-upower-configuration
  155. upower-configuration?
  156. (upower upower-configuration-upower
  157. (default upower))
  158. (watts-up-pro? upower-configuration-watts-up-pro?
  159. (default #f))
  160. (poll-batteries? upower-configuration-poll-batteries?
  161. (default #t))
  162. (ignore-lid? upower-configuration-ignore-lid?
  163. (default #f))
  164. (use-percentage-for-policy? upower-configuration-use-percentage-for-policy?
  165. (default #f))
  166. (percentage-low upower-configuration-percentage-low
  167. (default 10))
  168. (percentage-critical upower-configuration-percentage-critical
  169. (default 3))
  170. (percentage-action upower-configuration-percentage-action
  171. (default 2))
  172. (time-low upower-configuration-time-low
  173. (default 1200))
  174. (time-critical upower-configuration-time-critical
  175. (default 300))
  176. (time-action upower-configuration-time-action
  177. (default 120))
  178. (critical-power-action upower-configuration-critical-power-action
  179. (default 'hybrid-sleep)))
  180. (define* upower-configuration-file
  181. ;; Return an upower-daemon configuration file.
  182. (match-lambda
  183. (($ <upower-configuration> upower
  184. watts-up-pro? poll-batteries? ignore-lid? use-percentage-for-policy?
  185. percentage-low percentage-critical percentage-action time-low
  186. time-critical time-action critical-power-action)
  187. (plain-file "UPower.conf"
  188. (string-append
  189. "[UPower]\n"
  190. "EnableWattsUpPro=" (bool watts-up-pro?)
  191. "NoPollBatteries=" (bool (not poll-batteries?))
  192. "IgnoreLid=" (bool ignore-lid?)
  193. "UsePercentageForPolicy=" (bool use-percentage-for-policy?)
  194. "PercentageLow=" (number->string percentage-low) "\n"
  195. "PercentageCritical=" (number->string percentage-critical) "\n"
  196. "PercentageAction=" (number->string percentage-action) "\n"
  197. "TimeLow=" (number->string time-low) "\n"
  198. "TimeCritical=" (number->string time-critical) "\n"
  199. "TimeAction=" (number->string time-action) "\n"
  200. "CriticalPowerAction=" (match critical-power-action
  201. ('hybrid-sleep "HybridSleep")
  202. ('hibernate "Hibernate")
  203. ('power-off "PowerOff"))
  204. "\n")))))
  205. (define %upower-activation
  206. #~(begin
  207. (use-modules (guix build utils))
  208. (mkdir-p "/var/lib/upower")))
  209. (define (upower-dbus-service config)
  210. (list (wrapped-dbus-service (upower-configuration-upower config)
  211. "libexec/upowerd"
  212. `(("UPOWER_CONF_FILE_NAME"
  213. ,(upower-configuration-file config))))))
  214. (define (upower-shepherd-service config)
  215. "Return a shepherd service for UPower with CONFIG."
  216. (let ((upower (upower-configuration-upower config))
  217. (config (upower-configuration-file config)))
  218. (list (shepherd-service
  219. (documentation "Run the UPower power and battery monitor.")
  220. (provision '(upower-daemon))
  221. (requirement '(dbus-system udev))
  222. (start #~(make-forkexec-constructor
  223. (list (string-append #$upower "/libexec/upowerd"))
  224. #:environment-variables
  225. (list (string-append "UPOWER_CONF_FILE_NAME="
  226. #$config))))
  227. (stop #~(make-kill-destructor))))))
  228. (define upower-service-type
  229. (let ((upower-package (compose list upower-configuration-upower)))
  230. (service-type (name 'upower)
  231. (description
  232. "Run @command{upowerd}}, a system-wide monitor for power
  233. consumption and battery levels, with the given configuration settings. It
  234. implements the @code{org.freedesktop.UPower} D-Bus interface, and is notably
  235. used by GNOME.")
  236. (extensions
  237. (list (service-extension dbus-root-service-type
  238. upower-dbus-service)
  239. (service-extension shepherd-root-service-type
  240. upower-shepherd-service)
  241. (service-extension activation-service-type
  242. (const %upower-activation))
  243. (service-extension udev-service-type
  244. upower-package)
  245. ;; Make the 'upower' command visible.
  246. (service-extension profile-service-type
  247. upower-package)))
  248. (default-value (upower-configuration)))))
  249. ;;;
  250. ;;; GeoClue D-Bus service.
  251. ;;;
  252. ;; TODO: Export.
  253. (define-record-type* <geoclue-configuration>
  254. geoclue-configuration make-geoclue-configuration
  255. geoclue-configuration?
  256. (geoclue geoclue-configuration-geoclue
  257. (default geoclue))
  258. (whitelist geoclue-configuration-whitelist)
  259. (wifi-geolocation-url geoclue-configuration-wifi-geolocation-url)
  260. (submit-data? geoclue-configuration-submit-data?)
  261. (wifi-submission-url geoclue-configuration-wifi-submission-url)
  262. (submission-nick geoclue-configuration-submission-nick)
  263. (applications geoclue-configuration-applications))
  264. (define* (geoclue-application name #:key (allowed? #t) system? (users '()))
  265. "Configure default GeoClue access permissions for an application. NAME is
  266. the Desktop ID of the application, without the .desktop part. If ALLOWED? is
  267. true, the application will have access to location information by default.
  268. The boolean SYSTEM? value indicates that an application is a system component
  269. or not. Finally USERS is a list of UIDs of all users for which this
  270. application is allowed location info access. An empty users list means all
  271. users are allowed."
  272. (string-append
  273. "[" name "]\n"
  274. "allowed=" (bool allowed?)
  275. "system=" (bool system?)
  276. "users=" (string-join users ";") "\n"))
  277. (define %standard-geoclue-applications
  278. (list (geoclue-application "gnome-datetime-panel" #:system? #t)
  279. (geoclue-application "epiphany" #:system? #f)
  280. (geoclue-application "firefox" #:system? #f)))
  281. (define* (geoclue-configuration-file config)
  282. "Return a geoclue configuration file."
  283. (plain-file "geoclue.conf"
  284. (string-append
  285. "[agent]\n"
  286. "whitelist="
  287. (string-join (geoclue-configuration-whitelist config)
  288. ";") "\n"
  289. "[wifi]\n"
  290. "url=" (geoclue-configuration-wifi-geolocation-url config) "\n"
  291. "submit-data=" (bool (geoclue-configuration-submit-data? config))
  292. "submission-url="
  293. (geoclue-configuration-wifi-submission-url config) "\n"
  294. "submission-nick="
  295. (geoclue-configuration-submission-nick config)
  296. "\n"
  297. (string-join (geoclue-configuration-applications config)
  298. "\n"))))
  299. (define (geoclue-dbus-service config)
  300. (list (wrapped-dbus-service (geoclue-configuration-geoclue config)
  301. "libexec/geoclue"
  302. `(("GEOCLUE_CONFIG_FILE"
  303. ,(geoclue-configuration-file config))))))
  304. (define %geoclue-accounts
  305. (list (user-group (name "geoclue") (system? #t))
  306. (user-account
  307. (name "geoclue")
  308. (group "geoclue")
  309. (system? #t)
  310. (comment "GeoClue daemon user")
  311. (home-directory "/var/empty")
  312. (shell "/run/current-system/profile/sbin/nologin"))))
  313. (define geoclue-service-type
  314. (service-type (name 'geoclue)
  315. (extensions
  316. (list (service-extension dbus-root-service-type
  317. geoclue-dbus-service)
  318. (service-extension account-service-type
  319. (const %geoclue-accounts))))))
  320. (define* (geoclue-service #:key (geoclue geoclue)
  321. (whitelist '())
  322. (wifi-geolocation-url
  323. ;; Mozilla geolocation service:
  324. "https://location.services.mozilla.com/v1/geolocate?key=geoclue")
  325. (submit-data? #f)
  326. (wifi-submission-url
  327. "https://location.services.mozilla.com/v1/submit?key=geoclue")
  328. (submission-nick "geoclue")
  329. (applications %standard-geoclue-applications))
  330. "Return a service that runs the @command{geoclue} location service. This
  331. service provides a D-Bus interface to allow applications to request access to
  332. a user's physical location, and optionally to add information to online
  333. location databases. By default, only the GNOME date-time panel and the Icecat
  334. and Epiphany web browsers are able to ask for the user's location, and in the
  335. case of Icecat and Epiphany, both will ask the user for permission first. See
  336. @uref{https://wiki.freedesktop.org/www/Software/GeoClue/, the geoclue web
  337. site} for more information."
  338. (service geoclue-service-type
  339. (geoclue-configuration
  340. (geoclue geoclue)
  341. (whitelist whitelist)
  342. (wifi-geolocation-url wifi-geolocation-url)
  343. (submit-data? submit-data?)
  344. (wifi-submission-url wifi-submission-url)
  345. (submission-nick submission-nick)
  346. (applications applications))))
  347. ;;;
  348. ;;; Bluetooth.
  349. ;;;
  350. (define-record-type* <bluetooth-configuration>
  351. bluetooth-configuration make-bluetooth-configuration
  352. bluetooth-configuration?
  353. (bluez bluetooth-configuration-bluez (default bluez))
  354. (auto-enable? bluetooth-configuration-auto-enable? (default #f)))
  355. (define (bluetooth-configuration-file config)
  356. "Return a configuration file for the systemd bluetooth service, as a string."
  357. (string-append
  358. "[Policy]\n"
  359. "AutoEnable=" (bool (bluetooth-configuration-auto-enable?
  360. config))))
  361. (define (bluetooth-directory config)
  362. (computed-file "etc-bluetooth"
  363. #~(begin
  364. (mkdir #$output)
  365. (chdir #$output)
  366. (call-with-output-file "main.conf"
  367. (lambda (port)
  368. (display #$(bluetooth-configuration-file config)
  369. port))))))
  370. (define (bluetooth-shepherd-service config)
  371. "Return a shepherd service for @command{bluetoothd}."
  372. (shepherd-service
  373. (provision '(bluetooth))
  374. (requirement '(dbus-system udev))
  375. (documentation "Run the bluetoothd daemon.")
  376. (start #~(make-forkexec-constructor
  377. (list #$(file-append (bluetooth-configuration-bluez config)
  378. "/libexec/bluetooth/bluetoothd"))))
  379. (stop #~(make-kill-destructor))))
  380. (define bluetooth-service-type
  381. (service-type
  382. (name 'bluetooth)
  383. (extensions
  384. (list (service-extension dbus-root-service-type
  385. (compose list bluetooth-configuration-bluez))
  386. (service-extension udev-service-type
  387. (compose list bluetooth-configuration-bluez))
  388. (service-extension etc-service-type
  389. (lambda (config)
  390. `(("bluetooth"
  391. ,(bluetooth-directory config)))))
  392. (service-extension shepherd-root-service-type
  393. (compose list bluetooth-shepherd-service))))
  394. (default-value (bluetooth-configuration))
  395. (description "Run the @command{bluetoothd} daemon, which manages all the
  396. Bluetooth devices and provides a number of D-Bus interfaces.")))
  397. (define* (bluetooth-service #:key (bluez bluez) (auto-enable? #f))
  398. "Return a service that runs the @command{bluetoothd} daemon, which manages
  399. all the Bluetooth devices and provides a number of D-Bus interfaces. When
  400. AUTO-ENABLE? is true, the bluetooth controller is powered automatically at
  401. boot.
  402. Users need to be in the @code{lp} group to access the D-Bus service.
  403. "
  404. (service bluetooth-service-type
  405. (bluetooth-configuration
  406. (bluez bluez)
  407. (auto-enable? auto-enable?))))
  408. ;;;
  409. ;;; Colord D-Bus service.
  410. ;;;
  411. (define %colord-activation
  412. #~(begin
  413. (use-modules (guix build utils))
  414. (mkdir-p "/var/lib/colord")
  415. (let ((user (getpwnam "colord")))
  416. (chown "/var/lib/colord"
  417. (passwd:uid user) (passwd:gid user)))))
  418. (define %colord-accounts
  419. (list (user-group (name "colord") (system? #t))
  420. (user-account
  421. (name "colord")
  422. (group "colord")
  423. (system? #t)
  424. (comment "colord daemon user")
  425. (home-directory "/var/empty")
  426. (shell (file-append shadow "/sbin/nologin")))))
  427. (define colord-service-type
  428. (service-type (name 'colord)
  429. (extensions
  430. (list (service-extension account-service-type
  431. (const %colord-accounts))
  432. (service-extension activation-service-type
  433. (const %colord-activation))
  434. ;; Colord is a D-Bus service that dbus-daemon can
  435. ;; activate.
  436. (service-extension dbus-root-service-type list)
  437. ;; Colord provides "color device" rules for udev.
  438. (service-extension udev-service-type list)
  439. ;; It provides polkit "actions".
  440. (service-extension polkit-service-type list)))
  441. (default-value colord)
  442. (description
  443. "Run @command{colord}, a system service with a D-Bus
  444. interface to manage the color profiles of input and output devices such as
  445. screens and scanners.")))
  446. ;;;
  447. ;;; UDisks.
  448. ;;;
  449. (define-record-type* <udisks-configuration>
  450. udisks-configuration make-udisks-configuration
  451. udisks-configuration?
  452. (udisks udisks-configuration-udisks
  453. (default udisks)))
  454. (define %udisks-activation
  455. (with-imported-modules '((guix build utils))
  456. #~(begin
  457. (use-modules (guix build utils))
  458. (let ((run-dir "/var/run/udisks2"))
  459. (mkdir-p run-dir)
  460. (chmod run-dir #o700)))))
  461. (define udisks-service-type
  462. (let ((udisks-package (lambda (config)
  463. (list (udisks-configuration-udisks config)))))
  464. (service-type (name 'udisks)
  465. (extensions
  466. (list (service-extension polkit-service-type
  467. udisks-package)
  468. (service-extension dbus-root-service-type
  469. udisks-package)
  470. (service-extension udev-service-type
  471. udisks-package)
  472. (service-extension activation-service-type
  473. (const %udisks-activation))
  474. ;; Profile 'udisksctl' & co. in the system profile.
  475. (service-extension profile-service-type
  476. udisks-package))))))
  477. (define* (udisks-service #:key (udisks udisks))
  478. "Return a service for @uref{http://udisks.freedesktop.org/docs/latest/,
  479. UDisks}, a @dfn{disk management} daemon that provides user interfaces with
  480. notifications and ways to mount/unmount disks. Programs that talk to UDisks
  481. include the @command{udisksctl} command, part of UDisks, and GNOME Disks."
  482. (service udisks-service-type
  483. (udisks-configuration (udisks udisks))))
  484. ;;;
  485. ;;; Elogind login and seat management service.
  486. ;;;
  487. (define-record-type* <elogind-configuration> elogind-configuration
  488. make-elogind-configuration
  489. elogind-configuration?
  490. (elogind elogind-package
  491. (default elogind))
  492. (kill-user-processes? elogind-kill-user-processes?
  493. (default #f))
  494. (kill-only-users elogind-kill-only-users
  495. (default '()))
  496. (kill-exclude-users elogind-kill-exclude-users
  497. (default '("root")))
  498. (inhibit-delay-max-seconds elogind-inhibit-delay-max-seconds
  499. (default 5))
  500. (handle-power-key elogind-handle-power-key
  501. (default 'poweroff))
  502. (handle-suspend-key elogind-handle-suspend-key
  503. (default 'suspend))
  504. (handle-hibernate-key elogind-handle-hibernate-key
  505. ;; (default 'hibernate)
  506. ;; XXX Ignore it for now, since we don't
  507. ;; yet handle resume-from-hibernation in
  508. ;; our initrd.
  509. (default 'ignore))
  510. (handle-lid-switch elogind-handle-lid-switch
  511. (default 'suspend))
  512. (handle-lid-switch-docked elogind-handle-lid-switch-docked
  513. (default 'ignore))
  514. (handle-lid-switch-external-power elogind-handle-lid-switch-external-power
  515. (default 'ignore))
  516. (power-key-ignore-inhibited? elogind-power-key-ignore-inhibited?
  517. (default #f))
  518. (suspend-key-ignore-inhibited? elogind-suspend-key-ignore-inhibited?
  519. (default #f))
  520. (hibernate-key-ignore-inhibited? elogind-hibernate-key-ignore-inhibited?
  521. (default #f))
  522. (lid-switch-ignore-inhibited? elogind-lid-switch-ignore-inhibited?
  523. (default #t))
  524. (holdoff-timeout-seconds elogind-holdoff-timeout-seconds
  525. (default 30))
  526. (idle-action elogind-idle-action
  527. (default 'ignore))
  528. (idle-action-seconds elogind-idle-action-seconds
  529. (default (* 30 60)))
  530. (runtime-directory-size-percent elogind-runtime-directory-size-percent
  531. (default 10))
  532. (runtime-directory-size elogind-runtime-directory-size
  533. (default #f))
  534. (remove-ipc? elogind-remove-ipc?
  535. (default #t))
  536. (suspend-state elogind-suspend-state
  537. (default '("mem" "standby" "freeze")))
  538. (suspend-mode elogind-suspend-mode
  539. (default '()))
  540. (hibernate-state elogind-hibernate-state
  541. (default '("disk")))
  542. (hibernate-mode elogind-hibernate-mode
  543. (default '("platform" "shutdown")))
  544. (hybrid-sleep-state elogind-hybrid-sleep-state
  545. (default '("disk")))
  546. (hybrid-sleep-mode elogind-hybrid-sleep-mode
  547. (default
  548. '("suspend" "platform" "shutdown"))))
  549. (define (elogind-configuration-file config)
  550. (define (yesno x)
  551. (match x
  552. (#t "yes")
  553. (#f "no")
  554. (_ (error "expected #t or #f, instead got:" x))))
  555. (define char-set:user-name
  556. (string->char-set "abcdefghijklmnopqrstuvwxyz0123456789_-"))
  557. (define (valid-list? l pred)
  558. (and-map (lambda (x) (string-every pred x)) l))
  559. (define (user-name-list users)
  560. (unless (valid-list? users char-set:user-name)
  561. (error "invalid user list" users))
  562. (string-join users " "))
  563. (define (enum val allowed)
  564. (unless (memq val allowed)
  565. (error "invalid value" val allowed))
  566. (symbol->string val))
  567. (define (non-negative-integer x)
  568. (unless (exact-integer? x) (error "not an integer" x))
  569. (when (negative? x) (error "negative number not allowed" x))
  570. (number->string x))
  571. (define handle-actions
  572. '(ignore poweroff reboot halt kexec suspend hibernate hybrid-sleep lock))
  573. (define (handle-action x)
  574. (enum x handle-actions))
  575. (define (sleep-list tokens)
  576. (unless (valid-list? tokens char-set:user-name)
  577. (error "invalid sleep list" tokens))
  578. (string-join tokens " "))
  579. (define-syntax ini-file-clause
  580. (syntax-rules ()
  581. ((_ config (prop (parser getter)))
  582. (string-append prop "=" (parser (getter config)) "\n"))
  583. ((_ config str)
  584. (string-append str "\n"))))
  585. (define-syntax-rule (ini-file config file clause ...)
  586. (plain-file file (string-append (ini-file-clause config clause) ...)))
  587. (ini-file
  588. config "logind.conf"
  589. "[Login]"
  590. ("KillUserProcesses" (yesno elogind-kill-user-processes?))
  591. ("KillOnlyUsers" (user-name-list elogind-kill-only-users))
  592. ("KillExcludeUsers" (user-name-list elogind-kill-exclude-users))
  593. ("InhibitDelayMaxSec" (non-negative-integer elogind-inhibit-delay-max-seconds))
  594. ("HandlePowerKey" (handle-action elogind-handle-power-key))
  595. ("HandleSuspendKey" (handle-action elogind-handle-suspend-key))
  596. ("HandleHibernateKey" (handle-action elogind-handle-hibernate-key))
  597. ("HandleLidSwitch" (handle-action elogind-handle-lid-switch))
  598. ("HandleLidSwitchDocked" (handle-action elogind-handle-lid-switch-docked))
  599. ("HandleLidSwitchExternalPower" (handle-action elogind-handle-lid-switch-external-power))
  600. ("PowerKeyIgnoreInhibited" (yesno elogind-power-key-ignore-inhibited?))
  601. ("SuspendKeyIgnoreInhibited" (yesno elogind-suspend-key-ignore-inhibited?))
  602. ("HibernateKeyIgnoreInhibited" (yesno elogind-hibernate-key-ignore-inhibited?))
  603. ("LidSwitchIgnoreInhibited" (yesno elogind-lid-switch-ignore-inhibited?))
  604. ("HoldoffTimeoutSec" (non-negative-integer elogind-holdoff-timeout-seconds))
  605. ("IdleAction" (handle-action elogind-idle-action))
  606. ("IdleActionSec" (non-negative-integer elogind-idle-action-seconds))
  607. ("RuntimeDirectorySize"
  608. (identity
  609. (lambda (config)
  610. (match (elogind-runtime-directory-size-percent config)
  611. (#f (non-negative-integer (elogind-runtime-directory-size config)))
  612. (percent (string-append (non-negative-integer percent) "%"))))))
  613. ("RemoveIPC" (yesno elogind-remove-ipc?))
  614. "[Sleep]"
  615. ("SuspendState" (sleep-list elogind-suspend-state))
  616. ("SuspendMode" (sleep-list elogind-suspend-mode))
  617. ("HibernateState" (sleep-list elogind-hibernate-state))
  618. ("HibernateMode" (sleep-list elogind-hibernate-mode))
  619. ("HybridSleepState" (sleep-list elogind-hybrid-sleep-state))
  620. ("HybridSleepMode" (sleep-list elogind-hybrid-sleep-mode))))
  621. (define (elogind-dbus-service config)
  622. (list (wrapped-dbus-service (elogind-package config)
  623. "libexec/elogind/elogind"
  624. `(("ELOGIND_CONF_FILE"
  625. ,(elogind-configuration-file config))))))
  626. (define (pam-extension-procedure config)
  627. "Return an extension for PAM-ROOT-SERVICE-TYPE that ensures that all the PAM
  628. services use 'pam_elogind.so', a module that allows elogind to keep track of
  629. logged-in users (run 'loginctl' to see elogind's world view of users and
  630. seats.)"
  631. (define pam-elogind
  632. (pam-entry
  633. (control "required")
  634. (module (file-append (elogind-package config)
  635. "/lib/security/pam_elogind.so"))))
  636. (list (lambda (pam)
  637. (pam-service
  638. (inherit pam)
  639. (session (cons pam-elogind (pam-service-session pam)))))))
  640. (define (elogind-shepherd-service config)
  641. "Return a Shepherd service to start elogind according to @var{config}."
  642. (list (shepherd-service
  643. (requirement '(dbus-system))
  644. (provision '(elogind))
  645. (start #~(make-forkexec-constructor
  646. (list #$(file-append (elogind-package config)
  647. "/libexec/elogind/elogind"))
  648. #:environment-variables
  649. (list (string-append "ELOGIND_CONF_FILE="
  650. #$(elogind-configuration-file
  651. config)))))
  652. (stop #~(make-kill-destructor)))))
  653. (define elogind-service-type
  654. (service-type (name 'elogind)
  655. (extensions
  656. (list (service-extension dbus-root-service-type
  657. elogind-dbus-service)
  658. (service-extension udev-service-type
  659. (compose list elogind-package))
  660. (service-extension polkit-service-type
  661. (compose list elogind-package))
  662. ;; Start elogind from the Shepherd rather than waiting
  663. ;; for bus activation. This ensures that it can handle
  664. ;; events like lid close, etc.
  665. (service-extension shepherd-root-service-type
  666. elogind-shepherd-service)
  667. ;; Provide the 'loginctl' command.
  668. (service-extension profile-service-type
  669. (compose list elogind-package))
  670. ;; Extend PAM with pam_elogind.so.
  671. (service-extension pam-root-service-type
  672. pam-extension-procedure)
  673. ;; We need /run/user, /run/systemd, etc.
  674. (service-extension file-system-service-type
  675. (const %elogind-file-systems))))
  676. (default-value (elogind-configuration))))
  677. (define* (elogind-service #:key (config (elogind-configuration)))
  678. "Return a service that runs the @command{elogind} login and seat management
  679. service. The @command{elogind} service integrates with PAM to allow other
  680. system components to know the set of logged-in users as well as their session
  681. types (graphical, console, remote, etc.). It can also clean up after users
  682. when they log out."
  683. (service elogind-service-type config))
  684. ;;;
  685. ;;; Fontconfig and other desktop file-systems.
  686. ;;;
  687. (define %fontconfig-file-system
  688. (file-system
  689. (device "none")
  690. (mount-point "/var/cache/fontconfig")
  691. (type "tmpfs")
  692. (flags '(read-only))
  693. (check? #f)))
  694. ;; The global fontconfig cache directory can sometimes contain stale entries,
  695. ;; possibly referencing fonts that have been GC'd, so mount it read-only.
  696. ;; As mentioned https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36924#8 and
  697. ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38046#10 and elsewhere.
  698. (define fontconfig-file-system-service
  699. (simple-service 'fontconfig-file-system
  700. file-system-service-type
  701. (list %fontconfig-file-system)))
  702. ;;;
  703. ;;; AccountsService service.
  704. ;;;
  705. (define %accountsservice-activation
  706. #~(begin
  707. (use-modules (guix build utils))
  708. (mkdir-p "/var/lib/AccountsService")))
  709. (define accountsservice-service-type
  710. (service-type (name 'accountsservice)
  711. (extensions
  712. (list (service-extension activation-service-type
  713. (const %accountsservice-activation))
  714. (service-extension dbus-root-service-type list)
  715. (service-extension polkit-service-type list)))
  716. (default-value accountsservice)))
  717. (define* (accountsservice-service #:key (accountsservice accountsservice))
  718. "Return a service that runs AccountsService, a system service that
  719. can list available accounts, change their passwords, and so on.
  720. AccountsService integrates with PolicyKit to enable unprivileged users to
  721. acquire the capability to modify their system configuration.
  722. @uref{https://www.freedesktop.org/wiki/Software/AccountsService/, the
  723. accountsservice web site} for more information."
  724. (service accountsservice-service-type accountsservice))
  725. ;;;
  726. ;;; cups-pk-helper service.
  727. ;;;
  728. (define cups-pk-helper-service-type
  729. (service-type
  730. (name 'cups-pk-helper)
  731. (description
  732. "PolicyKit helper to configure CUPS with fine-grained privileges.")
  733. (extensions
  734. (list (service-extension dbus-root-service-type list)
  735. (service-extension polkit-service-type list)))
  736. (default-value cups-pk-helper)))
  737. ;;;
  738. ;;; Scanner access via SANE.
  739. ;;;
  740. (define %sane-accounts
  741. ;; The '60-libsane.rules' udev rules refers to the "scanner" group.
  742. (list (user-group (name "scanner") (system? #t))))
  743. (define sane-service-type
  744. (service-type
  745. (name 'sane)
  746. (description
  747. "This service provides access to scanners @i{via}
  748. @uref{http://www.sane-project.org, SANE} by installing the necessary udev
  749. rules.")
  750. (default-value sane-backends-minimal)
  751. (extensions
  752. (list (service-extension udev-service-type list)
  753. (service-extension account-service-type
  754. (const %sane-accounts))))))
  755. ;;;
  756. ;;; GNOME desktop service.
  757. ;;;
  758. (define-record-type* <gnome-desktop-configuration> gnome-desktop-configuration
  759. make-gnome-desktop-configuration
  760. gnome-desktop-configuration?
  761. (gnome gnome-package (default gnome)))
  762. (define (gnome-polkit-settings config)
  763. "Return the list of GNOME dependencies that provide polkit actions and
  764. rules."
  765. (let ((gnome (gnome-package config)))
  766. (map (lambda (name)
  767. ((package-direct-input-selector name) gnome))
  768. '("gnome-settings-daemon"
  769. "gnome-control-center"
  770. "gnome-system-monitor"
  771. "gvfs"))))
  772. (define gnome-desktop-service-type
  773. (service-type
  774. (name 'gnome-desktop)
  775. (extensions
  776. (list (service-extension polkit-service-type
  777. gnome-polkit-settings)
  778. (service-extension profile-service-type
  779. (compose list
  780. gnome-package))))
  781. (default-value (gnome-desktop-configuration))
  782. (description "Run the GNOME desktop environment.")))
  783. (define-deprecated (gnome-desktop-service #:key (config
  784. (gnome-desktop-configuration)))
  785. gnome-desktop-service-type
  786. "Return a service that adds the @code{gnome} package to the system profile,
  787. and extends polkit with the actions from @code{gnome-settings-daemon}."
  788. (service gnome-desktop-service-type config))
  789. ;; MATE Desktop service.
  790. ;; TODO: Add mate-screensaver.
  791. (define-record-type* <mate-desktop-configuration> mate-desktop-configuration
  792. make-mate-desktop-configuration
  793. mate-desktop-configuration?
  794. (mate-package mate-package (default mate)))
  795. (define (mate-polkit-extension config)
  796. "Return the list of packages for CONFIG's MATE package that extend polkit."
  797. (let ((mate (mate-package config)))
  798. (map (lambda (input)
  799. ((package-direct-input-selector input) mate))
  800. '("mate-system-monitor" ;kill, renice processes
  801. "mate-settings-daemon" ;date/time settings
  802. "mate-power-manager" ;modify brightness
  803. "mate-control-center" ;RandR, display properties FIXME
  804. "mate-applets")))) ;CPU frequency scaling
  805. (define mate-desktop-service-type
  806. (service-type
  807. (name 'mate-desktop)
  808. (extensions
  809. (list (service-extension polkit-service-type
  810. mate-polkit-extension)
  811. (service-extension profile-service-type
  812. (compose list
  813. mate-package))))
  814. (default-value (mate-desktop-configuration))
  815. (description "Run the MATE desktop environment.")))
  816. (define-deprecated (mate-desktop-service #:key
  817. (config
  818. (mate-desktop-configuration)))
  819. mate-desktop-service-type
  820. "Return a service that adds the @code{mate} package to the system profile,
  821. and extends polkit with the actions from @code{mate-settings-daemon}."
  822. (service mate-desktop-service-type config))
  823. ;;;
  824. ;;; XFCE desktop service.
  825. ;;;
  826. (define-record-type* <xfce-desktop-configuration> xfce-desktop-configuration
  827. make-xfce-desktop-configuration
  828. xfce-desktop-configuration?
  829. (xfce xfce-package (default xfce)))
  830. (define (xfce-polkit-settings config)
  831. "Return the list of XFCE dependencies that provide polkit actions and
  832. rules."
  833. (let ((xfce (xfce-package config)))
  834. (map (lambda (name)
  835. ((package-direct-input-selector name) xfce))
  836. '("thunar"
  837. "xfce4-power-manager"))))
  838. (define xfce-desktop-service-type
  839. (service-type
  840. (name 'xfce-desktop)
  841. (extensions
  842. (list (service-extension polkit-service-type
  843. xfce-polkit-settings)
  844. (service-extension profile-service-type
  845. (compose list xfce-package))))
  846. (default-value (xfce-desktop-configuration))
  847. (description "Run the Xfce desktop environment.")))
  848. (define-deprecated (xfce-desktop-service #:key (config
  849. (xfce-desktop-configuration)))
  850. xfce-desktop-service-type
  851. "Return a service that adds the @code{xfce} package to the system profile,
  852. and extends polkit with the ability for @code{thunar} to manipulate the file
  853. system as root from within a user session, after the user has authenticated
  854. with the administrator's password."
  855. (service xfce-desktop-service-type config))
  856. +
  857. ;;;
  858. ;;; Lxqt desktop service.
  859. ;;;
  860. (define-record-type* <lxqt-desktop-configuration> lxqt-desktop-configuration
  861. make-lxqt-desktop-configuration
  862. lxqt-desktop-configuration?
  863. (lxqt lxqt-package
  864. (default lxqt)))
  865. (define (lxqt-polkit-settings config)
  866. "Return the list of LXQt dependencies that provide polkit actions and
  867. rules."
  868. (let ((lxqt (lxqt-package config)))
  869. (map (lambda (name)
  870. ((package-direct-input-selector name) lxqt))
  871. '("lxqt-admin"))))
  872. (define lxqt-desktop-service-type
  873. (service-type
  874. (name 'lxqt-desktop)
  875. (extensions
  876. (list (service-extension polkit-service-type
  877. lxqt-polkit-settings)
  878. (service-extension profile-service-type
  879. (compose list lxqt-package))))
  880. (default-value (lxqt-desktop-configuration))
  881. (description "Run LXQt desktop environment.")))
  882. ;;;
  883. ;;; X11 socket directory service
  884. ;;;
  885. (define x11-socket-directory-service
  886. ;; Return a service that creates /tmp/.X11-unix. When using X11, libxcb
  887. ;; takes care of creating that directory. However, when using XWayland, we
  888. ;; need to create beforehand. Thus, create it unconditionally here.
  889. (simple-service 'x11-socket-directory
  890. activation-service-type
  891. (with-imported-modules '((guix build utils))
  892. #~(begin
  893. (use-modules (guix build utils))
  894. (let ((directory "/tmp/.X11-unix"))
  895. (mkdir-p directory)
  896. (chmod directory #o777))))))
  897. ;;;
  898. ;;; Enlightenment desktop service.
  899. ;;;
  900. (define-record-type* <enlightenment-desktop-configuration>
  901. enlightenment-desktop-configuration make-enlightenment-desktop-configuration
  902. enlightenment-desktop-configuration?
  903. ;; <package>
  904. (enlightenment enlightenment-package
  905. (default enlightenment)))
  906. (define (enlightenment-setuid-programs enlightenment-desktop-configuration)
  907. (match-record enlightenment-desktop-configuration
  908. <enlightenment-desktop-configuration>
  909. (enlightenment)
  910. (list (file-append enlightenment
  911. "/lib/enlightenment/utils/enlightenment_sys")
  912. (file-append enlightenment
  913. "/lib/enlightenment/utils/enlightenment_system")
  914. (file-append enlightenment
  915. "/lib/enlightenment/utils/enlightenment_ckpasswd"))))
  916. (define enlightenment-desktop-service-type
  917. (service-type
  918. (name 'enlightenment-desktop)
  919. (extensions
  920. (list (service-extension dbus-root-service-type
  921. (compose list
  922. (package-direct-input-selector
  923. "efl")
  924. enlightenment-package))
  925. (service-extension setuid-program-service-type
  926. enlightenment-setuid-programs)
  927. (service-extension profile-service-type
  928. (compose list
  929. enlightenment-package))))
  930. (default-value (enlightenment-desktop-configuration))
  931. (description
  932. "Return a service that adds the @code{enlightenment} package to the system
  933. profile, and extends dbus with the ability for @code{efl} to generate
  934. thumbnails and makes setuid the programs which enlightenment needs to function
  935. as expected.")))
  936. ;;;
  937. ;;; inputattach-service-type
  938. ;;;
  939. (define-record-type* <inputattach-configuration>
  940. inputattach-configuration
  941. make-inputattach-configuration
  942. inputattach-configuration?
  943. (device-type inputattach-configuration-device-type
  944. (default "wacom"))
  945. (device inputattach-configuration-device
  946. (default "/dev/ttyS0"))
  947. (baud-rate inputattach-configuration-baud-rate
  948. (default #f))
  949. (log-file inputattach-configuration-log-file
  950. (default #f)))
  951. (define inputattach-shepherd-service
  952. (match-lambda
  953. (($ <inputattach-configuration> type device baud-rate log-file)
  954. (let ((args (append (if baud-rate
  955. (list "--baud" (number->string baud-rate))
  956. '())
  957. (list (string-append "--" type)
  958. device))))
  959. (list (shepherd-service
  960. (provision '(inputattach))
  961. (requirement '(udev))
  962. (documentation "inputattach daemon")
  963. (start #~(make-forkexec-constructor
  964. (cons (string-append #$inputattach
  965. "/bin/inputattach")
  966. (quote #$args))
  967. #:log-file #$log-file))
  968. (stop #~(make-kill-destructor))))))))
  969. (define inputattach-service-type
  970. (service-type
  971. (name 'inputattach)
  972. (extensions
  973. (list (service-extension shepherd-root-service-type
  974. inputattach-shepherd-service)))
  975. (default-value (inputattach-configuration))
  976. (description "Return a service that runs inputattach on a device and
  977. dispatches events from it.")))
  978. ;;;
  979. ;;; gnome-keyring-service-type
  980. ;;;
  981. (define-record-type* <gnome-keyring-configuration> gnome-keyring-configuration
  982. make-gnome-keyring-configuration
  983. gnome-keyring-configuration?
  984. (keyring gnome-keyring-package (default gnome-keyring))
  985. (pam-services gnome-keyring-pam-services (default '(("gdm-password" . login)
  986. ("passwd" . passwd)))))
  987. (define (pam-gnome-keyring config)
  988. (define (%pam-keyring-entry . arguments)
  989. (pam-entry
  990. (control "optional")
  991. (module (file-append (gnome-keyring-package config)
  992. "/lib/security/pam_gnome_keyring.so"))
  993. (arguments arguments)))
  994. (list
  995. (lambda (service)
  996. (case (assoc-ref (gnome-keyring-pam-services config)
  997. (pam-service-name service))
  998. ((login)
  999. (pam-service
  1000. (inherit service)
  1001. (auth (append (pam-service-auth service)
  1002. (list (%pam-keyring-entry))))
  1003. (session (append (pam-service-session service)
  1004. (list (%pam-keyring-entry "auto_start"))))))
  1005. ((passwd)
  1006. (pam-service
  1007. (inherit service)
  1008. (password (append (pam-service-password service)
  1009. (list (%pam-keyring-entry))))))
  1010. (else service)))))
  1011. (define gnome-keyring-service-type
  1012. (service-type
  1013. (name 'gnome-keyring)
  1014. (extensions (list
  1015. (service-extension pam-root-service-type pam-gnome-keyring)))
  1016. (default-value (gnome-keyring-configuration))
  1017. (description "Return a service, that adds the @code{gnome-keyring} package
  1018. to the system profile and extends PAM with entries using
  1019. @code{pam_gnome_keyring.so}, unlocking a user's login keyring when they log in
  1020. or setting its password with passwd.")))
  1021. ;;;
  1022. ;;; polkit-wheel-service -- Allow wheel group to perform admin actions
  1023. ;;;
  1024. (define polkit-wheel
  1025. (file-union
  1026. "polkit-wheel"
  1027. `(("share/polkit-1/rules.d/wheel.rules"
  1028. ,(plain-file
  1029. "wheel.rules"
  1030. "polkit.addAdminRule(function(action, subject) {
  1031. return [\"unix-group:wheel\"];
  1032. });
  1033. ")))))
  1034. (define polkit-wheel-service
  1035. (simple-service 'polkit-wheel polkit-service-type (list polkit-wheel)))
  1036. ;;;
  1037. ;;; The default set of desktop services.
  1038. ;;;
  1039. (define %desktop-services
  1040. ;; List of services typically useful for a "desktop" use case.
  1041. (cons* (service gdm-service-type)
  1042. ;; Screen lockers are a pretty useful thing and these are small.
  1043. (screen-locker-service slock)
  1044. (screen-locker-service xlockmore "xlock")
  1045. ;; Add udev rules for MTP devices so that non-root users can access
  1046. ;; them.
  1047. (simple-service 'mtp udev-service-type (list libmtp))
  1048. ;; Add udev rules for scanners.
  1049. (service sane-service-type)
  1050. ;; Add polkit rules, so that non-root users in the wheel group can
  1051. ;; perform administrative tasks (similar to "sudo").
  1052. polkit-wheel-service
  1053. ;; Allow desktop users to also mount NTFS and NFS file systems
  1054. ;; without root.
  1055. (simple-service 'mount-setuid-helpers setuid-program-service-type
  1056. (list (file-append nfs-utils "/sbin/mount.nfs")
  1057. (file-append ntfs-3g "/sbin/mount.ntfs-3g")))
  1058. ;; The global fontconfig cache directory can sometimes contain
  1059. ;; stale entries, possibly referencing fonts that have been GC'd,
  1060. ;; so mount it read-only.
  1061. fontconfig-file-system-service
  1062. ;; NetworkManager and its applet.
  1063. (service network-manager-service-type)
  1064. (service wpa-supplicant-service-type) ;needed by NetworkManager
  1065. (simple-service 'network-manager-applet
  1066. profile-service-type
  1067. (list network-manager-applet))
  1068. (service modem-manager-service-type)
  1069. (service usb-modeswitch-service-type)
  1070. ;; The D-Bus clique.
  1071. (service avahi-service-type)
  1072. (udisks-service)
  1073. (service upower-service-type)
  1074. (accountsservice-service)
  1075. (service cups-pk-helper-service-type)
  1076. (service colord-service-type)
  1077. (geoclue-service)
  1078. (service polkit-service-type)
  1079. (elogind-service)
  1080. (dbus-service)
  1081. (service ntp-service-type)
  1082. x11-socket-directory-service
  1083. (service pulseaudio-service-type)
  1084. (service alsa-service-type)
  1085. %base-services))
  1086. ;;; desktop.scm ends here