1{ config, lib, pkgs, ... }: 2 3with lib; 4 5let 6 7 dmcfg = config.services.xserver.displayManager; 8 cfg = dmcfg.auto; 9 10in 11 12{ 13 14 ###### interface 15 16 options = { 17 18 services.xserver.displayManager.auto = { 19 20 enable = mkOption { 21 default = false; 22 description = '' 23 Whether to enable the fake "auto" display manager, which 24 automatically logs in the user specified in the 25 <option>user</option> option. This is mostly useful for 26 automated tests. 27 ''; 28 }; 29 30 user = mkOption { 31 default = "root"; 32 description = "The user account to login automatically."; 33 }; 34 35 }; 36 37 }; 38 39 40 ###### implementation 41 42 config = mkIf cfg.enable { 43 44 services.xserver.displayManager.slim = { 45 enable = true; 46 autoLogin = true; 47 defaultUser = cfg.user; 48 }; 49 50 }; 51 52}