mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
gnu: Add preliminary Xorg service.
* gnu/system/dmd.scm (xorg-service): New procedure.
This commit is contained in:
parent
c04c6ff64c
commit
53bd729e8c
1 changed files with 94 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -29,6 +29,10 @@ (define-module (gnu system dmd)
|
||||||
#:select (guix))
|
#:select (guix))
|
||||||
#:use-module ((gnu packages linux)
|
#:use-module ((gnu packages linux)
|
||||||
#:select (net-tools))
|
#:select (net-tools))
|
||||||
|
#:use-module (gnu packages xorg)
|
||||||
|
#:use-module (gnu packages bash)
|
||||||
|
#:use-module (gnu packages gl)
|
||||||
|
|
||||||
#:use-module (gnu system shadow) ; for user accounts/groups
|
#:use-module (gnu system shadow) ; for user accounts/groups
|
||||||
#:use-module (gnu system linux) ; for PAM services
|
#:use-module (gnu system linux) ; for PAM services
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
|
@ -54,6 +58,7 @@ (define-module (gnu system dmd)
|
||||||
nscd-service
|
nscd-service
|
||||||
guix-service
|
guix-service
|
||||||
static-networking-service
|
static-networking-service
|
||||||
|
xorg-service
|
||||||
|
|
||||||
dmd-configuration-file))
|
dmd-configuration-file))
|
||||||
|
|
||||||
|
@ -265,6 +270,94 @@ (define* (static-networking-service interface ip
|
||||||
`(("net-tools" ,net-tools))
|
`(("net-tools" ,net-tools))
|
||||||
'())))))))
|
'())))))))
|
||||||
|
|
||||||
|
(define (xorg-service)
|
||||||
|
"Return a service that starts the Xorg graphical display server."
|
||||||
|
(define (xserver.conf)
|
||||||
|
(mlet %store-monad ((fonts (package-file font-adobe75dpi
|
||||||
|
"lib/X11/fonts"))
|
||||||
|
(xorg (package-file xorg-server
|
||||||
|
"lib/xorg/modules"))
|
||||||
|
(vesa (package-file xf86-video-vesa
|
||||||
|
"lib/xorg/modules/drivers"))
|
||||||
|
(kbd (package-file xf86-input-keyboard
|
||||||
|
"lib/xorg/modules/input"))
|
||||||
|
(mouse (package-file xf86-input-mouse
|
||||||
|
"lib/xorg/modules/input")))
|
||||||
|
(text-file "xserver.conf" ; let's go!
|
||||||
|
(string-append "
|
||||||
|
Section \"Files\"
|
||||||
|
FontPath \"" fonts "\"
|
||||||
|
ModulePath \"" vesa "\"
|
||||||
|
ModulePath \"" mouse "\"
|
||||||
|
ModulePath \"" kbd "\"
|
||||||
|
ModulePath \"" xorg "\"
|
||||||
|
ModulePath \"" xorg "/extensions\"
|
||||||
|
ModulePath \"" xorg "/multimedia\"
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section \"ServerFlags\"
|
||||||
|
Option \"AllowMouseOpenFail\" \"on""
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section \"Monitor\"
|
||||||
|
Identifier \"Monitor[0]\"
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section \"InputClass\"
|
||||||
|
Identifier \"Generic keyboard\"
|
||||||
|
MatchIsKeyboard \"on\"
|
||||||
|
Option \"XkbRules\" \"base\"
|
||||||
|
Option \"XkbModel\" \"pc104\"
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section \"ServerLayout\"
|
||||||
|
Identifier \"Layout\"
|
||||||
|
Screen \"Screen-vesa\"
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section \"Device\"
|
||||||
|
Identifier \"Device-vesa\"
|
||||||
|
Driver \"vesa\"
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section \"Screen\"
|
||||||
|
Identifier \"Screen-vesa\"
|
||||||
|
Device \"Device-vesa\"
|
||||||
|
EndSection"))))
|
||||||
|
|
||||||
|
(mlet %store-monad ((xorg-bin (package-file xorg-server "bin/X"))
|
||||||
|
(dri (package-file mesa "lib/dri"))
|
||||||
|
(xkbcomp-bin (package-file xkbcomp "bin"))
|
||||||
|
(xkb-dir (package-file xkeyboard-config
|
||||||
|
"share/X11/xkb"))
|
||||||
|
(sh (package-file bash "bin/sh"))
|
||||||
|
(config (xserver.conf)))
|
||||||
|
(return
|
||||||
|
(service
|
||||||
|
(documentation "The X11 graphic server")
|
||||||
|
(provision '(xorg-server))
|
||||||
|
(requirement '(host-name))
|
||||||
|
(start `(make-forkexec-constructor
|
||||||
|
;; XXX: 'make-forkexec-constructor' should allow use to specify
|
||||||
|
;; env vars.
|
||||||
|
,sh "-c" ,(string-append "XORG_DRI_DRIVER_PATH=" dri " "
|
||||||
|
"XKB_BINDIR=" xkbcomp-bin " "
|
||||||
|
xorg-bin " -ac -logverbose -verbose "
|
||||||
|
"-xkbdir " xkb-dir " "
|
||||||
|
"-config " config " "
|
||||||
|
"-nolisten tcp :0 vt7")))
|
||||||
|
(stop `(make-kill-destructor))
|
||||||
|
(respawn? #f)
|
||||||
|
(inputs `(("xorg" ,xorg-server)
|
||||||
|
("mesa" ,mesa)
|
||||||
|
("xkbcomp" ,xkbcomp)
|
||||||
|
("xkeyboard-config" ,xkeyboard-config)
|
||||||
|
("vesa" ,xf86-video-vesa)
|
||||||
|
("mouse" ,xf86-input-mouse)
|
||||||
|
("kbd" ,xf86-input-keyboard)
|
||||||
|
("fonts" ,font-adobe75dpi)
|
||||||
|
("bash" ,bash)))))))
|
||||||
|
|
||||||
|
|
||||||
(define (dmd-configuration-file services etc)
|
(define (dmd-configuration-file services etc)
|
||||||
"Return the dmd configuration file for SERVICES, that initializes /etc from
|
"Return the dmd configuration file for SERVICES, that initializes /etc from
|
||||||
|
|
Loading…
Reference in a new issue