{ self, inputs, lib, config, ... }: let inherit (lib) mapAttrs; inherit (config.nex.lib) readModules; systemModules = readModules (self + "/system-modules"); systemConfigs = lib.filterAttrs (name: val: val.systemManager != null) config.hosts; in { options = { nex = { systemConfigs = lib.mkOption { type = lib.types.attrs; default = {}; }; systemModules = lib.mkOption { type = lib.types.attrs; default = {}; }; }; }; config = { nex = { inherit systemModules systemConfigs; }; flake = { systemConfigs = mapAttrs ( name: systemConfig: inputs.system-manager.lib.makeSystemConfig { modules = [ config.nex.systemModules.default systemConfig.systemManager ]; extraSpecialArgs = { inherit (config.nex) systemModules; }; } ) config.nex.systemConfigs; }; }; }