aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/services/x11/display-managers/gdm.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/services/x11/display-managers/gdm.nix')
-rw-r--r--nixpkgs/nixos/modules/services/x11/display-managers/gdm.nix74
1 files changed, 26 insertions, 48 deletions
diff --git a/nixpkgs/nixos/modules/services/x11/display-managers/gdm.nix b/nixpkgs/nixos/modules/services/x11/display-managers/gdm.nix
index 622ea62f3a9..eae70a57c78 100644
--- a/nixpkgs/nixos/modules/services/x11/display-managers/gdm.nix
+++ b/nixpkgs/nixos/modules/services/x11/display-managers/gdm.nix
@@ -37,6 +37,22 @@ let
in
{
+ imports = [
+ (mkRenamedOptionModule [ "services" "xserver" "displayManager" "gdm" "autoLogin" "enable" ] [
+ "services"
+ "xserver"
+ "displayManager"
+ "autoLogin"
+ "enable"
+ ])
+ (mkRenamedOptionModule [ "services" "xserver" "displayManager" "gdm" "autoLogin" "user" ] [
+ "services"
+ "xserver"
+ "displayManager"
+ "autoLogin"
+ "user"
+ ])
+ ];
meta = {
maintainers = teams.gnome.members;
@@ -48,48 +64,17 @@ in
services.xserver.displayManager.gdm = {
- enable = mkEnableOption ''
- GDM, the GNOME Display Manager
- '';
+ enable = mkEnableOption "GDM, the GNOME Display Manager";
- debug = mkEnableOption ''
- debugging messages in GDM
- '';
+ debug = mkEnableOption "debugging messages in GDM";
- autoLogin = mkOption {
- default = {};
+ # Auto login options specific to GDM
+ autoLogin.delay = mkOption {
+ type = types.int;
+ default = 0;
description = ''
- Auto login configuration attrset.
+ Seconds of inactivity after which the autologin will be performed.
'';
-
- type = types.submodule {
- options = {
- enable = mkOption {
- type = types.bool;
- default = false;
- description = ''
- Automatically log in as the sepecified <option>autoLogin.user</option>.
- '';
- };
-
- user = mkOption {
- type = types.nullOr types.str;
- default = null;
- description = ''
- User to be used for the autologin.
- '';
- };
-
- delay = mkOption {
- type = types.int;
- default = 0;
- description = ''
- Seconds of inactivity after which the autologin will be performed.
- '';
- };
-
- };
- };
};
wayland = mkOption {
@@ -128,12 +113,6 @@ in
config = mkIf cfg.gdm.enable {
- assertions = [
- { assertion = cfg.gdm.autoLogin.enable -> cfg.gdm.autoLogin.user != null;
- message = "GDM auto-login requires services.xserver.displayManager.gdm.autoLogin.user to be set";
- }
- ];
-
services.xserver.displayManager.lightdm.enable = false;
users.users.gdm =
@@ -217,7 +196,6 @@ in
KillMode = "mixed";
IgnoreSIGPIPE = "no";
BusName = "org.gnome.DisplayManager";
- StandardOutput = "syslog";
StandardError = "inherit";
ExecReload = "${pkgs.coreutils}/bin/kill -SIGHUP $MAINPID";
KeyringMode = "shared";
@@ -287,14 +265,14 @@ in
environment.etc."gdm/custom.conf".text = ''
[daemon]
WaylandEnable=${if cfg.gdm.wayland then "true" else "false"}
- ${optionalString cfg.gdm.autoLogin.enable (
+ ${optionalString cfg.autoLogin.enable (
if cfg.gdm.autoLogin.delay > 0 then ''
TimedLoginEnable=true
- TimedLogin=${cfg.gdm.autoLogin.user}
+ TimedLogin=${cfg.autoLogin.user}
TimedLoginDelay=${toString cfg.gdm.autoLogin.delay}
'' else ''
AutomaticLoginEnable=true
- AutomaticLogin=${cfg.gdm.autoLogin.user}
+ AutomaticLogin=${cfg.autoLogin.user}
'')
}