initial commit
This commit is contained in:
commit
0e480bb6b6
36 changed files with 13615 additions and 0 deletions
26
lib/hosts.nix
Normal file
26
lib/hosts.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ 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
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue