Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/sddm: allow running on wayland without xserver enabled #291913

Merged
merged 5 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nixos/doc/manual/configuration/modularity.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Here, we include two modules from the same directory, `vpn.nix` and
{ config, pkgs, ... }:
{ services.xserver.enable = true;
services.xserver.displayManager.sddm.enable = true;
services.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
environment.systemPackages = [ pkgs.vim ];
}
Expand Down
2 changes: 1 addition & 1 deletion nixos/doc/manual/configuration/profiles/demo.section.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Demo {#sec-profile-demo}

This profile just enables a `demo` user, with password `demo`, uid `1000`, `wheel` group and
[autologin in the SDDM display manager](#opt-services.xserver.displayManager.autoLogin).
[autologin in the SDDM display manager](#opt-services.displayManager.autoLogin).
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Defines a NixOS configuration with the Plasma 5 desktop. It's used by the
graphical installation CD.

It sets [](#opt-services.xserver.enable),
[](#opt-services.xserver.displayManager.sddm.enable),
[](#opt-services.displayManager.sddm.enable),
[](#opt-services.xserver.desktopManager.plasma5.enable),
and [](#opt-services.xserver.libinput.enable) to true. It also
includes glxinfo and firefox in the system packages list.
8 changes: 4 additions & 4 deletions nixos/doc/manual/configuration/x-windows.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ alternative one by picking one of the following lines:

```nix
{
services.xserver.displayManager.sddm.enable = true;
services.displayManager.sddm.enable = true;
services.xserver.displayManager.gdm.enable = true;
}
```
Expand Down Expand Up @@ -99,7 +99,7 @@ your window manager, you'd define:

```nix
{
services.xserver.displayManager.defaultSession = "none+i3";
services.displayManager.defaultSession = "none+i3";
}
```

Expand All @@ -109,8 +109,8 @@ using lightdm for a user `alice`:
```nix
{
services.xserver.displayManager.lightdm.enable = true;
services.xserver.displayManager.autoLogin.enable = true;
services.xserver.displayManager.autoLogin.user = "alice";
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "alice";
}
```

Expand Down
2 changes: 1 addition & 1 deletion nixos/doc/manual/configuration/xfce.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ To enable the Xfce Desktop Environment, set
```nix
{
services.xserver.desktopManager.xfce.enable = true;
services.xserver.displayManager.defaultSession = "xfce";
services.displayManager.defaultSession = "xfce";
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,19 @@
QT_QPA_PLATFORM = "$([[ $XDG_SESSION_TYPE = \"wayland\" ]] && echo \"wayland\")";
};

services.xserver.displayManager = {
gdm = {
enable = true;
# autoSuspend makes the machine automatically suspend after inactivity.
# It's possible someone could/try to ssh'd into the machine and obviously
# have issues because it's inactive.
# See:
# * https://github.com/NixOS/nixpkgs/pull/63790
# * https://gitlab.gnome.org/GNOME/gnome-control-center/issues/22
autoSuspend = false;
};
autoLogin = {
enable = true;
user = "nixos";
};
services.xserver.displayManager.gdm = {
enable = true;
# autoSuspend makes the machine automatically suspend after inactivity.
# It's possible someone could/try to ssh'd into the machine and obviously
# have issues because it's inactive.
# See:
# * https://github.com/NixOS/nixpkgs/pull/63790
# * https://gitlab.gnome.org/GNOME/gnome-control-center/issues/22
autoSuspend = false;
};

services.displayManager.autoLogin = {
enable = true;
user = "nixos";
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@

isoImage.edition = "plasma5";

services.xserver = {
desktopManager.plasma5 = {
enable = true;
};
services.xserver.desktopManager.plasma5 = {
enable = true;
};

# Automatically login as nixos.
displayManager = {
sddm.enable = true;
autoLogin = {
enable = true;
user = "nixos";
};
# Automatically login as nixos.
services.displayManager = {
sddm.enable = true;
autoLogin = {
enable = true;
user = "nixos";
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@

isoImage.edition = "plasma6";

services.xserver = {
desktopManager.plasma6.enable = true;

# Automatically login as nixos.
displayManager = {
sddm.enable = true;
autoLogin = {
enable = true;
user = "nixos";
};
services.desktopManager.plasma6.enable = true;

# Automatically login as nixos.
services.displayManager = {
sddm.enable = true;
autoLogin = {
enable = true;
user = "nixos";
};
};

Expand Down
28 changes: 13 additions & 15 deletions nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,19 @@
enable = true;
};

services.xserver.displayManager = {
gdm = {
enable = true;
# autoSuspend makes the machine automatically suspend after inactivity.
# It's possible someone could/try to ssh'd into the machine and obviously
# have issues because it's inactive.
# See:
# * https://github.com/NixOS/nixpkgs/pull/63790
# * https://gitlab.gnome.org/GNOME/gnome-control-center/issues/22
autoSuspend = false;
};
autoLogin = {
enable = true;
user = "nixos";
};
services.xserver.displayManager.gdm = {
enable = true;
# autoSuspend makes the machine automatically suspend after inactivity.
# It's possible someone could/try to ssh'd into the machine and obviously
# have issues because it's inactive.
# See:
# * https://github.com/NixOS/nixpkgs/pull/63790
# * https://gitlab.gnome.org/GNOME/gnome-control-center/issues/22
autoSuspend = false;
};

services.displayManager.autoLogin = {
enable = true;
user = "nixos";
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@

isoImage.edition = "plasma5";

services.xserver = {
desktopManager.plasma5 = {
enable = true;
};
services.xserver.desktopManager.plasma5 = {
enable = true;
};

# Automatically login as nixos.
displayManager = {
sddm.enable = true;
autoLogin = {
enable = true;
user = "nixos";
};
# Automatically login as nixos.
services.displayManager = {
sddm.enable = true;
autoLogin = {
enable = true;
user = "nixos";
};
};

Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/installer/virtualbox-demo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ with lib;
# If you prefer another desktop manager or display manager, you may want
# to disable the default.
# services.xserver.desktopManager.plasma5.enable = lib.mkForce false;
# services.xserver.displayManager.sddm.enable = lib.mkForce false;
# services.displayManager.sddm.enable = lib.mkForce false;
# Enable GDM/GNOME by uncommenting above two lines and two lines below.
# services.xserver.displayManager.gdm.enable = true;
Expand Down
4 changes: 3 additions & 1 deletion nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,9 @@
./services/development/nixseparatedebuginfod.nix
./services/development/rstudio-server/default.nix
./services/development/zammad.nix
./services/display-managers/default.nix
./services/display-managers/greetd.nix
./services/display-managers/sddm.nix
./services/editors/emacs.nix
./services/editors/haste.nix
./services/editors/infinoted.nix
Expand Down Expand Up @@ -708,6 +710,7 @@
./services/misc/gogs.nix
./services/misc/gollum.nix
./services/misc/gpsd.nix
./services/misc/graphical-desktop.nix
./services/misc/greenclip.nix
./services/misc/guix
./services/misc/headphones.nix
Expand Down Expand Up @@ -1444,7 +1447,6 @@
./services/x11/display-managers/default.nix
./services/x11/display-managers/gdm.nix
./services/x11/display-managers/lightdm.nix
./services/x11/display-managers/sddm.nix
./services/x11/display-managers/slim.nix
./services/x11/display-managers/startx.nix
./services/x11/display-managers/sx.nix
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/miriway.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ in {
programs.xwayland.enable = lib.mkDefault true;

# To make the Miriway session available if a display manager like SDDM is enabled:
services.xserver.displayManager.sessionPackages = [ pkgs.miriway ];
services.displayManager.sessionPackages = [ pkgs.miriway ];
};

meta.maintainers = with lib.maintainers; [ OPNA2608 ];
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/steam.nix
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ in {
};

programs.gamescope.enable = mkDefault cfg.gamescopeSession.enable;
services.xserver.displayManager.sessionPackages = mkIf cfg.gamescopeSession.enable [ gamescopeSessionFile ];
services.displayManager.sessionPackages = mkIf cfg.gamescopeSession.enable [ gamescopeSessionFile ];

# optionally enable 32bit pulseaudio support if pulseaudio is enabled
hardware.pulseaudio.support32Bit = config.hardware.pulseaudio.enable;
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/wayland/cardboard.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ in
environment.systemPackages = [ cfg.package ];

# To make a cardboard session available for certain DMs like SDDM
services.xserver.displayManager.sessionPackages = [ cfg.package ];
services.displayManager.sessionPackages = [ cfg.package ];
}
(import ./wayland-session.nix { inherit lib pkgs; })
]);
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/wayland/hyprland.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ in

security.polkit.enable = true;

services.xserver.displayManager.sessionPackages = [ cfg.finalPackage ];
services.displayManager.sessionPackages = [ cfg.finalPackage ];

xdg.portal = {
enable = mkDefault true;
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/wayland/labwc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ in
xdg.portal.config.wlroots.default = lib.mkDefault [ "wlr" "gtk" ];

# To make a labwc session available for certain DMs like SDDM
services.xserver.displayManager.sessionPackages = [ cfg.package ];
services.displayManager.sessionPackages = [ cfg.package ];
}
(import ./wayland-session.nix { inherit lib pkgs; })
]);
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/wayland/river.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ in {
environment.systemPackages = optional (cfg.package != null) cfg.package ++ cfg.extraPackages;

# To make a river session available if a display manager like SDDM is enabled:
services.xserver.displayManager.sessionPackages = optionals (cfg.package != null) [ cfg.package ];
services.displayManager.sessionPackages = optionals (cfg.package != null) [ cfg.package ];

# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050913
xdg.portal.config.river.default = mkDefault [ "wlr" "gtk" ];
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/wayland/sway.nix
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ in {
xdg.portal.config.sway.default = mkDefault [ "wlr" "gtk" ];

# To make a Sway session available if a display manager like SDDM is enabled:
services.xserver.displayManager.sessionPackages = optionals (cfg.package != null) [ cfg.package ]; }
services.displayManager.sessionPackages = optionals (cfg.package != null) [ cfg.package ]; }
(import ./wayland-session.nix { inherit lib pkgs; })
]);

Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/wayland/wayfire.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ in
finalPackage
];

services.xserver.displayManager.sessionPackages = [ finalPackage ];
services.displayManager.sessionPackages = [ finalPackage ];

xdg.portal = {
enable = lib.mkDefault true;
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/rename.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ in
The services.xserver.displayManager.auto module has been removed
because it was only intended for use in internal NixOS tests, and gave the
false impression of it being a special display manager when it's actually
LightDM. Please use the services.xserver.displayManager.autoLogin options
LightDM. Please use the services.displayManager.autoLogin options
instead, or any other display manager in NixOS as they all support auto-login.
'')
(mkRemovedOptionModule [ "services" "xserver" "multitouch" ] ''
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/services/desktop-managers/plasma6.nix
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,11 @@ in {
xdg.portal.configPackages = mkDefault [kdePackages.xdg-desktop-portal-kde];
services.pipewire.enable = mkDefault true;

services.xserver.displayManager = {
services.displayManager = {
sessionPackages = [kdePackages.plasma-workspace];
defaultSession = mkDefault "plasma";
};
services.xserver.displayManager.sddm = {
services.displayManager.sddm = {
package = kdePackages.sddm;
theme = mkDefault "breeze";
wayland.compositor = "kwin";
Expand Down
Loading