From dab6bbe3a691cafac994e1782d9141ddd1861f1b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 19 Jun 2012 14:51:04 -0400 Subject: [PATCH] Set the default unit to "graphical.target" if X11 is enabled --- modules/services/x11/xserver.nix | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/services/x11/xserver.nix b/modules/services/x11/xserver.nix index 2ae42f5b41be..61af0459a6bd 100644 --- a/modules/services/x11/xserver.nix +++ b/modules/services/x11/xserver.nix @@ -377,15 +377,13 @@ in environment.pathsToLink = [ "/etc/xdg" "/share/xdg" "/share/applications" "/share/icons" "/share/pixmaps" ]; - jobs."xserver-start-check" = - { startOn = if cfg.autorun then "filesystem and stopped udevtrigger" else ""; - stopOn = ""; - task = true; - script = "grep -qv noX11 /proc/cmdline && start xserver || true"; - }; + boot.systemd.defaultUnit = mkIf cfg.autorun "graphical.target"; - jobs.xserver = - { restartIfChanged = false; + boot.systemd.services."xserver.service" = + { wantedBy = [ "graphical.target" ]; + after = [ "systemd-udev-settle.service" ]; + + #restartIfChanged = false; environment = { FONTCONFIG_FILE = "/etc/fonts/fonts.conf"; # !!! cleanup