abstracted host definitions in flake.nix

This commit is contained in:
2025-07-29 13:56:25 -04:00
parent bd1851f706
commit 44062a87b4
6 changed files with 150 additions and 391 deletions

17
lib/default.nix Normal file
View File

@@ -0,0 +1,17 @@
{ inputs, username, nixpkgsConfig ? { allowUnfree = true; } }:
let
mkHost = import ./mk_host.nix;
in
{
inherit mkHost;
foldHosts = hosts: inputs.nixpkgs.lib.foldl'
(acc: host:
let result = mkHost ({ inherit inputs username nixpkgsConfig; } // host);
in {
nixosConfigurations = acc.nixosConfigurations // result.nixosConfigurations;
homeConfigurations = acc.homeConfigurations // result.homeConfigurations;
})
{ nixosConfigurations = {}; homeConfigurations = {}; }
hosts;
}