@ -81,13 +81,7 @@ let
monitors = forEach xrandrHeads ( h : ''
Option " m o n i t o r - ${ h . config . output } " " ${ h . name } "
'' ) ;
# First option is indented through the space in the config but any
# subsequent options aren't so we need to apply indentation to
# them here
monitorsIndented = if length monitors > 1
then singleton ( head monitors ) ++ map ( m : " " + m ) ( tail monitors )
else monitors ;
in concatStrings monitorsIndented ;
in concatStrings monitors ;
# Here we chain every monitor from the left to right, so we have:
# m4 right of m3 right of m2 right of m1 .----.----.----.----.
@ -138,10 +132,15 @@ let
echo ' $ { cfg . filesSection } ' > > $ out
echo ' EndSection' > > $ out
echo > > $ out
echo " $ c o n f i g " > > $ out
'' ; # * /
prefixStringLines = prefix : str :
concatMapStringsSep " \n " ( line : prefix + line ) ( splitString " \n " str ) ;
indent = prefixStringLines " " ;
in
{
@ -358,6 +357,13 @@ in
description = ''
The contents of the configuration file of the X server
( <filename> xorg . conf < /filename > ) .
This option is set by multiple modules , and the configs are
concatenated together .
In Xorg configs the last config entries take precedence ,
so you may want to use <literal> lib . mkAfter < /literal > on this option
to override NixOS's defaults .
'' ;
} ;
@ -736,29 +742,29 @@ in
Section " S e r v e r F l a g s "
Option " A l l o w M o u s e O p e n F a i l " " o n "
Option " D o n t Z a p " " ${ if cfg . enableCtrlAltBackspace then " o f f " else " o n " } "
$ { cfg . serverFlagsSection }
$ { indent cfg . serverFlagsSection }
EndSection
Section " M o d u l e "
$ { cfg . moduleSection }
$ { indent cfg . moduleSection }
EndSection
Section " M o n i t o r "
Identifier " M o n i t o r [ 0 ] "
$ { cfg . monitorSection }
$ { indent cfg . monitorSection }
EndSection
# Additional "InputClass" sections
$ { flip concatMapStrings cfg . inputClassSections ( inputClassSection : ''
Section " I n p u t C l a s s "
$ { inputClassSection }
EndSection
$ { flip ( concatMapStringsSep " \n " ) cfg . inputClassSections ( inputClassSection : ''
Section " I n p u t C l a s s "
$ { indent in putClassSection }
EndSection
'' ) }
Section " S e r v e r L a y o u t "
Identifier " L a y o u t [ a l l ] "
$ { cfg . serverLayoutSection }
$ { indent cfg . serverLayoutSection }
# Reference the Screen sections for each driver. This will
# cause the X server to try each in turn.
$ { flip concatMapStrings ( filter ( d : d . display ) cfg . drivers ) ( d : ''
@ -781,9 +787,9 @@ in
Identifier " D e v i c e - ${ driver . name } [ 0 ] "
Driver " ${ driver . driverName or driver . name } "
$ { if cfg . useGlamor then '' O p t i o n " A c c e l M e t h o d " " g l a m o r " '' else " " }
$ { cfg . deviceSection }
$ { driver . deviceSection or " " }
$ { xrandrDeviceSection }
$ { indent cfg . deviceSection }
$ { indent ( driver . deviceSection or " " ) }
$ { indent xrandrDeviceSection }
EndSection
$ { optionalString driver . display ''
@ -794,18 +800,22 @@ in
Monitor " M o n i t o r [ 0 ] "
'' }
$ { cfg . screenSection }
$ { driver . screenSection or " " }
$ { indent cfg . screenSection }
$ { indent ( driver . screenSection or " " ) }
$ { optionalString ( cfg . defaultDepth != 0 ) ''
DefaultDepth $ { toString cfg . defaultDepth }
'' }
$ { optionalString
( driver . name != " v i r t u a l b o x " &&
(
driver . name != " v i r t u a l b o x "
&&
( cfg . resolutions != [ ] ||
cfg . extraDisplaySettings != " " ||
cfg . virtualScreen != null ) )
cfg . virtualScreen != null
)
)
( let
f = depth :
''
@ -813,7 +823,7 @@ in
Depth $ { toString depth }
$ { optionalString ( cfg . resolutions != [ ] )
" M o d e s ${ concatMapStrings ( res : '' " ${ toString res . x } x ${ toString res . y } " '' ) cfg . resolutions } " }
$ { cfg . extraDisplaySettings }
$ { indent cfg . extraDisplaySettings }
$ { optionalString ( cfg . virtualScreen != null )
" V i r t u a l ${ toString cfg . virtualScreen . x } ${ toString cfg . virtualScreen . y } " }
EndSubSection