Use host config lib from pbb
This commit is contained in:
parent
82887a871a
commit
59dc3627a0
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…
Reference in New Issue
Block a user