diff options
author | worldofpeace <worldofpeace@protonmail.ch> | 2020-01-26 17:41:19 -0500 |
---|---|---|
committer | worldofpeace <worldofpeace@protonmail.ch> | 2020-01-29 19:05:46 -0500 |
commit | c95612a5a2d4bd93011c042066c6c3deacfd436d (patch) | |
tree | 08448c24e08d760bd8a7717af60a15a0bbf7d547 /nixos/tests/common | |
parent | 7adffb14cd129e919ccba8a7a285d409065d4357 (diff) |
nixos/display-managers/auto: remove
This module allows root autoLogin, so we would break that for users, but they shouldn't be using it anyways. This gives the impression like auto is some special display manager, when it's just lightdm and special pam rules to allow root autoLogin. It was created for NixOS's testing so I believe this is where it belongs.
Diffstat (limited to 'nixos/tests/common')
-rw-r--r-- | nixos/tests/common/auto.nix | 68 | ||||
-rw-r--r-- | nixos/tests/common/x11.nix | 9 |
2 files changed, 75 insertions, 2 deletions
diff --git a/nixos/tests/common/auto.nix b/nixos/tests/common/auto.nix new file mode 100644 index 0000000000000..2c21a8d516737 --- /dev/null +++ b/nixos/tests/common/auto.nix @@ -0,0 +1,68 @@ +{ config, lib, ... }: + +with lib; + +let + + dmcfg = config.services.xserver.displayManager; + cfg = config.test-support.displayManager.auto; + +in + +{ + + ###### interface + + options = { + + test-support.displayManager.auto = { + + enable = mkOption { + default = false; + description = '' + Whether to enable the fake "auto" display manager, which + automatically logs in the user specified in the + <option>user</option> option. This is mostly useful for + automated tests. + ''; + }; + + user = mkOption { + default = "root"; + description = "The user account to login automatically."; + }; + + }; + + }; + + + ###### implementation + + config = mkIf cfg.enable { + + services.xserver.displayManager.lightdm = { + enable = true; + autoLogin = { + enable = true; + user = cfg.user; + }; + }; + + # lightdm by default doesn't allow auto login for root, which is + # required by some nixos tests. Override it here. + security.pam.services.lightdm-autologin.text = lib.mkForce '' + auth requisite pam_nologin.so + auth required pam_succeed_if.so quiet + auth required pam_permit.so + + account include lightdm + + password include lightdm + + session include lightdm + ''; + + }; + +} diff --git a/nixos/tests/common/x11.nix b/nixos/tests/common/x11.nix index 5ad0ac20fac85..0d76a0e972ff5 100644 --- a/nixos/tests/common/x11.nix +++ b/nixos/tests/common/x11.nix @@ -1,9 +1,14 @@ { lib, ... }: -{ services.xserver.enable = true; +{ + imports = [ + ./auto.nix + ]; + + services.xserver.enable = true; # Automatically log in. - services.xserver.displayManager.auto.enable = true; + test-support.displayManager.auto.enable = true; # Use IceWM as the window manager. # Don't use a desktop manager. |