From b2f3077c7a734ad66af707a7a03d050cd3fed9e8 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Tue, 6 Feb 2024 09:51:21 -0600 Subject: [PATCH] add consistent `buildHosts` function --- flake.nix | 4 ++-- lib/default.nix | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index c83f3ea..9806d28 100644 --- a/flake.nix +++ b/flake.nix @@ -29,10 +29,10 @@ outputs = inputs @ {nixpkgs, ...}: let lib = import ./lib {inherit inputs nixpkgs;}; - inherit (lib) findModules mapHosts buildOizys; + inherit (lib) findModules buildHosts buildOizys; in { nixosModules = findModules ./modules; - nixosConfigurations = mapHosts ./hosts; + nixosConfigurations = buildHosts {}; packages = buildOizys {}; }; } diff --git a/lib/default.nix b/lib/default.nix index d2b6c70..630c804 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -45,6 +45,9 @@ in rec { (name: _: mkSystem name) (readDir dir); + + buildHosts = _: mapHosts ../hosts; + findModules = modulesPath: listToAttrs (findModulesList modulesPath); # https://github.com/balsoft/nixos-config/blob/73cc2c3a8bb62a9c3980a16ae70b2e97af6e1abd/flake.nix#L109-L120 findModulesList = dir: