{ self, extra_lib, module_args, extra_modules, special_args, nixpkgs-stable, nixpkgs-unstable, deploy-rs, system, }: let hosts = extra_lib.mkByName { useShards = false; baseDirectory = ./by-name; fileName = "configuration.nix"; }; mkNixosConfiguration = name: path: let host_file = builtins.fromTOML (builtins.readFile (path + "/../host.toml")); nixpkgs = if host_file.nixpkgs == "stable" then nixpkgs-stable else nixpkgs-unstable; in nixpkgs.lib.nixosSystem { specialArgs = special_args; modules = extra_modules ++ [ { _module.args = module_args; } path ../modules # ../modules/common ]; }; mkDeployHost = name: path: let host_file = builtins.fromTOML (builtins.readFile path + "/host.toml"); in { inherit (host_file) hostname; profiles.system = { user = "root"; path = deploy-rs.lib."${system}".activate.nixos self.nixosConfigurations."${name}"; }; }; nixosConfigurations = builtins.mapAttrs mkNixosConfiguration hosts; nodes = builtins.mapAttrs mkDeployHost hosts; in { inherit nixosConfigurations nodes; }