<commit_before>{ config, pkgs, ... }:

with pkgs.lib;

let

  dmcfg = config.services.xserver.displayManager;
  cfg = dmcfg.auto;

in

{

  ###### interface

  options = {

    services.xserver.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.slim.enable = false;

    services.xserver.displayManager.job =
      { execCmd =
          ''
            exec ${pkgs.xorg.xinit}/bin/xinit \
              ${pkgs.su}/bin/su -c ${dmcfg.session.script} ${cfg.user} \
              -- ${dmcfg.xserverBin} ${dmcfg.xserverArgs}
          '';
      };

  };

}<commit_msg>auto.nix: Use SLiM to implement auto-logins<commit_after>{ config, pkgs, ... }:

with pkgs.lib;

let

  dmcfg = config.services.xserver.displayManager;
  cfg = dmcfg.auto;

in

{

  ###### interface

  options = {

    services.xserver.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.slim = {
      enable = true;
      autoLogin = true;
      defaultUser = cfg.user;
    };

  };

}
{'fraction_non_alphanumeric': 0.12186559679037111, 'fraction_numerical': 0.0, 'mean_word_length': 1.9338235294117647, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4255544', 'n_tokens_mistral': 605, 'n_tokens_neox': 574, 'n_words': 144}