From a92c024c7f86248e1e5f27e87da6c433d217069c Mon Sep 17 00:00:00 2001 From: Benno Fünfstück Date: Sat, 17 Oct 2015 19:11:22 +0200 Subject: sddm: allow extra config options --- nixos/modules/services/x11/display-managers/sddm.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'nixos/modules/services/x11/display-managers') diff --git a/nixos/modules/services/x11/display-managers/sddm.nix b/nixos/modules/services/x11/display-managers/sddm.nix index c44383cc6117..4594155ea134 100644 --- a/nixos/modules/services/x11/display-managers/sddm.nix +++ b/nixos/modules/services/x11/display-managers/sddm.nix @@ -35,6 +35,8 @@ let SessionCommand=${dmcfg.session.script} SessionDir=${dmcfg.session.desktops} XauthPath=${pkgs.xorg.xauth}/bin/xauth + + ${cfg.extraConfig} ''; in @@ -50,6 +52,19 @@ in ''; }; + extraConfig = mkOption { + type = types.str; + default = ""; + example = '' + [Autologin] + User=john + Session=plasma.desktop + ''; + description = '' + Extra lines appended to the configuration of SDDM. + ''; + }; + theme = mkOption { type = types.str; default = "maui"; -- cgit 1.4.1 From d767aae72179d0e323584d5c4811be1f408d45ee Mon Sep 17 00:00:00 2001 From: Benno Fünfstück Date: Sat, 31 Oct 2015 16:03:01 +0100 Subject: sddm module: support autologin configuration --- .../modules/services/x11/display-managers/sddm.nix | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) (limited to 'nixos/modules/services/x11/display-managers') diff --git a/nixos/modules/services/x11/display-managers/sddm.nix b/nixos/modules/services/x11/display-managers/sddm.nix index 4594155ea134..5ca3a44324f6 100644 --- a/nixos/modules/services/x11/display-managers/sddm.nix +++ b/nixos/modules/services/x11/display-managers/sddm.nix @@ -36,9 +36,22 @@ let SessionDir=${dmcfg.session.desktops} XauthPath=${pkgs.xorg.xauth}/bin/xauth + ${optionalString cfg.autoLogin.enable '' + [Autologin] + User=${cfg.autoLogin.user} + Session=${defaultSessionName}.desktop + Relogin=${if cfg.autoLogin.relogin then "true" else "false"} + ''} + ${cfg.extraConfig} ''; + defaultSessionName = + let + dm = xcfg.desktopManager.default; + wm = xcfg.windowManager.default; + in dm + optionalString (wm != "none") (" + " + wm); + in { options = { @@ -72,12 +85,62 @@ in Greeter theme to use. ''; }; + + autoLogin = mkOption { + default = {}; + description = '' + Configuration for automatic login. + ''; + + type = types.submodule { + options = { + enable = mkOption { + type = types.bool; + default = false; + description = '' + Automatically log in as the sepecified . + ''; + }; + + user = mkOption { + type = types.nullOr types.str; + default = null; + description = '' + User to be used for the autologin. + ''; + }; + + relogin = mkOption { + type = types.bool; + default = false; + description = '' + If true automatic login will kick in again on session exit, otherwise it + will work only the first time. + ''; + }; + }; + }; + }; + }; }; config = mkIf cfg.enable { + assertions = [ + { assertion = cfg.autoLogin.enable -> cfg.autoLogin.user != null; + message = "SDDM auto-login requires services.xserver.displayManager.sddm.autoLogin.user to be set"; + } + { assertion = cfg.autoLogin.enable -> elem defaultSessionName dmcfg.session.names; + message = '' + SDDM auto-login requires that services.xserver.desktopManager.default and + services.xserver.windowMananger.default are set to valid values. The current + default session: ${defaultSessionName} is not valid. + ''; + } + ]; + services.xserver.displayManager.slim.enable = false; services.xserver.displayManager.job = { @@ -108,6 +171,18 @@ in session optional pam_keyinit.so force revoke session optional pam_permit.so ''; + + sddm-autologin.text = '' + auth requisite pam_nologin.so + auth required pam_succeed_if.so uid >= 1000 quiet + auth required pam_permit.so + + account include sddm + + password include sddm + + session include sddm + ''; }; users.extraUsers.sddm = { -- cgit 1.4.1 From 225642e25a89db9bc9a85d719fe2aab1d30f913f Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 10 Nov 2015 21:52:47 -0800 Subject: Update comment for gdm service. Emphasize experimental nature slightly less, but say it's only really tested with Gnome. --- nixos/modules/services/x11/display-managers/gdm.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nixos/modules/services/x11/display-managers') diff --git a/nixos/modules/services/x11/display-managers/gdm.nix b/nixos/modules/services/x11/display-managers/gdm.nix index c9a563768323..58eb6f050131 100644 --- a/nixos/modules/services/x11/display-managers/gdm.nix +++ b/nixos/modules/services/x11/display-managers/gdm.nix @@ -20,7 +20,9 @@ in enable = mkEnableOption '' GDM as the display manager. - GDM is very experimental and may render system unusable. + GDM in NixOS is not well-tested with desktops other + than GNOME, so use with caution, as it could render the + system unusable. ''; debug = mkEnableOption '' -- cgit 1.4.1