{ lib, inputs, self, }: let # TODO: refactor the registry code registryAssembly = import ./registry.nix { inherit lib self; }; # TODO: remove this after the refactor of this file is done and clean util = import ../lib { inherit lib; }; mkModules = import ./modules.nix { inherit util; }; modules = mkModules { root = self + "/modules"; }; repositoryModules = modules; guestFiles = util.collectNixFiles (self + "/guests"); collectedRegistry = registryAssembly.collect { hosts = self.nixosConfigurations; }; specialArgs = { inherit flake inputs self ; registry = collectedRegistry; }; flake = { inherit (hosts) mkHosts; inherit (guests) mkGuest; inherit util; }; guests = import ./guests.nix { inherit inputs lib self specialArgs repositoryModules registryAssembly util ; }; hosts = import ./hosts.nix { inherit inputs lib self specialArgs repositoryModules guestFiles registryAssembly ; }; in flake