···1# Demo {#sec-profile-demo}
23This profile just enables a `demo` user, with password `demo`, uid `1000`, `wheel` group and
4-[autologin in the SDDM display manager](#opt-services.xserver.displayManager.autoLogin).
···1# Demo {#sec-profile-demo}
23This profile just enables a `demo` user, with password `demo`, uid `1000`, `wheel` group and
4+[autologin in the SDDM display manager](#opt-services.displayManager.autoLogin).
···4graphical installation CD.
56It sets [](#opt-services.xserver.enable),
7-[](#opt-services.xserver.displayManager.sddm.enable),
8[](#opt-services.xserver.desktopManager.plasma5.enable),
9and [](#opt-services.xserver.libinput.enable) to true. It also
10includes glxinfo and firefox in the system packages list.
···4graphical installation CD.
56It sets [](#opt-services.xserver.enable),
7+[](#opt-services.displayManager.sddm.enable),
8[](#opt-services.xserver.desktopManager.plasma5.enable),
9and [](#opt-services.xserver.libinput.enable) to true. It also
10includes glxinfo and firefox in the system packages list.
···40 # If you prefer another desktop manager or display manager, you may want
41 # to disable the default.
42 # services.xserver.desktopManager.plasma5.enable = lib.mkForce false;
43- # services.xserver.displayManager.sddm.enable = lib.mkForce false;
4445 # Enable GDM/GNOME by uncommenting above two lines and two lines below.
46 # services.xserver.displayManager.gdm.enable = true;
···40 # If you prefer another desktop manager or display manager, you may want
41 # to disable the default.
42 # services.xserver.desktopManager.plasma5.enable = lib.mkForce false;
43+ # services.displayManager.sddm.enable = lib.mkForce false;
4445 # Enable GDM/GNOME by uncommenting above two lines and two lines below.
46 # services.xserver.displayManager.gdm.enable = true;
···71 programs.xwayland.enable = lib.mkDefault true;
7273 # To make the Miriway session available if a display manager like SDDM is enabled:
74- services.xserver.displayManager.sessionPackages = [ pkgs.miriway ];
75 };
7677 meta.maintainers = with lib.maintainers; [ OPNA2608 ];
···71 programs.xwayland.enable = lib.mkDefault true;
7273 # To make the Miriway session available if a display manager like SDDM is enabled:
74+ services.displayManager.sessionPackages = [ pkgs.miriway ];
75 };
7677 meta.maintainers = with lib.maintainers; [ OPNA2608 ];
+1-1
nixos/modules/programs/steam.nix
···161 };
162163 programs.gamescope.enable = mkDefault cfg.gamescopeSession.enable;
164- services.xserver.displayManager.sessionPackages = mkIf cfg.gamescopeSession.enable [ gamescopeSessionFile ];
165166 # optionally enable 32bit pulseaudio support if pulseaudio is enabled
167 hardware.pulseaudio.support32Bit = config.hardware.pulseaudio.enable;
···161 };
162163 programs.gamescope.enable = mkDefault cfg.gamescopeSession.enable;
164+ services.displayManager.sessionPackages = mkIf cfg.gamescopeSession.enable [ gamescopeSessionFile ];
165166 # optionally enable 32bit pulseaudio support if pulseaudio is enabled
167 hardware.pulseaudio.support32Bit = config.hardware.pulseaudio.enable;
+1-1
nixos/modules/programs/wayland/cardboard.nix
···17 environment.systemPackages = [ cfg.package ];
1819 # To make a cardboard session available for certain DMs like SDDM
20- services.xserver.displayManager.sessionPackages = [ cfg.package ];
21 }
22 (import ./wayland-session.nix { inherit lib pkgs; })
23 ]);
···17 environment.systemPackages = [ cfg.package ];
1819 # To make a cardboard session available for certain DMs like SDDM
20+ services.displayManager.sessionPackages = [ cfg.package ];
21 }
22 (import ./wayland-session.nix { inherit lib pkgs; })
23 ]);
···93 The services.xserver.displayManager.auto module has been removed
94 because it was only intended for use in internal NixOS tests, and gave the
95 false impression of it being a special display manager when it's actually
96- LightDM. Please use the services.xserver.displayManager.autoLogin options
97 instead, or any other display manager in NixOS as they all support auto-login.
98 '')
99 (mkRemovedOptionModule [ "services" "xserver" "multitouch" ] ''
···93 The services.xserver.displayManager.auto module has been removed
94 because it was only intended for use in internal NixOS tests, and gave the
95 false impression of it being a special display manager when it's actually
96+ LightDM. Please use the services.displayManager.autoLogin options
97 instead, or any other display manager in NixOS as they all support auto-login.
98 '')
99 (mkRemovedOptionModule [ "services" "xserver" "multitouch" ] ''
···96 pkgs.pantheon.pantheon-agent-geoclue2
97 ] config.environment.pantheon.excludePackages;
9899- services.xserver.displayManager.sessionPackages = [ pkgs.pantheon.elementary-session-settings ];
100101 # Ensure lightdm is used when Pantheon is enabled
102 # Without it screen locking will be nonfunctional because of the use of lightlocker
···109110 # Without this, elementary LightDM greeter will pre-select non-existent `default` session
111 # https://github.com/elementary/greeter/issues/368
112- services.xserver.displayManager.defaultSession = mkDefault "pantheon";
113114 services.xserver.displayManager.sessionCommands = ''
115 if test "$XDG_CURRENT_DESKTOP" = "Pantheon"; then
···96 pkgs.pantheon.pantheon-agent-geoclue2
97 ] config.environment.pantheon.excludePackages;
9899+ services.displayManager.sessionPackages = [ pkgs.pantheon.elementary-session-settings ];
100101 # Ensure lightdm is used when Pantheon is enabled
102 # Without it screen locking will be nonfunctional because of the use of lightlocker
···109110 # Without this, elementary LightDM greeter will pre-select non-existent `default` session
111 # https://github.com/elementary/greeter/issues/368
112+ services.displayManager.defaultSession = mkDefault "pantheon";
113114 services.xserver.displayManager.sessionCommands = ''
115 if test "$XDG_CURRENT_DESKTOP" = "Pantheon"; then
···6061 Note that this greeter starts only the default X session.
62 You can configure the default X session using
63- [](#opt-services.xserver.displayManager.defaultSession).
64 '';
65 };
66
···6061 Note that this greeter starts only the default X session.
62 You can configure the default X session using
63+ [](#opt-services.displayManager.defaultSession).
64 '';
65 };
66
···2223 Note that this greeter starts only the default X session.
24 You can configure the default X session using
25- [](#opt-services.xserver.displayManager.defaultSession).
26 '';
27 };
28···81 {
82 assertion = dmcfg.defaultSession != null;
83 message = ''
84- Please set: services.xserver.displayManager.defaultSession
85 '';
86 }
87 ];
···2223 Note that this greeter starts only the default X session.
24 You can configure the default X session using
25+ [](#opt-services.displayManager.defaultSession).
26 '';
27 };
28···81 {
82 assertion = dmcfg.defaultSession != null;
83 message = ''
84+ Please set: services.displayManager.defaultSession
85 '';
86 }
87 ];
···639 ###### implementation
640641 config = mkIf cfg.enable {
0642643 services.xserver.displayManager.lightdm.enable =
644 let dmConf = cfg.displayManager;
645 default = !(dmConf.gdm.enable
646- || dmConf.sddm.enable
647 || dmConf.xpra.enable
648 || dmConf.sx.enable
649 || dmConf.startx.enable
650 || config.services.greetd.enable);
651 in mkIf (default) (mkDefault true);
652-653- # so that the service won't be enabled when only startx is used
654- systemd.services.display-manager.enable =
655- let dmConf = cfg.displayManager;
656- noDmUsed = !(dmConf.gdm.enable
657- || dmConf.sddm.enable
658- || dmConf.xpra.enable
659- || dmConf.lightdm.enable);
660- in mkIf (noDmUsed) (mkDefault false);
661-662- hardware.opengl.enable = mkDefault true;
663664 services.xserver.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ];
665···694 # -xkbdir command line option does not seems to be passed to xkbcomp.
695 "X11/xkb".source = "${cfg.xkb.dir}";
696 })
697- # localectl looks into 00-keyboard.conf
698- //{
699- "X11/xorg.conf.d/00-keyboard.conf".text = ''
700- Section "InputClass"
701- Identifier "Keyboard catchall"
702- MatchIsKeyboard "on"
703- Option "XkbModel" "${cfg.xkb.model}"
704- Option "XkbLayout" "${cfg.xkb.layout}"
705- Option "XkbOptions" "${cfg.xkb.options}"
706- Option "XkbVariant" "${cfg.xkb.variant}"
707- EndSection
708- '';
709- }
710 # Needed since 1.18; see https://bugs.freedesktop.org/show_bug.cgi?id=89023#c5
711 // (let cfgPath = "X11/xorg.conf.d/10-evdev.conf"; in
712 {
···726 xorg.xprop
727 xorg.xauth
728 pkgs.xterm
729- pkgs.xdg-utils
730 xorg.xf86inputevdev.out # get evdev.4 man page
731- pkgs.nixos-icons # needed for gnome and pantheon about dialog, nixos-manual and maybe more
732 ] config.services.xserver.excludePackages
733 ++ optional (elem "virtualbox" cfg.videoDrivers) xorg.xrefresh;
734735 environment.pathsToLink = [ "/share/X11" ];
736737- xdg = {
738- autostart.enable = true;
739- menus.enable = true;
740- mime.enable = true;
741- icons.enable = true;
742- };
743-744- # The default max inotify watches is 8192.
745- # Nowadays most apps require a good number of inotify watches,
746- # the value below is used by default on several other distros.
747- boot.kernel.sysctl."fs.inotify.max_user_instances" = mkDefault 524288;
748- boot.kernel.sysctl."fs.inotify.max_user_watches" = mkDefault 524288;
749-750- programs.gnupg.agent.pinentryPackage = lib.mkOverride 1100 pkgs.pinentry-gnome3;
751-752- systemd.defaultUnit = mkIf cfg.autorun "graphical.target";
753-754 systemd.services.display-manager =
755 { description = "Display Manager";
756···761 environment =
762 optionalAttrs config.hardware.opengl.setLdLibraryPath
763 { LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.addOpenGLRunpath.driverLink ]; }
764- // cfg.displayManager.job.environment;
765766 preStart =
767 ''
768- ${cfg.displayManager.job.preStart}
769770 rm -f /tmp/.X0-lock
771 '';
772773 # TODO: move declaring the systemd service to its own mkIf
774- script = mkIf (config.systemd.services.display-manager.enable == true) "${cfg.displayManager.job.execCmd}";
775776 # Stop restarting if the display manager stops (crashes) 2 times
777 # in one minute. Starting X typically takes 3-4s.
···910 ${cfg.extraConfig}
911 '';
912913- fonts.enableDefaultPackages = mkDefault true;
914 fonts.packages = [
915 (if cfg.upscaleDefaultCursor then fontcursormisc_hidpi else pkgs.xorg.fontcursormisc)
916 pkgs.xorg.fontmiscmisc
···639 ###### implementation
640641 config = mkIf cfg.enable {
642+ services.displayManager.enable = true;
643644 services.xserver.displayManager.lightdm.enable =
645 let dmConf = cfg.displayManager;
646 default = !(dmConf.gdm.enable
647+ || config.services.displayManager.sddm.enable
648 || dmConf.xpra.enable
649 || dmConf.sx.enable
650 || dmConf.startx.enable
651 || config.services.greetd.enable);
652 in mkIf (default) (mkDefault true);
00000000000653654 services.xserver.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ];
655···684 # -xkbdir command line option does not seems to be passed to xkbcomp.
685 "X11/xkb".source = "${cfg.xkb.dir}";
686 })
0000000000000687 # Needed since 1.18; see https://bugs.freedesktop.org/show_bug.cgi?id=89023#c5
688 // (let cfgPath = "X11/xorg.conf.d/10-evdev.conf"; in
689 {
···703 xorg.xprop
704 xorg.xauth
705 pkgs.xterm
0706 xorg.xf86inputevdev.out # get evdev.4 man page
0707 ] config.services.xserver.excludePackages
708 ++ optional (elem "virtualbox" cfg.videoDrivers) xorg.xrefresh;
709710 environment.pathsToLink = [ "/share/X11" ];
71100000000000000000712 systemd.services.display-manager =
713 { description = "Display Manager";
714···719 environment =
720 optionalAttrs config.hardware.opengl.setLdLibraryPath
721 { LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.addOpenGLRunpath.driverLink ]; }
722+ // config.services.displayManager.environment;
723724 preStart =
725 ''
726+ ${config.services.displayManager.preStart}
727728 rm -f /tmp/.X0-lock
729 '';
730731 # TODO: move declaring the systemd service to its own mkIf
732+ script = mkIf (config.systemd.services.display-manager.enable == true) "${config.services.displayManager.execCmd}";
733734 # Stop restarting if the display manager stops (crashes) 2 times
735 # in one minute. Starting X typically takes 3-4s.
···868 ${cfg.extraConfig}
869 '';
8700871 fonts.packages = [
872 (if cfg.upscaleDefaultCursor then fontcursormisc_hidpi else pkgs.xorg.fontcursormisc)
873 pkgs.xorg.fontmiscmisc
+1-1
nixos/modules/testing/test-instrumentation.nix
···216 # uses credentials to set passwords on users.
217 users.users.root.hashedPasswordFile = mkOverride 150 "${pkgs.writeText "hashed-password.root" ""}";
218219- services.xserver.displayManager.job.logToJournal = true;
220221 # Make sure we use the Guest Agent from the QEMU package for testing
222 # to reduce the closure size required for the tests.
···216 # uses credentials to set passwords on users.
217 users.users.root.hashedPasswordFile = mkOverride 150 "${pkgs.writeText "hashed-password.root" ""}";
218219+ services.displayManager.logToJournal = true;
220221 # Make sure we use the Guest Agent from the QEMU package for testing
222 # to reduce the closure size required for the tests.
···30 ###### implementation
3132 config = lib.mkIf cfg.enable {
33- services.xserver.displayManager = {
34- lightdm.enable = true;
35- autoLogin = {
36- enable = true;
37- user = cfg.user;
38- };
39 };
4041 # lightdm by default doesn't allow auto login for root, which is
···30 ###### implementation
3132 config = lib.mkIf cfg.enable {
33+ services.xserver.displayManager.lightdm.enable = true;
34+ services.displayManager.autoLogin = {
35+ enable = true;
36+ user = cfg.user;
0037 };
3839 # lightdm by default doesn't allow auto login for root, which is
+1-1
nixos/tests/common/x11.nix
···1213 # Use IceWM as the window manager.
14 # Don't use a desktop manager.
15- services.xserver.displayManager.defaultSession = lib.mkDefault "none+icewm";
16 services.xserver.windowManager.icewm.enable = true;
17}
···1213 # Use IceWM as the window manager.
14 # Don't use a desktop manager.
15+ services.displayManager.defaultSession = lib.mkDefault "none+icewm";
16 services.xserver.windowManager.icewm.enable = true;
17}