{ config, ... }:
let
  inherit (import ../helpers.nix) directoryImport;
  modules = directoryImport ./.;
in
{
  flake.homeModules =
    let
      inherit (config.machines.devices)
        mars
        deimos
        ceres
        phobos
        eris
        nixos
        ;
      inherit (config.people)
        user0
        ;
    in
    {
      "${mars.name}-${user0}" = {
        imports = builtins.attrValues {
          inherit (modules)
            academic
            bitwarden
            brave
            claudeCode
            cli
            cyanrip
            daVinci
            element
            emote
            espanso
            feishin
            finamp
            flameshot
            floorp
            freetube
            ghostty
            gnomeCalculator
            gparted
            heroic
            imageViewing
            plasma
            ivpn
            kolourPaint
            ledger
            libreOffice
            lingot
            lutris
            mpv
            obsidian
            okular
            opencloud
            printManager
            prismLauncher
            puddleTag
            scrcpy
            sharing
            shotcut
            signal
            steam
            systemMonitor
            theming
            thunderbird
            tor
            usbImager
            vesktop
            virtManager
            vsCode
            zathura
            zed
            ;
        };
      };
      "${deimos.name}-${user0}" = {
        imports = builtins.attrValues {
          inherit (modules)
            bitwarden
            brave
            claudeCode
            cli
            dolphin
            element
            emote
            feishin
            flameshot
            floorp
            freetube
            ghostty
            gnomeCalculator
            hypr
            imageViewing
            kolourPaint
            libreOffice
            mpv
            obsStudio
            obsidian
            okular
            printManager
            scrcpy
            sharing
            signal
            steam
            systemMonitor
            theming
            thunderbird
            tor
            usbImager
            vesktop
            virtManager
            vsCode
            wayland
            zathura
            zed
            zotero
            ;
        };
      };
      "${phobos.name}-${user0}" = {
        imports = builtins.attrValues {
          inherit (modules)
            cli
            ;
        };
      };
      "${ceres.name}-${user0}" = {
        imports = builtins.attrValues {
          inherit (modules)
            cli
            ;
        };
      };
      "${eris.name}-${user0}" = {
        imports = builtins.attrValues {
          inherit (modules)
            cli
            ;
        };
      };
      "${nixos.name}-${user0}" = {
        imports = builtins.attrValues {
          inherit (modules)
            cli
            firefox
            ghostty
            ;
        };
      };

    };
}
