summaryrefslogtreecommitdiff
path: root/epistemia/packages/xorg.scm
blob: 05b63f167aea163941bac9c6d602fde06b3f5771 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
(define-module (epistemia packages xorg)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (gnu packages xdisorg)
  #:use-module (gnu packages xorg))

(define-public xorg-server-with-drivers
  (package
    (inherit xorg-server)
    (name "xorg-server-with-drivers")
    (arguments
     (substitute-keyword-arguments (package-arguments xorg-server)
       ((#:phases phases)
	#~(modify-phases #$phases
	    (add-after 'install 'install-modules-conf
	      (lambda _
		;; Add Xorg module paths so drivers in inputs are found.
		(call-with-output-file
		    (string-append #$output "/share/X11/xorg.conf.d/00-modules.conf")
		  (lambda (port)
		    (display
		     (string-append
		      "Section \"Files\"\nModulePath \""
		      #$output "/lib/xorg/modules,"
		      #$(this-package-input "xf86-input-libinput") "/lib/xorg/modules,"
		      #$(this-package-input "xf86-input-wacom") "/lib/xorg/modules,"
		      #$(this-package-input "xf86-video-amdgpu") "/lib/xorg/modules\"\n"
		      "EndSection\n")
		     port)))
		(call-with-output-file
		    (string-append #$output "/share/X11/xorg.conf.d/10-input.conf")
		  (lambda (port)
		    (display
		     (string-append
		      "Section \"InputClass\"\n"
		      "    Identifier \"keyboards\"\n"
		      "    MatchIsKeyboard \"on\"\n"
		      "    Driver \"libinput\"\n"
		      "EndSection\n"
		      "\n"
		      "Section \"InputClass\"\n"
		      "    Identifier \"mice\"\n"
		      "    MatchIsPointer \"on\"\n"
		      "    Driver \"libinput\"\n"
		      "    Option \"AccelProfile\" \"flat\"\n"
		      "    Option \"AccelSpeed\" \"0\"\n"
		      "EndSection\n"
		      "\n"
		      "Section \"InputClass\"\n"
		      "    Identifier \"touchpads\"\n"
		      "    MatchIsTouchpad \"on\"\n"
		      "    Driver \"libinput\"\n"
		      "    Option \"AccelProfile\" \"flat\"\n"
		      "    Option \"AccelSpeed\" \"0\"\n"
		      "    Option \"Tapping\" \"on\"\n"
		      "    Option \"TappingButtonMap\" \"lrm\"\n"
		      "EndSection\n"
		      "\n"
		      "Section \"InputClass\"\n"
		      "    Identifier \"wacom\"\n"
		      "    MatchProduct \"Wacom\"\n"
		      "    Driver \"wacom\"\n"
		      "EndSection\n")
		     port)))))))))
    (inputs (modify-inputs (package-inputs xorg-server)
	      (append xf86-input-libinput
		      xf86-input-wacom
		      xf86-video-amdgpu)))))