diff --git a/system/options.nix b/system/options.nix index abe1d248259a..faf171d58669 100644 --- a/system/options.nix +++ b/system/options.nix @@ -676,6 +676,16 @@ "; } + { + name = ["services" "xserver" "isClone"]; + default = "on"; + example = "off"; + description = " + Whether to enable the X server clone mode for dual-head. + "; + } + + { name = ["services" "httpd" "enable"]; diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index f74fedcce1eb..2c509c698854 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -162,6 +162,7 @@ import ../upstart-jobs/gather.nix { libX11 = pkgs.xlibs.libX11; libXext = pkgs.xlibs.libXext; fontDirectories = import ../system/fonts.nix {inherit pkgs;}; + isClone = config.get ["services" "xserver" "isClone"]; }) # Apache httpd. diff --git a/upstart-jobs/xserver.conf b/upstart-jobs/xserver.conf index d8f6cb0f905c..dea1ed7c12b9 100644 --- a/upstart-jobs/xserver.conf +++ b/upstart-jobs/xserver.conf @@ -73,7 +73,7 @@ EndSection Section "Device" Identifier "Device[0]" Driver "@videoDriver@" - Option "Clone" "On" + Option "Clone" "@isClone@" #Option "MonitorLayout" "CRT,LFP" Option "MonitorLayout" "LVDS,CRT" @device@ diff --git a/upstart-jobs/xserver.nix b/upstart-jobs/xserver.nix index 8181e7443df8..c76957601c39 100644 --- a/upstart-jobs/xserver.nix +++ b/upstart-jobs/xserver.nix @@ -16,6 +16,8 @@ , # List of font directories. fontDirectories +, # Is Clone mode on? + isClone ? "on" }: let @@ -68,7 +70,7 @@ let configFile = stdenv.mkDerivation { name = "xserver.conf"; src = ./xserver.conf; - inherit fontDirectories videoDriver resolutions; + inherit fontDirectories videoDriver resolutions isClone; buildCommand = " buildCommand= # urgh, don't substitute this @@ -76,7 +78,7 @@ let for i in $fontDirectories; do if test \"\${i:0:\${#NIX_STORE}}\" == \"$NIX_STORE\"; then for j in $(find $i -name fonts.dir); do - fontPaths=\"\${fontPaths}FontPath \\\"$(dirname $j)\\\"\\n\" + fontPaths=\"\${fontPaths}FontPath \\\"$(dirname $j)\\\"\n\" done fi done @@ -84,13 +86,13 @@ let export modulePaths= for i in $(find ${toString modules} -type d); do if ls $i/*.so 2> /dev/null; then - modulePaths=\"\${modulePaths}ModulePath \\\"$i\\\"\\n\" + modulePaths=\"\${modulePaths}ModulePath \\\"$i\\\"\n\" fi done #if only my gf were this dirty if test \"${toString videoDriver}\" == \"nvidia\"; then - export moduleSection=\"Load \\\"glx\\\" \\n \\ + export moduleSection=\"Load \\\"glx\\\" \\ SubSection \\\"extmod\\\" \\n \\ Option \\\"omit xfree86-dga\\\" \\n \\ EndSubSection \\n \" @@ -103,7 +105,7 @@ let export extensions=\"Option \\\"Composite\\\" \\\"Enable\\\" \\n \" else - export moduleSection='Load \"glx\" \\n \\ + export moduleSection='Load \"glx\" Load \"dri\" ' export screen= export device=