add consistent buildHosts function

This commit is contained in:
Daylin Morgan 2024-02-06 09:51:21 -06:00
parent ce0fb9a689
commit b2f3077c7a
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F
2 changed files with 5 additions and 2 deletions

View file

@ -29,10 +29,10 @@
outputs = inputs @ {nixpkgs, ...}: let outputs = inputs @ {nixpkgs, ...}: let
lib = import ./lib {inherit inputs nixpkgs;}; lib = import ./lib {inherit inputs nixpkgs;};
inherit (lib) findModules mapHosts buildOizys; inherit (lib) findModules buildHosts buildOizys;
in { in {
nixosModules = findModules ./modules; nixosModules = findModules ./modules;
nixosConfigurations = mapHosts ./hosts; nixosConfigurations = buildHosts {};
packages = buildOizys {}; packages = buildOizys {};
}; };
} }

View file

@ -45,6 +45,9 @@ in rec {
(name: _: mkSystem name) (name: _: mkSystem name)
(readDir dir); (readDir dir);
buildHosts = _: mapHosts ../hosts;
findModules = modulesPath: listToAttrs (findModulesList modulesPath); findModules = modulesPath: listToAttrs (findModulesList modulesPath);
# https://github.com/balsoft/nixos-config/blob/73cc2c3a8bb62a9c3980a16ae70b2e97af6e1abd/flake.nix#L109-L120 # https://github.com/balsoft/nixos-config/blob/73cc2c3a8bb62a9c3980a16ae70b2e97af6e1abd/flake.nix#L109-L120
findModulesList = dir: findModulesList = dir: