# Catalog → NixOS `users.users` + Home Manager + SSH inbound.
{ self, ... }: {
  flake.nixosModules.users =
    { config, lib, ... }:
    let
      usersLib = self.lib.usersMerge lib;
      selectUsers =
        c:
        let
          uc = c.chiasson.users;
        in
        usersLib.selectedUsersAttr {
          catalog = uc.catalog;
          enabled = uc.enabled;
          hostOverrides = uc.hostOverrides;
        };
    in
    {
      imports = [
        self.nixosModules.sshInbound
        self.nixosModules.usersCatalogOptions
        self.nixosModules.usersCatalogDefaults
        { _module.args = { inherit self usersLib selectUsers; }; }
        self.nixosModules.usersHomeIntegration
      ];
    };
}
