# Resolve `wisdom*` HM slices for NixOS `extraModules` (`self` is not an HM specialArg).
# Slices are gated by `chiasson.home.*.enable`; hosts only flip toggles in `home.nix`.
{ lib, ... }: {
  flake.lib.wisdomCatalogExtraModules =
    self:
    let
      names = lib.sort builtins.lessThan (
        lib.filter (
          n:
          lib.hasPrefix "wisdom" n
          && n != "wisdom"
          && n != "wisdomShellBash"
        ) (builtins.attrNames self.homeManagerModules)
      );
    in
    map (name: self.homeManagerModules.${name}) names;
}
