1
0
Fork 0

Use host config lib from pbb

This commit is contained in:
clerie 2020-12-06 19:09:59 +01:00
parent 82887a871a
commit 59dc3627a0
1 changed files with 26 additions and 0 deletions

26
lib/hosts.nix Normal file
View 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
);
}