1
0
nixfiles/lib/hosts.nix

27 lines
482 B
Nix

{ pkgs ? import ../pkgs {} }:
with pkgs.lib;
rec {
hostsDir = ../hosts;
hostNames = attrNames (
filterAttrs (
name: type: type == "directory"
) (
builtins.readDir hostsDir
)
);
hosts = listToAttrs (
map (
hostName: nameValuePair hostName (
import (pkgs.path + "/nixos") {
configuration = import (hostsDir + "/${hostName}/configuration.nix");
system = "x86_64-linux";
}
)
) hostNames
);
}