mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 12:53:59 +03:00
nixos gdm: support autologin
This commit is contained in:
parent
52d7550da3
commit
6eb096900f
@ -18,14 +18,42 @@ in
|
|||||||
|
|
||||||
services.xserver.displayManager.gdm = {
|
services.xserver.displayManager.gdm = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkEnableOption ''
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
description = ''
|
|
||||||
Whether to enable GDM as the display manager.
|
Whether to enable GDM as the display manager.
|
||||||
<emphasis>GDM is very experimental and may render system unusable.</emphasis>
|
<emphasis>GDM is very experimental and may render system unusable.</emphasis>
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
autoLogin = mkOption {
|
||||||
|
default = {};
|
||||||
|
|
||||||
|
type = types.submodule {
|
||||||
|
options = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Automatically log in as the sepecified <option>auto.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.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -71,6 +99,25 @@ in
|
|||||||
|
|
||||||
programs.dconf.profiles.gdm = "${gdm}/share/dconf/profile/gdm";
|
programs.dconf.profiles.gdm = "${gdm}/share/dconf/profile/gdm";
|
||||||
|
|
||||||
|
environment.etc."gdm/custom.conf".text = ''
|
||||||
|
[daemon]
|
||||||
|
${optionalString cfg.gdm.autoLogin.enable ''
|
||||||
|
TimedLoginEnable=true
|
||||||
|
TimedLogin=${cfg.gdm.autoLogin.user}
|
||||||
|
TimedLoginDelay=${toString cfg.gdm.autoLogin.delay}
|
||||||
|
''}
|
||||||
|
|
||||||
|
[security]
|
||||||
|
|
||||||
|
[xdmcp]
|
||||||
|
|
||||||
|
[greeter]
|
||||||
|
|
||||||
|
[chooser]
|
||||||
|
|
||||||
|
[debug]
|
||||||
|
'';
|
||||||
|
|
||||||
# GDM LFS PAM modules, adapted somehow to NixOS
|
# GDM LFS PAM modules, adapted somehow to NixOS
|
||||||
security.pam.services = {
|
security.pam.services = {
|
||||||
gdm-launch-environment.text = ''
|
gdm-launch-environment.text = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user