2014-02-19 14:58:24 -05:00
|
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2017-08-22 11:43:48 -04:00
|
|
|
|
;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
|
2020-05-08 10:15:33 -04:00
|
|
|
|
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
2015-03-08 08:39:26 -04:00
|
|
|
|
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
|
2019-02-13 14:22:14 -05:00
|
|
|
|
;;; Copyright © 2018, 2019 Timothy Sample <samplet@ngyro.com>
|
2019-02-15 13:13:55 -05:00
|
|
|
|
;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
2019-03-26 15:52:50 -04:00
|
|
|
|
;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
|
2020-02-09 16:31:09 -05:00
|
|
|
|
;;; Copyright © 2020 shtwzrd <shtwzrd@protonmail.com>
|
2020-02-16 06:58:33 -05:00
|
|
|
|
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
|
2020-06-14 18:58:47 -04:00
|
|
|
|
;;; Copyright © 2020 Alex Griffin <a@ajgrf.com>
|
2021-07-06 16:03:20 -04:00
|
|
|
|
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
|
2021-03-21 14:34:07 -04:00
|
|
|
|
;;; Copyright © 2021 Oleg Pykhalov <go.wigust@gmail.com>
|
2021-09-13 03:45:06 -04:00
|
|
|
|
;;; Copyright © 2021 Josselin Poiret <josselin.poiret@protonmail.ch>
|
2014-02-19 14:58:24 -05:00
|
|
|
|
;;;
|
|
|
|
|
;;; This file is part of GNU Guix.
|
|
|
|
|
;;;
|
|
|
|
|
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
|
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
|
;;; your option) any later version.
|
|
|
|
|
;;;
|
|
|
|
|
;;; GNU Guix is distributed in the hope that it will be useful, but
|
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
|
;;;
|
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
(define-module (gnu services xorg)
|
2014-11-12 08:28:36 -05:00
|
|
|
|
#:use-module (gnu artwork)
|
2014-02-19 14:58:24 -05:00
|
|
|
|
#:use-module (gnu services)
|
2016-01-27 07:45:01 -05:00
|
|
|
|
#:use-module (gnu services shepherd)
|
2015-11-03 12:08:47 -05:00
|
|
|
|
#:use-module (gnu system pam)
|
2021-07-06 16:03:20 -04:00
|
|
|
|
#:use-module (gnu system setuid)
|
2019-03-19 16:34:02 -04:00
|
|
|
|
#:use-module (gnu system keyboard)
|
2019-04-02 16:50:38 -04:00
|
|
|
|
#:use-module (gnu services base)
|
2017-08-22 12:41:19 -04:00
|
|
|
|
#:use-module (gnu services dbus)
|
2019-12-31 03:56:51 -05:00
|
|
|
|
#:use-module (gnu packages base)
|
gnu: Split (gnu packages base), adding (gnu packages commencement).
* gnu/packages/base.scm (gnu-make-boot0, diffutils-boot0,
findutils-boot0, %boot0-inputs, nix-system->gnu-triplet, boot-triplet,
binutils-boot0, gcc-boot0, perl-boot0, linux-libre-headers-boot0,
texinfo-boot0, %boot1-inputs, glibc-final-with-bootstrap-bash,
cross-gcc-wrapper, static-bash-for-glibc, glibc-final,
gcc-boot0-wrapped, %boot2-inputs, binutils-final, libstdc++,
gcc-final, ld-wrapper-boot3, %boot3-inputs, bash-final, %boot4-inputs,
guile-final, gnu-make-final, ld-wrapper, coreutils-final, grep-final,
%boot5-inputs, %final-inputs, canonical-package, gcc-toolchain,
gcc-toolchain-4.8, gcc-toolchain-4.9): Move to...
* gnu/packages/commencement.scm: ... here. New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
* build-aux/check-final-inputs-self-contained.scm: Adjust accordingly.
* gnu/packages/cross-base.scm: Likewise.
* gnu/packages/make-bootstrap.scm: Likewise.
* guix/build-system/cmake.scm (cmake-build): Likewise.
* guix/build-system/gnu.scm (standard-packages, gnu-build,
gnu-cross-build): Likewise.
* guix/build-system/perl.scm (perl-build): Likewise.
* guix/build-system/python.scm (python-build): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Likewise.
* guix/download.scm (url-fetch): Likewise.
* guix/gexp.scm (default-guile): Likewise.
* guix/git-download.scm (git-fetch): Likewise.
* guix/monads.scm (run-with-store): Likewise.
* guix/packages.scm (default-guile): Likewise.
* guix/scripts/package.scm (guix-package): Likewise.
* guix/scripts/refresh.scm: Likewise.
* guix/svn-download.scm (svn-fetch): Likewise.
* tests/builders.scm (%bootstrap-inputs, %bootstrap-search-paths):
Likewise.
* tests/packages.scm ("GNU Make, bootstrap"): Likewise.
* tests/guix-package.sh: Likewise.
* gnu/services/base.scm: Use 'canonical-package' instead of xxx-final.
* gnu/services/xorg.scm: Likewise.
* gnu/system/vm.scm: Likewise.
* guix/scripts/pull.scm (guix-pull): Likewise.
2014-08-26 18:25:17 -04:00
|
|
|
|
#:use-module (gnu packages guile)
|
2014-02-19 14:58:24 -05:00
|
|
|
|
#:use-module (gnu packages xorg)
|
2019-02-13 14:22:20 -05:00
|
|
|
|
#:use-module (gnu packages fonts)
|
2014-02-19 14:58:24 -05:00
|
|
|
|
#:use-module (gnu packages gl)
|
2019-02-13 14:22:19 -05:00
|
|
|
|
#:use-module (gnu packages glib)
|
2016-08-31 09:07:15 -04:00
|
|
|
|
#:use-module (gnu packages display-managers)
|
2019-04-02 16:50:38 -04:00
|
|
|
|
#:use-module (gnu packages freedesktop)
|
2014-04-06 17:31:58 -04:00
|
|
|
|
#:use-module (gnu packages gnustep)
|
2017-08-22 12:41:19 -04:00
|
|
|
|
#:use-module (gnu packages gnome)
|
2014-02-19 14:58:24 -05:00
|
|
|
|
#:use-module (gnu packages admin)
|
|
|
|
|
#:use-module (gnu packages bash)
|
2017-08-22 12:41:19 -04:00
|
|
|
|
#:use-module (gnu system shadow)
|
2021-11-23 15:25:10 -05:00
|
|
|
|
#:use-module (guix build-system glib-or-gtk)
|
2020-11-13 08:57:04 -05:00
|
|
|
|
#:use-module (guix build-system trivial)
|
2014-04-28 17:07:08 -04:00
|
|
|
|
#:use-module (guix gexp)
|
monads: Move '%store-monad' and related procedures where they belong.
This turns (guix monads) into a generic module for monads, and moves the
store monad and related monadic procedures in their corresponding
module.
* guix/monads.scm (store-return, store-bind, %store-monad, store-lift,
text-file, interned-file, package-file, package->derivation,
package->cross-derivation, origin->derivation, imported-modules,
compiled, modules, built-derivations, run-with-store): Move to...
* guix/store.scm (store-return, store-bind, %store-monad, store-lift,
text-file, interned-file): ... here.
(%guile-for-build): New variable.
(run-with-store): Moved from monads.scm. Remove default value for
#:guile-for-build.
* guix/packages.scm (default-guile): Export.
(set-guile-for-build): New procedure.
(package-file, package->derivation, package->cross-derivation,
origin->derivation): Moved from monads.scm.
* guix/derivations.scm (%guile-for-build): Remove.
(imported-modules): Rename to...
(%imported-modules): ... this.
(compiled-modules): Rename to...
(%compiled-modules): ... this.
(built-derivations, imported-modules, compiled-modules): New
procedures.
* gnu/services/avahi.scm, gnu/services/base.scm, gnu/services/dbus.scm,
gnu/services/dmd.scm, gnu/services/networking.scm,
gnu/services/ssh.scm, gnu/services/xorg.scm, gnu/system/install.scm,
gnu/system/linux-initrd.scm, gnu/system/shadow.scm, guix/download.scm,
guix/gexp.scm, guix/git-download.scm, guix/profiles.scm,
guix/svn-download.scm, tests/monads.scm: Adjust imports accordingly.
* guix/monad-repl.scm (default-guile-derivation): New procedure.
(store-monad-language, run-in-store): Use it.
* build-aux/hydra/gnu-system.scm (qemu-jobs): Add explicit
'set-guile-for-build' call.
* guix/scripts/archive.scm (derivation-from-expression): Likewise.
* guix/scripts/build.scm (options/resolve-packages): Likewise.
* guix/scripts/environment.scm (guix-environment): Likewise.
* guix/scripts/system.scm (guix-system): Likewise.
* doc/guix.texi (The Store Monad): Adjust module names accordingly.
2015-01-14 07:34:52 -05:00
|
|
|
|
#:use-module (guix store)
|
2015-10-29 14:00:14 -04:00
|
|
|
|
#:use-module (guix packages)
|
2014-02-19 14:58:24 -05:00
|
|
|
|
#:use-module (guix derivations)
|
2015-01-26 17:33:24 -05:00
|
|
|
|
#:use-module (guix records)
|
2019-01-10 08:50:09 -05:00
|
|
|
|
#:use-module (guix deprecation)
|
2014-11-06 17:54:27 -05:00
|
|
|
|
#:use-module (srfi srfi-1)
|
2015-10-29 14:00:14 -04:00
|
|
|
|
#:use-module (srfi srfi-9)
|
2014-11-06 17:54:27 -05:00
|
|
|
|
#:use-module (srfi srfi-26)
|
|
|
|
|
#:use-module (ice-9 match)
|
2019-03-18 17:56:13 -04:00
|
|
|
|
#:export (xorg-configuration
|
|
|
|
|
xorg-configuration?
|
|
|
|
|
xorg-configuration-modules
|
|
|
|
|
xorg-configuration-fonts
|
|
|
|
|
xorg-configuration-drivers
|
|
|
|
|
xorg-configuration-resolutions
|
|
|
|
|
xorg-configuration-extra-config
|
|
|
|
|
xorg-configuration-server
|
|
|
|
|
xorg-configuration-server-arguments
|
|
|
|
|
|
2016-02-18 15:34:37 -05:00
|
|
|
|
%default-xorg-modules
|
2017-11-25 12:28:08 -05:00
|
|
|
|
%default-xorg-fonts
|
2021-03-21 07:23:23 -04:00
|
|
|
|
%default-xorg-server-arguments
|
|
|
|
|
|
2017-08-22 11:43:48 -04:00
|
|
|
|
xorg-wrapper
|
2015-05-21 12:02:01 -04:00
|
|
|
|
xorg-start-command
|
2016-08-27 09:45:15 -04:00
|
|
|
|
xinitrc
|
2020-11-13 08:57:04 -05:00
|
|
|
|
xorg-server-service-type
|
2016-08-27 09:45:15 -04:00
|
|
|
|
|
2014-11-12 08:20:38 -05:00
|
|
|
|
%default-slim-theme
|
|
|
|
|
%default-slim-theme-name
|
2017-11-28 05:10:08 -05:00
|
|
|
|
|
2015-11-25 12:47:58 -05:00
|
|
|
|
slim-configuration
|
2017-11-28 05:10:08 -05:00
|
|
|
|
slim-configuration?
|
|
|
|
|
slim-configuration-slim
|
|
|
|
|
slim-configuration-allow-empty-passwords?
|
|
|
|
|
slim-configuration-auto-login?
|
|
|
|
|
slim-configuration-default-user
|
|
|
|
|
slim-configuration-theme
|
|
|
|
|
slim-configuration-theme-name
|
|
|
|
|
slim-configuration-xauth
|
|
|
|
|
slim-configuration-shepherd
|
|
|
|
|
slim-configuration-auto-login-session
|
2019-03-26 15:52:50 -04:00
|
|
|
|
slim-configuration-xorg
|
2019-04-28 09:52:50 -04:00
|
|
|
|
slim-configuration-display
|
|
|
|
|
slim-configuration-vt
|
2019-03-26 15:52:50 -04:00
|
|
|
|
slim-configuration-sessreg
|
2017-11-28 05:10:08 -05:00
|
|
|
|
|
2015-11-25 12:47:58 -05:00
|
|
|
|
slim-service-type
|
2015-10-29 14:00:14 -04:00
|
|
|
|
|
2016-07-19 09:19:14 -04:00
|
|
|
|
screen-locker
|
|
|
|
|
screen-locker?
|
2015-10-29 14:00:14 -04:00
|
|
|
|
screen-locker-service-type
|
2017-08-22 12:41:19 -04:00
|
|
|
|
screen-locker-service
|
|
|
|
|
|
2019-04-02 16:50:38 -04:00
|
|
|
|
localed-configuration
|
|
|
|
|
localed-configuration?
|
|
|
|
|
localed-service-type
|
|
|
|
|
|
2017-08-22 12:41:19 -04:00
|
|
|
|
gdm-configuration
|
|
|
|
|
gdm-service-type
|
2020-02-16 06:58:33 -05:00
|
|
|
|
|
|
|
|
|
handle-xorg-configuration
|
2019-04-03 07:55:06 -04:00
|
|
|
|
set-xorg-configuration))
|
2014-02-19 14:58:24 -05:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
;;;
|
|
|
|
|
;;; Services that relate to the X Window System.
|
|
|
|
|
;;;
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2017-11-25 12:28:08 -05:00
|
|
|
|
(define %default-xorg-modules
|
2019-01-28 05:19:19 -05:00
|
|
|
|
;; Default list of modules loaded by the server. When multiple drivers
|
|
|
|
|
;; match, the first one in the list is loaded.
|
2017-11-25 12:28:08 -05:00
|
|
|
|
(list xf86-video-vesa
|
|
|
|
|
xf86-video-fbdev
|
2019-01-28 05:19:19 -05:00
|
|
|
|
xf86-video-amdgpu
|
2017-11-25 12:28:08 -05:00
|
|
|
|
xf86-video-ati
|
|
|
|
|
xf86-video-cirrus
|
|
|
|
|
xf86-video-intel
|
|
|
|
|
xf86-video-mach64
|
|
|
|
|
xf86-video-nouveau
|
|
|
|
|
xf86-video-nv
|
|
|
|
|
xf86-video-sis
|
|
|
|
|
|
|
|
|
|
;; Libinput is the new thing and is recommended over evdev/synaptics:
|
|
|
|
|
;; <http://who-t.blogspot.fr/2015/01/xf86-input-libinput-compatibility-with.html>.
|
|
|
|
|
xf86-input-libinput
|
|
|
|
|
|
|
|
|
|
xf86-input-evdev
|
|
|
|
|
xf86-input-keyboard
|
|
|
|
|
xf86-input-mouse
|
|
|
|
|
xf86-input-synaptics))
|
|
|
|
|
|
|
|
|
|
(define %default-xorg-fonts
|
|
|
|
|
;; Default list of fonts available to the X server.
|
|
|
|
|
(list (file-append font-alias "/share/fonts/X11/75dpi")
|
|
|
|
|
(file-append font-alias "/share/fonts/X11/100dpi")
|
|
|
|
|
(file-append font-alias "/share/fonts/X11/misc")
|
|
|
|
|
(file-append font-alias "/share/fonts/X11/cyrillic")
|
2017-12-01 09:25:15 -05:00
|
|
|
|
(file-append font-misc-misc ;default fonts for xterm
|
|
|
|
|
"/share/fonts/X11/misc")
|
2017-11-25 12:28:08 -05:00
|
|
|
|
(file-append font-adobe75dpi "/share/fonts/X11/75dpi")))
|
|
|
|
|
|
2019-03-18 17:56:13 -04:00
|
|
|
|
(define %default-xorg-server-arguments
|
|
|
|
|
;; Default command-line arguments for X.
|
|
|
|
|
'("-nolisten" "tcp"))
|
|
|
|
|
|
|
|
|
|
;; Configuration of an Xorg server.
|
|
|
|
|
(define-record-type* <xorg-configuration>
|
|
|
|
|
xorg-configuration make-xorg-configuration
|
|
|
|
|
xorg-configuration?
|
2021-11-18 16:44:26 -05:00
|
|
|
|
(modules xorg-configuration-modules ;list of file-like
|
2021-08-30 04:56:11 -04:00
|
|
|
|
(thunked)
|
2020-02-09 16:31:09 -05:00
|
|
|
|
; filter out modules not supported on current system
|
|
|
|
|
(default (filter
|
|
|
|
|
(lambda (p)
|
|
|
|
|
(member (%current-system)
|
|
|
|
|
(package-supported-systems p)))
|
|
|
|
|
%default-xorg-modules)))
|
2019-03-18 17:56:13 -04:00
|
|
|
|
(fonts xorg-configuration-fonts ;list of packges
|
|
|
|
|
(default %default-xorg-fonts))
|
|
|
|
|
(drivers xorg-configuration-drivers ;list of strings
|
|
|
|
|
(default '()))
|
|
|
|
|
(resolutions xorg-configuration-resolutions ;list of tuples
|
|
|
|
|
(default '()))
|
2019-03-19 16:34:02 -04:00
|
|
|
|
(keyboard-layout xorg-configuration-keyboard-layout ;#f | <keyboard-layout>
|
|
|
|
|
(default #f))
|
2019-03-18 17:56:13 -04:00
|
|
|
|
(extra-config xorg-configuration-extra-config ;list of strings
|
|
|
|
|
(default '()))
|
2021-11-18 16:44:26 -05:00
|
|
|
|
(server xorg-configuration-server ;file-like
|
2019-03-18 17:56:13 -04:00
|
|
|
|
(default xorg-server))
|
|
|
|
|
(server-arguments xorg-configuration-server-arguments ;list of strings
|
|
|
|
|
(default %default-xorg-server-arguments)))
|
|
|
|
|
|
|
|
|
|
(define (xorg-configuration->file config)
|
|
|
|
|
"Compute an Xorg configuration file corresponding to CONFIG, an
|
|
|
|
|
<xorg-configuration> record."
|
2020-06-02 07:28:46 -04:00
|
|
|
|
(let ((xorg-server (xorg-configuration-server config)))
|
|
|
|
|
(define all-modules
|
|
|
|
|
;; 'xorg-server' provides 'fbdevhw.so' etc.
|
|
|
|
|
(append (xorg-configuration-modules config)
|
|
|
|
|
(list xorg-server)))
|
2017-11-25 12:28:08 -05:00
|
|
|
|
|
2020-06-02 07:28:46 -04:00
|
|
|
|
(define build
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (ice-9 match)
|
|
|
|
|
(srfi srfi-1)
|
|
|
|
|
(srfi srfi-26))
|
2017-11-25 12:28:08 -05:00
|
|
|
|
|
2020-06-02 07:28:46 -04:00
|
|
|
|
(call-with-output-file #$output
|
|
|
|
|
(lambda (port)
|
|
|
|
|
(define drivers
|
|
|
|
|
'#$(xorg-configuration-drivers config))
|
2017-11-25 12:28:08 -05:00
|
|
|
|
|
2020-06-02 07:28:46 -04:00
|
|
|
|
(define (device-section driver)
|
|
|
|
|
(string-append "
|
2014-11-06 17:20:53 -05:00
|
|
|
|
Section \"Device\"
|
|
|
|
|
Identifier \"device-" driver "\"
|
|
|
|
|
Driver \"" driver "\"
|
|
|
|
|
EndSection"))
|
2014-02-19 14:58:24 -05:00
|
|
|
|
|
2020-06-02 07:28:46 -04:00
|
|
|
|
(define (screen-section driver resolutions)
|
|
|
|
|
(string-append "
|
2014-11-06 17:54:27 -05:00
|
|
|
|
Section \"Screen\"
|
|
|
|
|
Identifier \"screen-" driver "\"
|
|
|
|
|
Device \"device-" driver "\"
|
|
|
|
|
SubSection \"Display\"
|
|
|
|
|
Modes "
|
|
|
|
|
(string-join (map (match-lambda
|
2015-05-21 12:02:01 -04:00
|
|
|
|
((x y)
|
|
|
|
|
(string-append "\"" (number->string x)
|
|
|
|
|
"x" (number->string y) "\"")))
|
2014-11-06 17:54:27 -05:00
|
|
|
|
resolutions)) "
|
|
|
|
|
EndSubSection
|
|
|
|
|
EndSection"))
|
|
|
|
|
|
2020-06-02 07:28:46 -04:00
|
|
|
|
(define (input-class-section layout variant model options)
|
|
|
|
|
(string-append "
|
2019-03-19 16:34:02 -04:00
|
|
|
|
Section \"InputClass\"
|
|
|
|
|
Identifier \"evdev keyboard catchall\"
|
|
|
|
|
MatchIsKeyboard \"on\"
|
|
|
|
|
Option \"XkbLayout\" " (object->string layout)
|
|
|
|
|
(if variant
|
|
|
|
|
(string-append " Option \"XkbVariant\" \""
|
|
|
|
|
variant "\"")
|
|
|
|
|
"")
|
|
|
|
|
(if model
|
|
|
|
|
(string-append " Option \"XkbModel\" \""
|
|
|
|
|
model "\"")
|
|
|
|
|
"")
|
|
|
|
|
(match options
|
|
|
|
|
(()
|
|
|
|
|
"")
|
|
|
|
|
(_
|
|
|
|
|
(string-append " Option \"XkbOptions\" \""
|
|
|
|
|
(string-join options ",") "\""))) "
|
|
|
|
|
|
|
|
|
|
MatchDevicePath \"/dev/input/event*\"
|
|
|
|
|
Driver \"evdev\"
|
|
|
|
|
EndSection\n"))
|
|
|
|
|
|
2020-06-02 07:28:46 -04:00
|
|
|
|
(define (expand modules)
|
|
|
|
|
;; Append to MODULES the relevant /lib/xorg/modules
|
|
|
|
|
;; sub-directories.
|
|
|
|
|
(append-map (lambda (module)
|
|
|
|
|
(filter-map (lambda (directory)
|
|
|
|
|
(let ((full (string-append module
|
|
|
|
|
directory)))
|
|
|
|
|
(and (file-exists? full)
|
|
|
|
|
full)))
|
|
|
|
|
'("/lib/xorg/modules/drivers"
|
|
|
|
|
"/lib/xorg/modules/input"
|
|
|
|
|
"/lib/xorg/modules/multimedia"
|
|
|
|
|
"/lib/xorg/modules/extensions")))
|
|
|
|
|
modules))
|
2014-02-19 14:58:24 -05:00
|
|
|
|
|
2020-06-02 07:28:46 -04:00
|
|
|
|
(display "Section \"Files\"\n" port)
|
|
|
|
|
(for-each (lambda (font)
|
|
|
|
|
(format port " FontPath \"~a\"~%" font))
|
|
|
|
|
'#$(xorg-configuration-fonts config))
|
|
|
|
|
(for-each (lambda (module)
|
|
|
|
|
(format port
|
|
|
|
|
" ModulePath \"~a\"~%"
|
|
|
|
|
module))
|
|
|
|
|
(append (expand '#$all-modules)
|
2017-11-25 12:28:08 -05:00
|
|
|
|
|
2020-06-02 07:28:46 -04:00
|
|
|
|
;; For fbdevhw.so and so on.
|
|
|
|
|
(list #$(file-append xorg-server
|
|
|
|
|
"/lib/xorg/modules"))))
|
|
|
|
|
(display "EndSection\n" port)
|
|
|
|
|
(display "
|
2014-02-19 14:58:24 -05:00
|
|
|
|
Section \"ServerFlags\"
|
2014-11-06 17:54:39 -05:00
|
|
|
|
Option \"AllowMouseOpenFail\" \"on\"
|
2017-11-25 12:28:08 -05:00
|
|
|
|
EndSection\n" port)
|
2015-05-21 12:12:28 -04:00
|
|
|
|
|
2020-06-02 07:28:46 -04:00
|
|
|
|
(display (string-join (map device-section drivers) "\n")
|
|
|
|
|
port)
|
|
|
|
|
(newline port)
|
|
|
|
|
(display (string-join
|
|
|
|
|
(map (cut screen-section <>
|
|
|
|
|
'#$(xorg-configuration-resolutions config))
|
|
|
|
|
drivers)
|
|
|
|
|
"\n")
|
|
|
|
|
port)
|
|
|
|
|
(newline port)
|
2017-11-25 12:28:08 -05:00
|
|
|
|
|
2020-06-02 07:28:46 -04:00
|
|
|
|
(let ((layout #$(and=> (xorg-configuration-keyboard-layout config)
|
|
|
|
|
keyboard-layout-name))
|
|
|
|
|
(variant #$(and=> (xorg-configuration-keyboard-layout config)
|
|
|
|
|
keyboard-layout-variant))
|
|
|
|
|
(model #$(and=> (xorg-configuration-keyboard-layout config)
|
|
|
|
|
keyboard-layout-model))
|
|
|
|
|
(options '#$(and=> (xorg-configuration-keyboard-layout config)
|
|
|
|
|
keyboard-layout-options)))
|
|
|
|
|
(when layout
|
|
|
|
|
(display (input-class-section layout variant model options)
|
|
|
|
|
port)
|
|
|
|
|
(newline port)))
|
2019-03-19 16:34:02 -04:00
|
|
|
|
|
2020-06-02 07:28:46 -04:00
|
|
|
|
(for-each (lambda (config)
|
|
|
|
|
(display config port))
|
|
|
|
|
'#$(xorg-configuration-extra-config config))))))
|
2017-11-25 12:28:08 -05:00
|
|
|
|
|
2020-06-02 07:28:46 -04:00
|
|
|
|
(computed-file "xserver.conf" build)))
|
2014-02-19 14:58:24 -05:00
|
|
|
|
|
2016-02-18 15:34:37 -05:00
|
|
|
|
(define (xorg-configuration-directory modules)
|
|
|
|
|
"Return a directory that contains the @code{.conf} files for X.org that
|
|
|
|
|
includes the @code{share/X11/xorg.conf.d} directories of each package listed
|
|
|
|
|
in @var{modules}."
|
2016-07-03 17:11:40 -04:00
|
|
|
|
(with-imported-modules '((guix build utils))
|
|
|
|
|
(computed-file "xorg.conf.d"
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build utils)
|
|
|
|
|
(srfi srfi-1))
|
|
|
|
|
|
|
|
|
|
(define files
|
|
|
|
|
(append-map (lambda (module)
|
|
|
|
|
(find-files (string-append
|
|
|
|
|
module
|
|
|
|
|
"/share/X11/xorg.conf.d")
|
|
|
|
|
"\\.conf$"))
|
|
|
|
|
(list #$@modules)))
|
|
|
|
|
|
|
|
|
|
(mkdir #$output)
|
|
|
|
|
(for-each (lambda (file)
|
|
|
|
|
(symlink file
|
|
|
|
|
(string-append #$output "/"
|
|
|
|
|
(basename file))))
|
|
|
|
|
files)
|
|
|
|
|
#t))))
|
2016-02-18 15:34:37 -05:00
|
|
|
|
|
2019-03-18 17:56:13 -04:00
|
|
|
|
(define* (xorg-wrapper #:optional (config (xorg-configuration)))
|
|
|
|
|
"Return a derivation that builds a script to start the X server with the
|
|
|
|
|
given @var{config}. The resulting script should be used in place of
|
|
|
|
|
@code{/usr/bin/X}."
|
system: Make service procedures non-monadic.
* gnu/services/avahi.scm (configuration-file): Use 'plain-file' instead
of 'text-file'.
(avahi-service): Turn into a regular procedure that returns a <service>.
* gnu/services/base.scm (root-file-system-service, file-system-service,
user-unmount-service, user-processes-service, host-name-service,
console-keymap-service, console-font-service, mingetty-service,
nscd.conf-file, nscd-service): Likewise.
(%default-syslog.conf): New variable.
(syslog-service): Use it. Turn into a regular procedure.
(guix-service, udev-rules-union, kvm-udev-rule, udev-service,
device-mapping-service, swap-service): Likewise.
* gnu/services/databases.scm (%default-postgres-hba,
%default-postgres-ident): Use 'plain-file' instead of 'text-file'.
(%default-postgres-config): Use 'mixed-text-file' instead of
'text-file*'.
(postgresql-service): Use 'program-file' instead of 'gexp->script'.
Turn into a regular procedure.
* gnu/services/desktop.scm (dbus-configuration-directory): Use
'computed-file' instead of 'gexp->derivation'.
(upower-configuration-file, geoclue-configuration-file,
elogind-configuration-file): Use 'plain-file' instead of 'text-file'.
(dbus-service, upower-service, colord-service, geoclue-service,
polkit-service, elogind-service): Turn into regular procedures.
(%desktop-services): Remove use of 'mlet' when iterating on
%BASE-SERVICES.
* gnu/services/lirc.scm (lirc-service): Turn into a regular procedure.
* gnu/services/networking.scm (static-networking-service,
dhcp-client-service, ntp-service, tor-service, bitlbee-service,
wicd-service): Likewise.
* gnu/services/ssh.scm (lsh-service): Likewise.
* gnu/services/web.scm (nginx-service): Likewise.
* gnu/services/xorg.scm (xorg-configuration-file): Use 'mixed-text-file'
instead of 'text-file*'.
(xorg-start-command, slim-service): Turn into regular procedures.
(xinitrc): Use 'program-file' instead of 'gexp->script'.
* gnu/system/install.scm (cow-store-service,
configuration-template-service): Turn into regular procedures.
* gnu/system.scm (other-file-system-services, device-mapping-services,
swap-services, essential-services, operating-system-services,
user-shells, operating-system-accounts): Remove now unnecessary
'mlet' and turn into regular procedures.
(operating-system-etc-directory, operating-system-activation-script,
operating-system-boot-script): Adjust accordingly.
* doc/guix.texi (Base Services, Networking Services, X Window, Desktop
Services, Database Services, Web Services, Various Services, Name
Service Switch): Adjust accordingly.
2015-09-09 03:17:31 -04:00
|
|
|
|
(define exp
|
|
|
|
|
;; Write a small wrapper around the X server.
|
|
|
|
|
#~(begin
|
|
|
|
|
(setenv "XORG_DRI_DRIVER_PATH" (string-append #$mesa "/lib/dri"))
|
|
|
|
|
(setenv "XKB_BINDIR" (string-append #$xkbcomp "/bin"))
|
|
|
|
|
|
2019-03-18 17:56:13 -04:00
|
|
|
|
(let ((X (string-append #$(xorg-configuration-server config) "/bin/X")))
|
2017-08-22 11:43:48 -04:00
|
|
|
|
(apply execl X X
|
|
|
|
|
"-xkbdir" (string-append #$xkeyboard-config "/share/X11/xkb")
|
2019-03-18 17:56:13 -04:00
|
|
|
|
"-config" #$(xorg-configuration->file config)
|
|
|
|
|
"-configdir" #$(xorg-configuration-directory
|
|
|
|
|
(xorg-configuration-modules config))
|
2017-08-22 11:43:48 -04:00
|
|
|
|
(cdr (command-line))))))
|
|
|
|
|
|
|
|
|
|
(program-file "X-wrapper" exp))
|
system: Make service procedures non-monadic.
* gnu/services/avahi.scm (configuration-file): Use 'plain-file' instead
of 'text-file'.
(avahi-service): Turn into a regular procedure that returns a <service>.
* gnu/services/base.scm (root-file-system-service, file-system-service,
user-unmount-service, user-processes-service, host-name-service,
console-keymap-service, console-font-service, mingetty-service,
nscd.conf-file, nscd-service): Likewise.
(%default-syslog.conf): New variable.
(syslog-service): Use it. Turn into a regular procedure.
(guix-service, udev-rules-union, kvm-udev-rule, udev-service,
device-mapping-service, swap-service): Likewise.
* gnu/services/databases.scm (%default-postgres-hba,
%default-postgres-ident): Use 'plain-file' instead of 'text-file'.
(%default-postgres-config): Use 'mixed-text-file' instead of
'text-file*'.
(postgresql-service): Use 'program-file' instead of 'gexp->script'.
Turn into a regular procedure.
* gnu/services/desktop.scm (dbus-configuration-directory): Use
'computed-file' instead of 'gexp->derivation'.
(upower-configuration-file, geoclue-configuration-file,
elogind-configuration-file): Use 'plain-file' instead of 'text-file'.
(dbus-service, upower-service, colord-service, geoclue-service,
polkit-service, elogind-service): Turn into regular procedures.
(%desktop-services): Remove use of 'mlet' when iterating on
%BASE-SERVICES.
* gnu/services/lirc.scm (lirc-service): Turn into a regular procedure.
* gnu/services/networking.scm (static-networking-service,
dhcp-client-service, ntp-service, tor-service, bitlbee-service,
wicd-service): Likewise.
* gnu/services/ssh.scm (lsh-service): Likewise.
* gnu/services/web.scm (nginx-service): Likewise.
* gnu/services/xorg.scm (xorg-configuration-file): Use 'mixed-text-file'
instead of 'text-file*'.
(xorg-start-command, slim-service): Turn into regular procedures.
(xinitrc): Use 'program-file' instead of 'gexp->script'.
* gnu/system/install.scm (cow-store-service,
configuration-template-service): Turn into regular procedures.
* gnu/system.scm (other-file-system-services, device-mapping-services,
swap-services, essential-services, operating-system-services,
user-shells, operating-system-accounts): Remove now unnecessary
'mlet' and turn into regular procedures.
(operating-system-etc-directory, operating-system-activation-script,
operating-system-boot-script): Adjust accordingly.
* doc/guix.texi (Base Services, Networking Services, X Window, Desktop
Services, Database Services, Web Services, Various Services, Name
Service Switch): Adjust accordingly.
2015-09-09 03:17:31 -04:00
|
|
|
|
|
2019-03-18 17:56:13 -04:00
|
|
|
|
(define* (xorg-start-command #:optional (config (xorg-configuration)))
|
|
|
|
|
"Return a @code{startx} script in which the modules, fonts, etc. specified
|
|
|
|
|
in @var{config}, are available. The result should be used in place of
|
|
|
|
|
@code{startx}."
|
2017-08-22 11:43:48 -04:00
|
|
|
|
(define X
|
2019-03-18 17:56:13 -04:00
|
|
|
|
(xorg-wrapper config))
|
|
|
|
|
|
2017-08-22 11:43:48 -04:00
|
|
|
|
(define exp
|
|
|
|
|
;; Write a small wrapper around the X server.
|
|
|
|
|
#~(apply execl #$X #$X ;; Second #$X is for argv[0].
|
2019-03-18 17:56:13 -04:00
|
|
|
|
"-logverbose" "-verbose" "-terminate"
|
|
|
|
|
#$@(xorg-configuration-server-arguments config)
|
2019-02-15 13:13:55 -05:00
|
|
|
|
(cdr (command-line))))
|
system: Make service procedures non-monadic.
* gnu/services/avahi.scm (configuration-file): Use 'plain-file' instead
of 'text-file'.
(avahi-service): Turn into a regular procedure that returns a <service>.
* gnu/services/base.scm (root-file-system-service, file-system-service,
user-unmount-service, user-processes-service, host-name-service,
console-keymap-service, console-font-service, mingetty-service,
nscd.conf-file, nscd-service): Likewise.
(%default-syslog.conf): New variable.
(syslog-service): Use it. Turn into a regular procedure.
(guix-service, udev-rules-union, kvm-udev-rule, udev-service,
device-mapping-service, swap-service): Likewise.
* gnu/services/databases.scm (%default-postgres-hba,
%default-postgres-ident): Use 'plain-file' instead of 'text-file'.
(%default-postgres-config): Use 'mixed-text-file' instead of
'text-file*'.
(postgresql-service): Use 'program-file' instead of 'gexp->script'.
Turn into a regular procedure.
* gnu/services/desktop.scm (dbus-configuration-directory): Use
'computed-file' instead of 'gexp->derivation'.
(upower-configuration-file, geoclue-configuration-file,
elogind-configuration-file): Use 'plain-file' instead of 'text-file'.
(dbus-service, upower-service, colord-service, geoclue-service,
polkit-service, elogind-service): Turn into regular procedures.
(%desktop-services): Remove use of 'mlet' when iterating on
%BASE-SERVICES.
* gnu/services/lirc.scm (lirc-service): Turn into a regular procedure.
* gnu/services/networking.scm (static-networking-service,
dhcp-client-service, ntp-service, tor-service, bitlbee-service,
wicd-service): Likewise.
* gnu/services/ssh.scm (lsh-service): Likewise.
* gnu/services/web.scm (nginx-service): Likewise.
* gnu/services/xorg.scm (xorg-configuration-file): Use 'mixed-text-file'
instead of 'text-file*'.
(xorg-start-command, slim-service): Turn into regular procedures.
(xinitrc): Use 'program-file' instead of 'gexp->script'.
* gnu/system/install.scm (cow-store-service,
configuration-template-service): Turn into regular procedures.
* gnu/system.scm (other-file-system-services, device-mapping-services,
swap-services, essential-services, operating-system-services,
user-shells, operating-system-accounts): Remove now unnecessary
'mlet' and turn into regular procedures.
(operating-system-etc-directory, operating-system-activation-script,
operating-system-boot-script): Adjust accordingly.
* doc/guix.texi (Base Services, Networking Services, X Window, Desktop
Services, Database Services, Web Services, Various Services, Name
Service Switch): Adjust accordingly.
2015-09-09 03:17:31 -04:00
|
|
|
|
|
2017-08-22 11:43:48 -04:00
|
|
|
|
(program-file "startx" exp))
|
2014-02-19 14:58:24 -05:00
|
|
|
|
|
2019-03-18 16:52:18 -04:00
|
|
|
|
(define* (xinitrc #:key fallback-session)
|
2014-12-15 11:21:46 -05:00
|
|
|
|
"Return a system-wide xinitrc script that starts the specified X session,
|
|
|
|
|
which should be passed to this script as the first argument. If not, the
|
2017-11-25 17:19:31 -05:00
|
|
|
|
@var{fallback-session} will be used or, if @var{fallback-session} is false, a
|
|
|
|
|
desktop session from the system or user profile will be used."
|
2014-04-27 13:28:47 -04:00
|
|
|
|
(define builder
|
|
|
|
|
#~(begin
|
2017-11-25 17:19:31 -05:00
|
|
|
|
(use-modules (ice-9 match)
|
|
|
|
|
(ice-9 regex)
|
|
|
|
|
(ice-9 ftw)
|
2018-02-16 20:15:27 -05:00
|
|
|
|
(ice-9 rdelim)
|
2017-11-25 17:19:31 -05:00
|
|
|
|
(srfi srfi-1)
|
|
|
|
|
(srfi srfi-26))
|
2014-04-27 13:28:47 -04:00
|
|
|
|
|
2015-03-02 14:34:37 -05:00
|
|
|
|
(define (close-all-fdes)
|
|
|
|
|
;; Close all the open file descriptors except 0 to 2.
|
|
|
|
|
(let loop ((fd 3))
|
|
|
|
|
(when (< fd 4096) ;FIXME: use sysconf + _SC_OPEN_MAX
|
|
|
|
|
(false-if-exception (close-fdes fd))
|
|
|
|
|
(loop (+ 1 fd)))))
|
|
|
|
|
|
2014-12-13 10:17:23 -05:00
|
|
|
|
(define (exec-from-login-shell command . args)
|
|
|
|
|
;; Run COMMAND from a login shell so that it gets to see the same
|
|
|
|
|
;; environment variables that one gets when logging in on a tty, for
|
|
|
|
|
;; instance.
|
|
|
|
|
(let* ((pw (getpw (getuid)))
|
2015-03-08 08:57:53 -04:00
|
|
|
|
(shell (passwd:shell pw)))
|
|
|
|
|
;; Close any open file descriptors. This is all the more
|
|
|
|
|
;; important that SLiM itself exec's us directly without closing
|
|
|
|
|
;; its own file descriptors!
|
|
|
|
|
(close-all-fdes)
|
|
|
|
|
|
|
|
|
|
;; The '--login' option is supported at least by Bash and zsh.
|
|
|
|
|
(execl shell shell "--login" "-c"
|
|
|
|
|
(string-join (cons command args)))))
|
|
|
|
|
|
2017-11-25 17:19:31 -05:00
|
|
|
|
(define system-profile
|
|
|
|
|
"/run/current-system/profile")
|
|
|
|
|
|
|
|
|
|
(define user-profile
|
|
|
|
|
(and=> (getpw (getuid))
|
|
|
|
|
(lambda (pw)
|
|
|
|
|
(string-append (passwd:dir pw) "/.guix-profile"))))
|
|
|
|
|
|
|
|
|
|
(define (xsession-command desktop-file)
|
|
|
|
|
;; Read from DESKTOP-FILE its X session command and return it as a
|
|
|
|
|
;; list.
|
|
|
|
|
(define exec-regexp
|
|
|
|
|
(make-regexp "^[[:blank:]]*Exec=(.*)$"))
|
|
|
|
|
|
|
|
|
|
(call-with-input-file desktop-file
|
|
|
|
|
(lambda (port)
|
|
|
|
|
(let loop ()
|
|
|
|
|
(match (read-line port)
|
|
|
|
|
((? eof-object?) #f)
|
|
|
|
|
((= (cut regexp-exec exec-regexp <>) result)
|
|
|
|
|
(if result
|
|
|
|
|
(string-tokenize (match:substring result 1))
|
|
|
|
|
(loop))))))))
|
|
|
|
|
|
|
|
|
|
(define (find-session profile)
|
|
|
|
|
;; Return an X session command from PROFILE or #f if none was found.
|
|
|
|
|
(let ((directory (string-append profile "/share/xsessions")))
|
|
|
|
|
(match (scandir directory
|
|
|
|
|
(cut string-suffix? ".desktop" <>))
|
|
|
|
|
((or () #f)
|
|
|
|
|
#f)
|
|
|
|
|
((sessions ...)
|
|
|
|
|
(any xsession-command
|
|
|
|
|
(map (cut string-append directory "/" <>)
|
|
|
|
|
sessions))))))
|
|
|
|
|
|
2015-03-08 08:57:53 -04:00
|
|
|
|
(let* ((home (getenv "HOME"))
|
|
|
|
|
(xsession-file (string-append home "/.xsession"))
|
|
|
|
|
(session (match (command-line)
|
2017-11-25 17:19:31 -05:00
|
|
|
|
((_)
|
|
|
|
|
#$(if fallback-session
|
|
|
|
|
#~(list #$fallback-session)
|
|
|
|
|
#f))
|
|
|
|
|
((_ x ..1)
|
|
|
|
|
x))))
|
2015-03-08 08:57:53 -04:00
|
|
|
|
(if (file-exists? xsession-file)
|
|
|
|
|
;; Run ~/.xsession when it exists.
|
2017-12-04 03:59:11 -05:00
|
|
|
|
(apply exec-from-login-shell xsession-file
|
|
|
|
|
(or session '()))
|
2017-11-25 17:19:31 -05:00
|
|
|
|
;; Otherwise, start the specified session or a fallback.
|
|
|
|
|
(apply exec-from-login-shell
|
|
|
|
|
(or session
|
|
|
|
|
(find-session user-profile)
|
|
|
|
|
(find-session system-profile)))))))
|
2016-03-18 14:37:34 -04:00
|
|
|
|
|
system: Make service procedures non-monadic.
* gnu/services/avahi.scm (configuration-file): Use 'plain-file' instead
of 'text-file'.
(avahi-service): Turn into a regular procedure that returns a <service>.
* gnu/services/base.scm (root-file-system-service, file-system-service,
user-unmount-service, user-processes-service, host-name-service,
console-keymap-service, console-font-service, mingetty-service,
nscd.conf-file, nscd-service): Likewise.
(%default-syslog.conf): New variable.
(syslog-service): Use it. Turn into a regular procedure.
(guix-service, udev-rules-union, kvm-udev-rule, udev-service,
device-mapping-service, swap-service): Likewise.
* gnu/services/databases.scm (%default-postgres-hba,
%default-postgres-ident): Use 'plain-file' instead of 'text-file'.
(%default-postgres-config): Use 'mixed-text-file' instead of
'text-file*'.
(postgresql-service): Use 'program-file' instead of 'gexp->script'.
Turn into a regular procedure.
* gnu/services/desktop.scm (dbus-configuration-directory): Use
'computed-file' instead of 'gexp->derivation'.
(upower-configuration-file, geoclue-configuration-file,
elogind-configuration-file): Use 'plain-file' instead of 'text-file'.
(dbus-service, upower-service, colord-service, geoclue-service,
polkit-service, elogind-service): Turn into regular procedures.
(%desktop-services): Remove use of 'mlet' when iterating on
%BASE-SERVICES.
* gnu/services/lirc.scm (lirc-service): Turn into a regular procedure.
* gnu/services/networking.scm (static-networking-service,
dhcp-client-service, ntp-service, tor-service, bitlbee-service,
wicd-service): Likewise.
* gnu/services/ssh.scm (lsh-service): Likewise.
* gnu/services/web.scm (nginx-service): Likewise.
* gnu/services/xorg.scm (xorg-configuration-file): Use 'mixed-text-file'
instead of 'text-file*'.
(xorg-start-command, slim-service): Turn into regular procedures.
(xinitrc): Use 'program-file' instead of 'gexp->script'.
* gnu/system/install.scm (cow-store-service,
configuration-template-service): Turn into regular procedures.
* gnu/system.scm (other-file-system-services, device-mapping-services,
swap-services, essential-services, operating-system-services,
user-shells, operating-system-accounts): Remove now unnecessary
'mlet' and turn into regular procedures.
(operating-system-etc-directory, operating-system-activation-script,
operating-system-boot-script): Adjust accordingly.
* doc/guix.texi (Base Services, Networking Services, X Window, Desktop
Services, Database Services, Web Services, Various Services, Name
Service Switch): Adjust accordingly.
2015-09-09 03:17:31 -04:00
|
|
|
|
(program-file "xinitrc" builder))
|
2014-04-06 17:31:58 -04:00
|
|
|
|
|
2020-02-16 06:58:33 -05:00
|
|
|
|
(define-syntax handle-xorg-configuration
|
|
|
|
|
(syntax-rules ()
|
|
|
|
|
"Generate the `compose' and `extend' entries of a login manager
|
|
|
|
|
`service-type' to handle specifying the `xorg-configuration' through
|
|
|
|
|
a `service-extension', as used by `set-xorg-configuration'."
|
|
|
|
|
((_ configuration-record service-type-definition)
|
|
|
|
|
(service-type
|
|
|
|
|
(inherit service-type-definition)
|
|
|
|
|
(compose (lambda (extensions)
|
|
|
|
|
(match extensions
|
|
|
|
|
(() #f)
|
|
|
|
|
((config . _) config))))
|
|
|
|
|
(extend (lambda (config xorg-configuration)
|
|
|
|
|
(if xorg-configuration
|
|
|
|
|
(configuration-record
|
|
|
|
|
(inherit config)
|
|
|
|
|
(xorg-configuration xorg-configuration))
|
|
|
|
|
config)))))))
|
|
|
|
|
|
2020-11-13 08:57:04 -05:00
|
|
|
|
(define (xorg-server-profile-service config)
|
|
|
|
|
;; XXX: profile-service-type only accepts <package> objects.
|
|
|
|
|
(list
|
|
|
|
|
(package
|
|
|
|
|
(name "xorg-wrapper")
|
|
|
|
|
(version (package-version xorg-server))
|
|
|
|
|
(source (xorg-wrapper config))
|
|
|
|
|
(build-system trivial-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
'(#:modules ((guix build utils))
|
|
|
|
|
#:builder
|
|
|
|
|
(begin
|
|
|
|
|
(use-modules (guix build utils))
|
|
|
|
|
(let* ((source (assoc-ref %build-inputs "source"))
|
|
|
|
|
(out (assoc-ref %outputs "out"))
|
|
|
|
|
(bin (string-append out "/bin")))
|
|
|
|
|
(mkdir-p bin)
|
|
|
|
|
(symlink source (string-append bin "/X"))
|
|
|
|
|
(symlink source (string-append bin "/Xorg"))
|
|
|
|
|
#t))))
|
|
|
|
|
(home-page (package-home-page xorg-server))
|
|
|
|
|
(synopsis (package-synopsis xorg-server))
|
|
|
|
|
(description (package-description xorg-server))
|
|
|
|
|
(license (package-license xorg-server)))))
|
|
|
|
|
|
|
|
|
|
(define xorg-server-service-type
|
|
|
|
|
(service-type
|
|
|
|
|
(name 'xorg-server)
|
|
|
|
|
(extensions
|
|
|
|
|
(list (service-extension profile-service-type
|
|
|
|
|
xorg-server-profile-service)))
|
|
|
|
|
(default-value (xorg-configuration))
|
|
|
|
|
(description "Add @command{X} to the system profile, to be used with
|
|
|
|
|
@command{sx} or @command{xinit}.")))
|
|
|
|
|
|
2014-11-12 08:20:38 -05:00
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; SLiM log-in manager.
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
(define %default-slim-theme
|
|
|
|
|
;; Theme based on work by Felipe López.
|
system: Use 'file-append' to denote file names.
* gnu/services/avahi.scm, gnu/services/base.scm,
gnu/services/databases.scm, gnu/services/dbus.scm,
gnu/services/desktop.scm, gnu/services/dict.scm,
gnu/services/mail.scm, gnu/services/networking.scm,
gnu/services/sddm.scm, gnu/services/spice.scm,
gnu/services/ssh.scm, gnu/services/web.scm,
gnu/services/xorg.scm, gnu/system.scm: Replace the
#~(string-append #$pkg "/bin/foo") idiom with
(file-append pkg "/bin/foo").
2016-09-10 06:03:47 -04:00
|
|
|
|
(file-append %artwork-repository "/slim"))
|
2014-11-12 08:20:38 -05:00
|
|
|
|
|
|
|
|
|
(define %default-slim-theme-name
|
|
|
|
|
;; This must be the name of the sub-directory in %DEFAULT-SLIM-THEME that
|
|
|
|
|
;; contains the actual theme files.
|
2019-06-08 03:54:20 -04:00
|
|
|
|
"1.x")
|
2014-11-12 08:20:38 -05:00
|
|
|
|
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 17:44:26 -04:00
|
|
|
|
(define-record-type* <slim-configuration>
|
|
|
|
|
slim-configuration make-slim-configuration
|
|
|
|
|
slim-configuration?
|
|
|
|
|
(slim slim-configuration-slim
|
|
|
|
|
(default slim))
|
2017-11-28 05:10:08 -05:00
|
|
|
|
(allow-empty-passwords? slim-configuration-allow-empty-passwords?
|
|
|
|
|
(default #t))
|
2021-03-21 14:34:07 -04:00
|
|
|
|
(gnupg? slim-configuration-gnupg?
|
|
|
|
|
(default #f))
|
2017-11-28 05:10:08 -05:00
|
|
|
|
(auto-login? slim-configuration-auto-login?
|
|
|
|
|
(default #f))
|
|
|
|
|
(default-user slim-configuration-default-user
|
|
|
|
|
(default ""))
|
|
|
|
|
(theme slim-configuration-theme
|
|
|
|
|
(default %default-slim-theme))
|
|
|
|
|
(theme-name slim-configuration-theme-name
|
|
|
|
|
(default %default-slim-theme-name))
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 17:44:26 -04:00
|
|
|
|
(xauth slim-configuration-xauth
|
|
|
|
|
(default xauth))
|
2016-01-27 13:46:44 -05:00
|
|
|
|
(shepherd slim-configuration-shepherd
|
|
|
|
|
(default shepherd))
|
2017-11-28 05:10:08 -05:00
|
|
|
|
(auto-login-session slim-configuration-auto-login-session
|
2017-11-25 17:19:31 -05:00
|
|
|
|
(default #f))
|
2019-03-19 16:26:33 -04:00
|
|
|
|
(xorg-configuration slim-configuration-xorg
|
|
|
|
|
(default (xorg-configuration)))
|
2019-04-28 09:52:50 -04:00
|
|
|
|
(display slim-configuration-display
|
|
|
|
|
(default ":0"))
|
|
|
|
|
(vt slim-configuration-vt
|
|
|
|
|
(default "vt7"))
|
2018-02-17 11:34:12 -05:00
|
|
|
|
(sessreg slim-configuration-sessreg
|
|
|
|
|
(default sessreg)))
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 17:44:26 -04:00
|
|
|
|
|
|
|
|
|
(define (slim-pam-service config)
|
|
|
|
|
"Return a PAM service for @command{slim}."
|
|
|
|
|
(list (unix-pam-service
|
|
|
|
|
"slim"
|
2019-05-09 06:02:20 -04:00
|
|
|
|
#:login-uid? #t
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 17:44:26 -04:00
|
|
|
|
#:allow-empty-passwords?
|
2021-03-21 14:34:07 -04:00
|
|
|
|
(slim-configuration-allow-empty-passwords? config)
|
|
|
|
|
#:gnupg?
|
|
|
|
|
(slim-configuration-gnupg? config))))
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 17:44:26 -04:00
|
|
|
|
|
services: Rename 'dmd' services to 'shepherd'.
* gnu/services/shepherd.scm (dmd-root-service-type, %dmd-root-service)
(dmd-service-type, <dmd-service>, dmd-service, dmd-service?)
(make-dmd-service, dmd-service-documentation, dmd-service-provision)
(dmd-service-requirement, dmd-service-respawn, dmd-service-start)
(dmd-service-stop, dmd-service-auto-start?, dmd-service-modules)
(dmd-service-imported-modules, dmd-service-file-name, dmd-service-file)
(dmd-service-back-edges): Rename to...
(shepherd-root-service-type, %shepherd-root-service, shepherd-service-type)
(<shepherd-service>, shepherd-service, shepherd-service?)
(make-shepherd-service, shepherd-service-documentation)
(shepherd-service-provision, shepherd-service-requirement)
(shepherd-service-respawn, shepherd-service-start)
(shepherd-service-stop, shepherd-service-auto-start?)
(shepherd-service-modules, shepherd-service-imported-modules)
(shepherd-service-file-name, shepherd-service-file)
(shepherd-service-back-edges): ...this
* gnu/services.scm: Adjust comments.
* gnu/services/avahi.scm (avahi-dmd-service): Rename to...
(avahi-shepherd-service): ... this.
* gnu/services/base.scm (%root-file-system-dmd-service)
(file-system->dmd-service-name, mapped-device->dmd-service-name)
(dependency->dmd-service-name, file-system-dmd-service)
(mingetty-dmd-service, nscd-dmd-service, guix-dmd-service)
(guix-publish-dmd-service, udev-dmd-service, gpm-dmd-service): Rename to...
(%root-file-system-shepherd-service)
(file-system->shepherd-service-name, mapped-device->shepherd-service-name)
(dependency->shepherd-service-name, file-system-shepherd-service)
(mingetty-shepherd-service, nscd-shepherd-service, guix-shepherd-service)
(guix-publish-shepherd-service, udev-shepherd-service)
(gpm-shepherd-service): ... this.
* gnu/services/databases.scm (postgresql-dmd-service): Rename to...
(postgresql-shepherd-service): ... this.
* gnu/services/desktop.scm (upower-dmd-service, elogind-dmd-service):
Rename to...
(upower-shepherd-service, elogind-shepherd-service): ... this.
* gnu/services/dbus.scm (dbus-dmd-service): Rename to...
(dbus-shepherd-service): ... this.
* gnu/services/lirc.scm (lirc-dmd-service): Rename to...
(lirc-shepherd-service): ... this.
* gnu/services/mail.scm (dovecot-dmd-service): Rename to...
(dovecot-shepherd-service): ... this.
* gnu/services/networking.scm (ntp-dmd-service, tor-dmd-service)
(bitlbee-dmd-service, wicd-dmd-service, network-manager-dmd-service): Rename to...
(dbus-shepherd-service): ... this.
* gnu/services/ssh.scm (lsh-dmd-service): Rename to...
(lsh-shepherd-service): ... this.
* gnu/services/web.scm (nginx-dmd-service): Rename to...
(nginx-shepherd-service): ... this.
* gnu/services/xorg.scm (slim-dmd-service): Rename to...
(slim-shepherd-service): ... this.
* gnu/system.scm (essential-services): Use '%shepherd-root-service'.
* gnu/system/install.scm (cow-store-service-type): Adjust accordingly.
* guix/scripts/system.scm (dmd-service-node-label, dmd-service-node-type)
(export-dmd-graph): Likewise.
* tests/guix-system.sh: Likewise.
* tests/services.scm ("dmd-service-back-edges"): Rename to...
("shepherd-service-back-edges"): Adjust accordingly.
* doc/guix.texi: Likewise.
* doc/images/service-graph.dot: Use 'shepherd' service name.
2016-01-27 15:02:31 -05:00
|
|
|
|
(define (slim-shepherd-service config)
|
2019-04-28 09:52:50 -04:00
|
|
|
|
(let* ((xinitrc (xinitrc #:fallback-session
|
|
|
|
|
(slim-configuration-auto-login-session config)))
|
|
|
|
|
(xauth (slim-configuration-xauth config))
|
|
|
|
|
(startx (xorg-start-command (slim-configuration-xorg config)))
|
|
|
|
|
(display (slim-configuration-display config))
|
|
|
|
|
(vt (slim-configuration-vt config))
|
|
|
|
|
(shepherd (slim-configuration-shepherd config))
|
|
|
|
|
(theme-name (slim-configuration-theme-name config))
|
|
|
|
|
(sessreg (slim-configuration-sessreg config))
|
|
|
|
|
(lockfile (string-append "/var/run/slim-" vt ".lock")))
|
|
|
|
|
(define slim.cfg
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 17:44:26 -04:00
|
|
|
|
(mixed-text-file "slim.cfg" "
|
|
|
|
|
default_path /run/current-system/profile/bin
|
|
|
|
|
default_xserver " startx "
|
2019-04-28 09:52:50 -04:00
|
|
|
|
display_name " display "
|
|
|
|
|
xserver_arguments " vt "
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 17:44:26 -04:00
|
|
|
|
xauth_path " xauth "/bin/xauth
|
2019-04-28 09:52:50 -04:00
|
|
|
|
authfile /var/run/slim-" vt ".auth
|
|
|
|
|
lockfile " lockfile "
|
|
|
|
|
logfile /var/log/slim-" vt ".log
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 17:44:26 -04:00
|
|
|
|
|
|
|
|
|
# The login command. '%session' is replaced by the chosen session name, one
|
|
|
|
|
# of the names specified in the 'sessions' setting: 'wmaker', 'xfce', etc.
|
|
|
|
|
login_cmd exec " xinitrc " %session
|
|
|
|
|
sessiondir /run/current-system/profile/share/xsessions
|
|
|
|
|
session_msg session (F1 to change):
|
2018-02-17 11:34:12 -05:00
|
|
|
|
sessionstart_cmd " sessreg "/bin/sessreg -a -l $DISPLAY %user
|
|
|
|
|
sessionstop_cmd " sessreg "/bin/sessreg -d -l $DISPLAY %user
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 17:44:26 -04:00
|
|
|
|
|
2016-01-27 13:46:44 -05:00
|
|
|
|
halt_cmd " shepherd "/sbin/halt
|
|
|
|
|
reboot_cmd " shepherd "/sbin/reboot\n"
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 17:44:26 -04:00
|
|
|
|
(if (slim-configuration-auto-login? config)
|
|
|
|
|
(string-append "auto_login yes\ndefault_user "
|
|
|
|
|
(slim-configuration-default-user config) "\n")
|
|
|
|
|
"")
|
|
|
|
|
(if theme-name
|
|
|
|
|
(string-append "current_theme " theme-name "\n")
|
2019-04-28 09:52:50 -04:00
|
|
|
|
"")))
|
|
|
|
|
|
|
|
|
|
(define theme
|
|
|
|
|
(slim-configuration-theme config))
|
|
|
|
|
|
|
|
|
|
(list (shepherd-service
|
|
|
|
|
(documentation "Xorg display server")
|
2019-05-09 03:25:34 -04:00
|
|
|
|
(provision (append
|
|
|
|
|
;; For compatibility, also provide 'xorg-server'.
|
|
|
|
|
(if (string=? vt "vt7")
|
|
|
|
|
'(xorg-server)
|
|
|
|
|
'())
|
|
|
|
|
|
|
|
|
|
(list (symbol-append 'xorg-server-
|
|
|
|
|
(string->symbol vt)))))
|
2019-04-28 09:52:50 -04:00
|
|
|
|
(requirement '(user-processes host-name udev))
|
|
|
|
|
(start
|
|
|
|
|
#~(lambda ()
|
|
|
|
|
;; A stale lock file can prevent SLiM from starting, so remove it to
|
|
|
|
|
;; be on the safe side.
|
|
|
|
|
(false-if-exception (delete-file lockfile))
|
|
|
|
|
|
|
|
|
|
(fork+exec-command
|
|
|
|
|
(list (string-append #$(slim-configuration-slim config)
|
|
|
|
|
"/bin/slim")
|
|
|
|
|
"-nodaemon")
|
|
|
|
|
#:environment-variables
|
|
|
|
|
(list (string-append "SLIM_CFGFILE=" #$slim.cfg)
|
|
|
|
|
#$@(if theme
|
|
|
|
|
(list #~(string-append "SLIM_THEMESDIR=" #$theme))
|
|
|
|
|
#~())))))
|
|
|
|
|
(stop #~(make-kill-destructor))
|
|
|
|
|
(respawn? #t)))))
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 17:44:26 -04:00
|
|
|
|
|
|
|
|
|
(define slim-service-type
|
2020-02-16 06:58:33 -05:00
|
|
|
|
(handle-xorg-configuration slim-configuration
|
|
|
|
|
(service-type (name 'slim)
|
|
|
|
|
(extensions
|
|
|
|
|
(list (service-extension shepherd-root-service-type
|
|
|
|
|
slim-shepherd-service)
|
|
|
|
|
(service-extension pam-root-service-type
|
|
|
|
|
slim-pam-service)
|
2015-11-02 16:04:17 -05:00
|
|
|
|
|
2020-02-16 06:58:33 -05:00
|
|
|
|
;; Unconditionally add xterm to the system profile, to
|
|
|
|
|
;; avoid bad surprises.
|
|
|
|
|
(service-extension profile-service-type
|
|
|
|
|
(const (list xterm)))))
|
|
|
|
|
|
2020-05-08 10:15:33 -04:00
|
|
|
|
(default-value (slim-configuration))
|
|
|
|
|
(description
|
|
|
|
|
"Run the SLiM graphical login manager for X11."))))
|
services: Introduce extensible services.
This patch rewrites GuixSD services to make them extensible.
* gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm.
* gnu/services.scm (<service>): Replace with new record type.
(<service-extension>, <service-type>): New record types.
(write-service-type, compute-boot-script, second-argument): New
procedures.
(%boot-service, boot-service-type): New variables.
(file-union, directory-union, modprobe-wrapper,
activation-service->script, activation-script,
gexps->activation-gexp): New procedures.
(activation-service-type, %activation-service): New variables.
(etc-directory, files->etc-directory, etc-service): New procedures.
(etc-service-type, setuid-program-service, firmware-service-type): New
variables.
(firmware->activation-gexp): New procedure.
(&service-error, &missing-target-service-error,
&ambiguous-target-service-error): New condition types.
(service-back-edges, fold-services): New procedures.
* gnu/services/avahi.scm (<avahi-configuration>): New record type.
(configuration-file): Replace keyword parameters with a single
'config' parameter.
(%avahi-accounts, %avahi-activation, avahi-service-type): New
variables.
(avahi-dmd-service): New procedure.
(avahi-service): Rewrite using 'service' and 'avahi-configuration'.
* gnu/services/base.scm (%root-file-system-dmd-service,
root-file-system-service-type): New variables.
(root-file-system-service): Use them.
(file-system->dmd-service-name): New procedure.
(file-system-service-type): New variable.
(file-system-service): Use it. Replace keyword parameters with a
single 'file-system' object.
(user-unmount-service-type): New variable.
(user-unmount-service): Use it.
(user-processes-service-type): New variable.
(user-processes-service): Use it.
(host-name-service-type): New variable.
(host-name-service): Use it.
(console-keymap-service-type): New variable.
(console-keymap-service): Use it.
(console-font-service-type): New variable.
(console-font-service): Use it.
(mingetty-pam-service, mingetty-dmd-service): New procedures.
(mingetty-service-type): New variable.
(mingetty-service): Use it.
(nscd-dmd-service): New procedure.
(nscd-activation, nscd-service-type): New variables.
(nscd-service): Use the latter.
(syslog-service-type): New variable.
(syslog-service): Use it.
(<guix-configuration>): New record type.
(%default-guix-configuration): New variable.
(guix-dmd-service, guix-accounts, guix-activation): New procedures.
(guix-service-type): New variable.
(guix-service): Replace list of keyword parameters with a single
'config' parameter. Rewrite using 'service'.
(<udev-configuration>): New record type.
(udev-dmd-service): New procedure.
(udev-service-type): New variable.
(udev-service): Use it.
(device-mapping-service-type): New variable.
(device-mapping-service): Use it.
(swap-service-type): New variable.
(swap-service): Use it.
* gnu/services/databases.scm (<postgresql-configuration>): New record
type.
(%postgresql-accounts, postgresql-activation): New variables.
(postgresql-dmd-service): New procedure.
(postgresql-service): Rewrite using 'service' and
'postgresql-configuration'.
* gnu/services/dbus.scm: New file.
* gnu/services/desktop.scm (dbus-configuration-directory, dbus-service):
Remove.
(wrapped-dbus-service): New procedure.
(<upower-configuration>): New record type.
(upower-configuration-file): Replace keyword parameters with single
<upower-configuration> parameter.
(%upower-accounts, %upower-activation): New variables.
(upower-dbus-service, upower-dmd-service): New procedures.
(upower-service-type): New variable.
(upower-service): Rewrite using 'service' and 'upower-configuration'.
(%colord-activation, %colord-accounts): New variables.
(colord-dmd-service): New procedure.
(colord-service-type): New variable.
(colord-service): Rewrite using 'service'.
(<geoclue-configuration>): New record type.
(geoclue-configuration-file): Replace keyword parameters with a single
'config' parameter.
(geoclue-dbus-service, geoclue-dmd-service): New procedures.
(%geoclue-accounts, geoclue-service-type): New variables.
(geoclue-service): Rewrite using 'service' and
'geoclue-configuration'.
(%polkit-accounts, %polkit-pam-services, polkit-service-type): New
variables.
(polkit-dmd-service): New procedure.
(polkit-service): Rewrite using 'service'.
(<elogind-configuration>)[elogind]: New field.
(elogind-dmd-service): New procedure.
(elogind-service-type): New variable.
(elogind-service): Rewrite using 'service'.
(%desktop-services): Remove argument to 'dbus-service'. Remove 'map'
over %BASE-SERVICES.
* gnu/services/dmd.scm (dmd-boot-gexp): New procedure.
(dmd-root-service-type, %dmd-root-service): New variables.
(dmd-service-type): New macro.
(<dmd-service>): New record type.
* gnu/services/lirc.scm (<lirc-configuration>): New record type.
(%lirc-activation): New variable.
(lirc-dmd-service): New procedure.
(lirc-service-type): New variable.
(lirc-service): Rewrite using 'service' and 'lirc-configuration'.
* gnu/services/networking.scm (<static-networking>): New record type.
(static-networking-service-type): New variable.
(static-networking-service): Rewrite using 'service' and
'static-networking'.
(dhcp-client-service-type): New variable.
(dhcp-client-service): Rewrite using 'service'.
(<ntp-configuration>): New record type.
(ntp-dmd-service): New procedure.
(ntp-service-type): New variable.
(ntp-service): New procedure.
(%tor-accounts, tor-service-type): New variable.
(tor-dmd-service): New procedure.
(tor-service): Rewrite using 'service'.
(<bitlbee-configuration>): New record type.
(bitlbee-dmd-service): New procedure.
(%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New
variables.
(bitlbee-service): Rewrite using 'service'.
(%wicd-activation): New variable.
(wicd-dmd-service): New procedure.
(wicd-service-type): New variable.
(wicd-service): Rewrite using 'service'.
* gnu/services/ssh.scm (<lsh-configuration>): New record type.
(activation): Rename to...
(lsh-initialization): ... this.
(lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures.
(lsh-service-type): New variable.
(lsh-service): Rewrite using 'service' and 'lsh-configuration'.
* gnu/services/web.scm (<nginx-configuration>): New record type.
(%nginx-accounts): New variable.
(nginx-activation, nginx-dmd-service): New procedures.
(nginx-service-type): New variable.
(nginx-service): Rewrite using 'service' and 'nginx-configuration'.
* gnu/services/xorg.scm (<slim-configuration>): New record type.
(slim-pam-service, slim-dmd-service): New procedures.
(slim-service-type): New variable.
(slim-service): Rewrite using 'service' and 'slim-configuration'.
* gnu/system.scm (file-union): Remove.
(other-file-system-services): Adjust to new 'file-system-service'
signature.
(essential-services): Add #:container? parameter. Add
%DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to
'pam-root-service', 'account-service', 'operating-system-etc-service',
and a SETUID-PROGRAM-SERVICE instance.
(operating-system-services): Pass #:container? to 'essential-services.
(etc-directory): Remove.
(operating-system-etc-service): New procedure. Rewrite as a call to
'etc-service'.
(operating-system-accounts): Change to not return accounts required by
services.
(operating-system-etc-directory): Rewrite as a call to 'fold-services'
and 'etc-directory'.
(user-group->gexp, user-account->gexp, modprobe-wrapper): Remove.
(operating-system-activation-script): Rewrite as a call to
'fold-services' and 'activation-service->script'.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Add call to 'lower-object'.
(emacs-site-file, emacs-site-directory, shells-file): Change to use
'computed-file' and 'scheme-file' instead of the monadic procedures.
* gnu/system/install.scm (cow-store-service-type): New variable.
(cow-store-service): Rewrite using 'service'.
(/etc/configuration-files): New procedure.
(configuration-template-service-type,
%configuration-template-service): New variables.
(configuration-template-service): Remove.
(installation-services): Adjust accordingly. Adjust argument to
'guix-service'.
* gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures.
(pam-root-service-type): New variable.
* gnu/system/shadow.scm (user-group->gexp, user-account->gexp,
account-activation, etc-skel, account-service): New procedures.
(account-service-type): New variable.
* tests/services.scm: New file.
* doc/guix.texi (Base Services, Desktop Services): Adjust accordingly.
(Defining Services): Rewrite.
* doc/images/service-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
* po/guix/POTFILES.in: Add gnu/services.scm.
2015-09-17 17:44:26 -04:00
|
|
|
|
|
2015-10-29 14:00:14 -04:00
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Screen lockers & co.
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
(define-record-type <screen-locker>
|
|
|
|
|
(screen-locker name program empty?)
|
|
|
|
|
screen-locker?
|
|
|
|
|
(name screen-locker-name) ;string
|
|
|
|
|
(program screen-locker-program) ;gexp
|
|
|
|
|
(empty? screen-locker-allows-empty-passwords?)) ;Boolean
|
|
|
|
|
|
|
|
|
|
(define screen-locker-pam-services
|
|
|
|
|
(match-lambda
|
|
|
|
|
(($ <screen-locker> name _ empty?)
|
|
|
|
|
(list (unix-pam-service name
|
|
|
|
|
#:allow-empty-passwords? empty?)))))
|
|
|
|
|
|
|
|
|
|
(define screen-locker-setuid-programs
|
2021-07-06 16:03:20 -04:00
|
|
|
|
(compose list file-like->setuid-program screen-locker-program))
|
2015-10-29 14:00:14 -04:00
|
|
|
|
|
|
|
|
|
(define screen-locker-service-type
|
|
|
|
|
(service-type (name 'screen-locker)
|
|
|
|
|
(extensions
|
|
|
|
|
(list (service-extension pam-root-service-type
|
|
|
|
|
screen-locker-pam-services)
|
|
|
|
|
(service-extension setuid-program-service-type
|
2020-05-08 10:15:33 -04:00
|
|
|
|
screen-locker-setuid-programs)))
|
|
|
|
|
(description
|
|
|
|
|
"Allow the given program to be used as a screen locker for
|
|
|
|
|
the graphical server by making it setuid-root, so it can authenticate users,
|
|
|
|
|
and by creating a PAM service for it.")))
|
2015-10-29 14:00:14 -04:00
|
|
|
|
|
|
|
|
|
(define* (screen-locker-service package
|
|
|
|
|
#:optional
|
|
|
|
|
(program (package-name package))
|
|
|
|
|
#:key allow-empty-passwords?)
|
2018-01-27 13:19:24 -05:00
|
|
|
|
"Add @var{package}, a package for a screen locker or screen saver whose
|
2015-10-29 14:00:14 -04:00
|
|
|
|
command is @var{program}, to the set of setuid programs and add a PAM entry
|
|
|
|
|
for it. For example:
|
|
|
|
|
|
|
|
|
|
@lisp
|
system: Use 'file-append' to denote file names.
* gnu/services/avahi.scm, gnu/services/base.scm,
gnu/services/databases.scm, gnu/services/dbus.scm,
gnu/services/desktop.scm, gnu/services/dict.scm,
gnu/services/mail.scm, gnu/services/networking.scm,
gnu/services/sddm.scm, gnu/services/spice.scm,
gnu/services/ssh.scm, gnu/services/web.scm,
gnu/services/xorg.scm, gnu/system.scm: Replace the
#~(string-append #$pkg "/bin/foo") idiom with
(file-append pkg "/bin/foo").
2016-09-10 06:03:47 -04:00
|
|
|
|
(screen-locker-service xlockmore \"xlock\")
|
2015-10-29 14:00:14 -04:00
|
|
|
|
@end lisp
|
|
|
|
|
|
|
|
|
|
makes the good ol' XlockMore usable."
|
|
|
|
|
(service screen-locker-service-type
|
|
|
|
|
(screen-locker program
|
system: Use 'file-append' to denote file names.
* gnu/services/avahi.scm, gnu/services/base.scm,
gnu/services/databases.scm, gnu/services/dbus.scm,
gnu/services/desktop.scm, gnu/services/dict.scm,
gnu/services/mail.scm, gnu/services/networking.scm,
gnu/services/sddm.scm, gnu/services/spice.scm,
gnu/services/ssh.scm, gnu/services/web.scm,
gnu/services/xorg.scm, gnu/system.scm: Replace the
#~(string-append #$pkg "/bin/foo") idiom with
(file-append pkg "/bin/foo").
2016-09-10 06:03:47 -04:00
|
|
|
|
(file-append package "/bin/" program)
|
2015-10-29 14:00:14 -04:00
|
|
|
|
allow-empty-passwords?)))
|
|
|
|
|
|
2019-04-02 16:50:38 -04:00
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Locale service.
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
(define-record-type* <localed-configuration>
|
|
|
|
|
localed-configuration make-localed-configuration
|
|
|
|
|
localed-configuration?
|
|
|
|
|
(localed localed-configuration-localed
|
|
|
|
|
(default localed))
|
|
|
|
|
(keyboard-layout localed-configuration-keyboard-layout
|
|
|
|
|
(default #f)))
|
|
|
|
|
|
|
|
|
|
(define (localed-dbus-service config)
|
|
|
|
|
"Return the 'localed' D-Bus service for @var{config}, a
|
|
|
|
|
@code{<localed-configuration>} record."
|
|
|
|
|
(define keyboard-layout
|
|
|
|
|
(localed-configuration-keyboard-layout config))
|
|
|
|
|
|
|
|
|
|
;; The primary purpose of 'localed' is to tell GDM what the "current" Xorg
|
|
|
|
|
;; keyboard layout is. If 'localed' is missing, or if it's unable to
|
|
|
|
|
;; determine the current XKB layout, then GDM forcefully installs its
|
|
|
|
|
;; default XKB config (US English). Here we communicate the configured
|
|
|
|
|
;; layout through environment variables.
|
|
|
|
|
|
|
|
|
|
(if keyboard-layout
|
|
|
|
|
(let* ((layout (keyboard-layout-name keyboard-layout))
|
|
|
|
|
(variant (keyboard-layout-variant keyboard-layout))
|
|
|
|
|
(model (keyboard-layout-model keyboard-layout))
|
|
|
|
|
(options (keyboard-layout-options keyboard-layout)))
|
|
|
|
|
(list (wrapped-dbus-service
|
|
|
|
|
(localed-configuration-localed config)
|
|
|
|
|
"libexec/localed/localed"
|
|
|
|
|
`(("GUIX_XKB_LAYOUT" ,layout)
|
|
|
|
|
,@(if variant
|
|
|
|
|
`(("GUIX_XKB_VARIANT" ,variant))
|
|
|
|
|
'())
|
|
|
|
|
,@(if model
|
|
|
|
|
`(("GUIX_XKB_MODEL" ,model))
|
|
|
|
|
'())
|
|
|
|
|
,@(if (null? options)
|
|
|
|
|
'()
|
|
|
|
|
`(("GUIX_XKB_OPTIONS"
|
|
|
|
|
,(string-join options ","))))))))
|
2019-04-05 11:43:22 -04:00
|
|
|
|
'()))
|
2019-04-02 16:50:38 -04:00
|
|
|
|
|
|
|
|
|
(define localed-service-type
|
2019-04-05 11:51:28 -04:00
|
|
|
|
(let ((package (lambda (config)
|
|
|
|
|
;; Don't bother if the user didn't specify any keyboard
|
|
|
|
|
;; layout.
|
|
|
|
|
(if (localed-configuration-keyboard-layout config)
|
|
|
|
|
(list (localed-configuration-localed config))
|
|
|
|
|
'()))))
|
2019-04-02 16:50:38 -04:00
|
|
|
|
(service-type (name 'localed)
|
|
|
|
|
(extensions
|
|
|
|
|
(list (service-extension dbus-root-service-type
|
|
|
|
|
localed-dbus-service)
|
|
|
|
|
(service-extension udev-service-type package)
|
|
|
|
|
(service-extension polkit-service-type package)
|
|
|
|
|
|
|
|
|
|
;; Add 'localectl' to the profile.
|
|
|
|
|
(service-extension profile-service-type package)))
|
|
|
|
|
|
|
|
|
|
;; This service can be extended, typically by the X login
|
|
|
|
|
;; manager, to communicate the chosen Xorg keyboard layout.
|
2019-04-05 11:51:28 -04:00
|
|
|
|
(compose (lambda (extensions)
|
|
|
|
|
(find keyboard-layout? extensions)))
|
2019-04-02 16:50:38 -04:00
|
|
|
|
(extend (lambda (config keyboard-layout)
|
|
|
|
|
(localed-configuration
|
|
|
|
|
(inherit config)
|
|
|
|
|
(keyboard-layout keyboard-layout))))
|
|
|
|
|
(description
|
|
|
|
|
"Run the locale daemon, @command{localed}, which can be used
|
|
|
|
|
to control the system locale and keyboard mapping from user programs such as
|
|
|
|
|
the GNOME desktop environment.")
|
|
|
|
|
(default-value (localed-configuration)))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; GNOME Desktop Manager.
|
|
|
|
|
;;;
|
|
|
|
|
|
2017-08-22 12:41:19 -04:00
|
|
|
|
(define %gdm-accounts
|
|
|
|
|
(list (user-group (name "gdm") (system? #t))
|
|
|
|
|
(user-account
|
|
|
|
|
(name "gdm")
|
|
|
|
|
(group "gdm")
|
2020-03-26 10:19:21 -04:00
|
|
|
|
(supplementary-groups '("video"))
|
2017-08-22 12:41:19 -04:00
|
|
|
|
(system? #t)
|
|
|
|
|
(comment "GNOME Display Manager user")
|
|
|
|
|
(home-directory "/var/lib/gdm")
|
|
|
|
|
(shell (file-append shadow "/sbin/nologin")))))
|
|
|
|
|
|
2019-09-20 15:33:22 -04:00
|
|
|
|
(define %gdm-activation
|
|
|
|
|
;; Ensure /var/lib/gdm is owned by the "gdm" user. This is normally the
|
|
|
|
|
;; case but could be wrong if the "gdm" user was created, then removed, and
|
|
|
|
|
;; then recreated under a different UID/GID: <https://bugs.gnu.org/37423>.
|
|
|
|
|
(with-imported-modules '((guix build utils))
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build utils))
|
|
|
|
|
|
|
|
|
|
(let* ((gdm (getpwnam "gdm"))
|
|
|
|
|
(uid (passwd:uid gdm))
|
|
|
|
|
(gid (passwd:gid gdm))
|
|
|
|
|
(st (stat "/var/lib/gdm" #f)))
|
|
|
|
|
;; Recurse into /var/lib/gdm only if it has wrong ownership.
|
|
|
|
|
(when (and st
|
|
|
|
|
(or (not (= uid (stat:uid st)))
|
|
|
|
|
(not (= gid (stat:gid st)))))
|
|
|
|
|
(for-each (lambda (file)
|
|
|
|
|
(chown file uid gid))
|
|
|
|
|
(find-files "/var/lib/gdm"
|
|
|
|
|
#:directories? #t)))))))
|
|
|
|
|
|
2019-02-13 14:22:19 -05:00
|
|
|
|
(define dbus-daemon-wrapper
|
2019-05-08 09:13:14 -04:00
|
|
|
|
(program-file
|
|
|
|
|
"gdm-dbus-wrapper"
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (srfi srfi-26))
|
|
|
|
|
|
|
|
|
|
(define system-profile
|
|
|
|
|
"/run/current-system/profile")
|
|
|
|
|
|
|
|
|
|
(define user-profile
|
|
|
|
|
(and=> (getpw (getuid))
|
|
|
|
|
(lambda (pw)
|
|
|
|
|
(string-append (passwd:dir pw) "/.guix-profile"))))
|
|
|
|
|
|
|
|
|
|
;; If we are able to find the user's profile, we can add it to
|
|
|
|
|
;; the search paths set below. We need to do this so that D-Bus
|
|
|
|
|
;; can start services installed by the user. This allows
|
|
|
|
|
;; applications that require session D-Bus services (e.g,
|
|
|
|
|
;; 'evolution') to work even if those services are only available
|
|
|
|
|
;; in the user's profile. See <https://bugs.gnu.org/35267>.
|
|
|
|
|
(define profiles
|
|
|
|
|
(if user-profile
|
|
|
|
|
(list user-profile system-profile)
|
|
|
|
|
(list system-profile)))
|
|
|
|
|
|
|
|
|
|
(setenv "XDG_CONFIG_DIRS"
|
|
|
|
|
(string-join (map (cut string-append <> "/etc/xdg") profiles)
|
|
|
|
|
":"))
|
|
|
|
|
(setenv "XDG_DATA_DIRS"
|
|
|
|
|
(string-join (map (cut string-append <> "/share") profiles)
|
|
|
|
|
":"))
|
|
|
|
|
(apply execl (string-append #$dbus "/bin/dbus-daemon")
|
|
|
|
|
(program-arguments)))))
|
2019-02-13 14:22:19 -05:00
|
|
|
|
|
2021-10-02 12:51:34 -04:00
|
|
|
|
;; Wrapper script for Wayland sessions, similar to Xsession.
|
|
|
|
|
;;
|
|
|
|
|
;; See `xinitrc`. By default, it launches the specified session through a
|
|
|
|
|
;; login shell. With the default Guix configuration, this should source
|
|
|
|
|
;; /etc/profile, setting up the Guix profile environment variables. However,
|
|
|
|
|
;; gdm launches its own graphical session through the same method, so we need
|
|
|
|
|
;; to ignore this case, since `gdm` doesn't have a login shell.
|
|
|
|
|
(define gdm-wayland-session-wrapper
|
|
|
|
|
(program-file
|
|
|
|
|
"gdm-wayland-session-wrapper"
|
|
|
|
|
#~((let* ((user (getpw (getuid)))
|
|
|
|
|
(name (passwd:name user))
|
|
|
|
|
(shell (passwd:shell user))
|
|
|
|
|
(args (cdr (command-line))))
|
|
|
|
|
(if (string=? name "gdm")
|
|
|
|
|
(apply execl (cons (car args) args))
|
|
|
|
|
(execl shell shell "--login" "-c" (string-join args)))))))
|
|
|
|
|
|
2017-08-22 12:41:19 -04:00
|
|
|
|
(define-record-type* <gdm-configuration>
|
|
|
|
|
gdm-configuration make-gdm-configuration
|
|
|
|
|
gdm-configuration?
|
|
|
|
|
(gdm gdm-configuration-gdm (default gdm))
|
|
|
|
|
(allow-empty-passwords? gdm-configuration-allow-empty-passwords? (default #t))
|
|
|
|
|
(auto-login? gdm-configuration-auto-login? (default #f))
|
2019-02-13 14:22:19 -05:00
|
|
|
|
(dbus-daemon gdm-configuration-dbus-daemon (default dbus-daemon-wrapper))
|
2019-10-23 21:57:52 -04:00
|
|
|
|
(debug? gdm-configuration-debug? (default #f))
|
2017-08-22 12:41:19 -04:00
|
|
|
|
(default-user gdm-configuration-default-user (default #f))
|
2019-02-13 14:22:20 -05:00
|
|
|
|
(gnome-shell-assets gdm-configuration-gnome-shell-assets
|
2021-10-15 12:10:33 -04:00
|
|
|
|
(default (list adwaita-icon-theme font-abattis-cantarell)))
|
2019-03-19 16:26:33 -04:00
|
|
|
|
(xorg-configuration gdm-configuration-xorg
|
|
|
|
|
(default (xorg-configuration)))
|
2019-02-13 14:22:21 -05:00
|
|
|
|
(x-session gdm-configuration-x-session
|
2021-09-13 03:45:06 -04:00
|
|
|
|
(default (xinitrc)))
|
2021-10-02 12:51:34 -04:00
|
|
|
|
(wayland? gdm-configuration-wayland? (default #f))
|
|
|
|
|
(wayland-session gdm-configuration-wayland-session
|
|
|
|
|
(default gdm-wayland-session-wrapper)))
|
2017-08-22 12:41:19 -04:00
|
|
|
|
|
2019-02-13 14:22:14 -05:00
|
|
|
|
(define (gdm-configuration-file config)
|
|
|
|
|
(mixed-text-file "gdm-custom.conf"
|
|
|
|
|
"[daemon]\n"
|
|
|
|
|
"#User=gdm\n"
|
|
|
|
|
"#Group=gdm\n"
|
|
|
|
|
(if (gdm-configuration-auto-login? config)
|
|
|
|
|
(string-append
|
|
|
|
|
"AutomaticLoginEnable=true\n"
|
|
|
|
|
"AutomaticLogin="
|
|
|
|
|
(or (gdm-configuration-default-user config)
|
|
|
|
|
(error "missing default user for auto-login"))
|
|
|
|
|
"\n")
|
|
|
|
|
(string-append
|
|
|
|
|
"AutomaticLoginEnable=false\n"
|
|
|
|
|
"#AutomaticLogin=\n"))
|
|
|
|
|
"#TimedLoginEnable=false\n"
|
|
|
|
|
"#TimedLogin=\n"
|
|
|
|
|
"#TimedLoginDelay=0\n"
|
2020-01-27 17:56:57 -05:00
|
|
|
|
;; Disable initial system setup inside GDM.
|
|
|
|
|
;; Whatever settings are set there should already be
|
|
|
|
|
;; taken care of through `guix system'.
|
|
|
|
|
;; See also
|
|
|
|
|
;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=39281>.
|
|
|
|
|
"InitialSetupEnable=false\n"
|
2021-09-13 03:45:06 -04:00
|
|
|
|
"WaylandEnable=" (if (gdm-configuration-wayland? config)
|
|
|
|
|
"true"
|
|
|
|
|
"false") "\n"
|
2019-02-13 14:22:14 -05:00
|
|
|
|
"\n"
|
|
|
|
|
"[debug]\n"
|
2019-10-23 21:57:52 -04:00
|
|
|
|
"Enable=" (if (gdm-configuration-debug? config)
|
|
|
|
|
"true"
|
|
|
|
|
"false") "\n"
|
2019-02-13 14:22:14 -05:00
|
|
|
|
"\n"
|
|
|
|
|
"[security]\n"
|
|
|
|
|
"#DisallowTCP=true\n"
|
|
|
|
|
"#AllowRemoteAutoLogin=false\n"))
|
2017-08-22 12:41:19 -04:00
|
|
|
|
|
|
|
|
|
(define (gdm-pam-service config)
|
|
|
|
|
"Return a PAM service for @command{gdm}."
|
|
|
|
|
(list
|
|
|
|
|
(pam-service
|
2019-05-09 06:02:20 -04:00
|
|
|
|
(inherit (unix-pam-service "gdm-autologin"
|
|
|
|
|
#:login-uid? #t))
|
2017-08-22 12:41:19 -04:00
|
|
|
|
(auth (list (pam-entry
|
2020-06-14 18:58:47 -04:00
|
|
|
|
(control "optional")
|
2017-08-22 12:41:19 -04:00
|
|
|
|
(module (file-append (gdm-configuration-gdm config)
|
|
|
|
|
"/lib/security/pam_gdm.so")))
|
|
|
|
|
(pam-entry
|
|
|
|
|
(control "sufficient")
|
|
|
|
|
(module "pam_permit.so")))))
|
|
|
|
|
(pam-service
|
|
|
|
|
(inherit (unix-pam-service "gdm-launch-environment"))
|
|
|
|
|
(auth (list (pam-entry
|
|
|
|
|
(control "required")
|
|
|
|
|
(module "pam_permit.so")))))
|
2018-12-29 21:42:03 -05:00
|
|
|
|
(unix-pam-service "gdm-password"
|
2019-05-09 06:02:20 -04:00
|
|
|
|
#:login-uid? #t
|
2018-12-29 21:42:03 -05:00
|
|
|
|
#:allow-empty-passwords?
|
|
|
|
|
(gdm-configuration-allow-empty-passwords? config))))
|
2017-08-22 12:41:19 -04:00
|
|
|
|
|
|
|
|
|
(define (gdm-shepherd-service config)
|
|
|
|
|
(list (shepherd-service
|
|
|
|
|
(documentation "Xorg display server (GDM)")
|
|
|
|
|
(provision '(xorg-server))
|
|
|
|
|
(requirement '(dbus-system user-processes host-name udev))
|
|
|
|
|
(start #~(lambda ()
|
|
|
|
|
(fork+exec-command
|
|
|
|
|
(list #$(file-append (gdm-configuration-gdm config)
|
|
|
|
|
"/bin/gdm"))
|
|
|
|
|
#:environment-variables
|
|
|
|
|
(list (string-append
|
2019-02-13 14:22:14 -05:00
|
|
|
|
"GDM_CUSTOM_CONF="
|
|
|
|
|
#$(gdm-configuration-file config))
|
2019-02-13 14:22:19 -05:00
|
|
|
|
(string-append
|
|
|
|
|
"GDM_DBUS_DAEMON="
|
|
|
|
|
#$(gdm-configuration-dbus-daemon config))
|
2019-02-13 14:22:14 -05:00
|
|
|
|
(string-append
|
2017-08-22 12:41:19 -04:00
|
|
|
|
"GDM_X_SERVER="
|
2019-03-19 16:26:33 -04:00
|
|
|
|
#$(xorg-wrapper
|
|
|
|
|
(gdm-configuration-xorg config)))
|
2019-02-13 14:22:21 -05:00
|
|
|
|
(string-append
|
|
|
|
|
"GDM_X_SESSION="
|
|
|
|
|
#$(gdm-configuration-x-session config))
|
2019-02-13 14:22:20 -05:00
|
|
|
|
(string-append
|
|
|
|
|
"XDG_DATA_DIRS="
|
|
|
|
|
((lambda (ls) (string-join ls ":"))
|
|
|
|
|
(map (lambda (path)
|
|
|
|
|
(string-append path "/share"))
|
|
|
|
|
;; XXX: Remove gnome-shell below when GDM
|
|
|
|
|
;; can depend on GNOME Shell directly.
|
|
|
|
|
(cons #$gnome-shell
|
|
|
|
|
'#$(gdm-configuration-gnome-shell-assets
|
2021-09-13 03:45:06 -04:00
|
|
|
|
config)))))
|
|
|
|
|
;; Add XCURSOR_PATH so that mutter can find its
|
|
|
|
|
;; cursors. gdm doesn't login so doesn't source
|
|
|
|
|
;; the corresponding line in /etc/profile.
|
2021-10-02 12:51:34 -04:00
|
|
|
|
"XCURSOR_PATH=/run/current-system/profile/share/icons"
|
2021-11-23 15:25:10 -05:00
|
|
|
|
(string-append
|
|
|
|
|
"GDK_PIXBUF_MODULE_FILE="
|
|
|
|
|
#$gnome-shell "/" #$%gdk-pixbuf-loaders-cache-file)
|
2021-10-02 12:51:34 -04:00
|
|
|
|
(string-append
|
|
|
|
|
"GDM_WAYLAND_SESSION="
|
|
|
|
|
#$(gdm-configuration-wayland-session config))))))
|
2017-08-22 12:41:19 -04:00
|
|
|
|
(stop #~(make-kill-destructor))
|
|
|
|
|
(respawn? #t))))
|
|
|
|
|
|
|
|
|
|
(define gdm-service-type
|
2020-02-16 06:58:33 -05:00
|
|
|
|
(handle-xorg-configuration gdm-configuration
|
|
|
|
|
(service-type (name 'gdm)
|
|
|
|
|
(extensions
|
|
|
|
|
(list (service-extension shepherd-root-service-type
|
|
|
|
|
gdm-shepherd-service)
|
|
|
|
|
(service-extension activation-service-type
|
|
|
|
|
(const %gdm-activation))
|
|
|
|
|
(service-extension account-service-type
|
|
|
|
|
(const %gdm-accounts))
|
|
|
|
|
(service-extension pam-root-service-type
|
|
|
|
|
gdm-pam-service)
|
|
|
|
|
(service-extension profile-service-type
|
|
|
|
|
gdm-configuration-gnome-shell-assets)
|
|
|
|
|
(service-extension dbus-root-service-type
|
|
|
|
|
(compose list
|
|
|
|
|
gdm-configuration-gdm))
|
|
|
|
|
(service-extension localed-service-type
|
|
|
|
|
(compose
|
|
|
|
|
xorg-configuration-keyboard-layout
|
|
|
|
|
gdm-configuration-xorg))))
|
|
|
|
|
(default-value (gdm-configuration))
|
|
|
|
|
(description
|
|
|
|
|
"Run the GNOME Desktop Manager (GDM), a program that allows
|
|
|
|
|
you to log in in a graphical session, whether or not you use GNOME."))))
|
2017-08-22 12:41:19 -04:00
|
|
|
|
|
2019-04-03 07:55:06 -04:00
|
|
|
|
(define* (set-xorg-configuration config
|
|
|
|
|
#:optional
|
|
|
|
|
(login-manager-service-type
|
|
|
|
|
gdm-service-type))
|
|
|
|
|
"Tell the log-in manager (of type @var{login-manager-service-type}) to use
|
|
|
|
|
@var{config}, an <xorg-configuration> record."
|
|
|
|
|
(simple-service 'set-xorg-configuration
|
|
|
|
|
login-manager-service-type
|
|
|
|
|
config))
|
|
|
|
|
|
2014-02-19 14:58:24 -05:00
|
|
|
|
;;; xorg.scm ends here
|