{
  inputs,
  outputs,
  lib,
  config,
  ...
}: let
  inherit (lib) mkEnableOption mkIf;
  cfg = config.horseman.users.default;
  username = config.horseman.username;
  stateVersion = config.horseman.stateVersion;
in {
  options = {
    horseman.users.default = {
      enable = mkEnableOption "Default user";
    };
  };

  config = mkIf cfg.enable {
    home-manager = {
      extraSpecialArgs = {inherit inputs outputs;};
      users.${username} = {
        home = {
          username = username;
          homeDirectory = "/home/${username}";
          stateVersion = stateVersion;
        };

        programs = {
          home-manager.enable = true;

          gh.enable = true;
          git = {
            enable = true;
            settings = {
              init = {
                defaultBranch = "main";
              };

              user = {
                name = "KoenDR06";
                email = "koen.de.ruiter@hotmail.com";
              };
            };
          };
        };
      };
    };

    users.users.${username} = {
      initialPassword = "1234";
      isNormalUser = true;
      openssh.authorizedKeys.keys = [
        "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPpt0NisTZPYDdumMXhxaKv3JygSE0EKE6OiYw4A8ot7"
      ];
      extraGroups = [
        "wheel"
      ];
    };
  };
}
