2023-05-02 15:08:36 +02:00
|
|
|
{
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
|
|
|
...
|
|
|
|
} @ inputs: let
|
|
|
|
inherit
|
|
|
|
(nixpkgs.lib)
|
|
|
|
filterAttrs
|
|
|
|
mapAttrs
|
2023-08-26 14:01:58 +02:00
|
|
|
flip
|
2023-05-02 15:08:36 +02:00
|
|
|
;
|
|
|
|
|
|
|
|
nixosNodes = filterAttrs (_: x: x.type == "nixos") self.hosts;
|
2023-08-26 14:01:58 +02:00
|
|
|
nodes = flip mapAttrs nixosNodes (name: hostCfg:
|
|
|
|
import ./generate-node.nix inputs {
|
|
|
|
inherit name;
|
|
|
|
inherit (hostCfg) system;
|
|
|
|
modules = [
|
|
|
|
../hosts/${name}
|
|
|
|
{node.secretsDir = ../hosts/${name}/secrets;}
|
|
|
|
];
|
|
|
|
});
|
2023-05-02 15:08:36 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
meta = {
|
2023-08-26 14:01:58 +02:00
|
|
|
description = "Patrick's colmena configuration(Eigenhändig geklaut von oddlama)";
|
2023-05-02 15:08:36 +02:00
|
|
|
# Just a required dummy for colmena, overwritten on a per-node basis by nodeNixpkgs below.
|
|
|
|
nixpkgs = self.pkgs.x86_64-linux;
|
|
|
|
# This is so colmena uses the correct nixpkgs and specialarges for each host
|
|
|
|
nodeNixpkgs = mapAttrs (_: node: node.pkgs) nodes;
|
|
|
|
nodeSpecialArgs = mapAttrs (_: node: node.specialArgs) nodes;
|
|
|
|
};
|
|
|
|
}
|
2023-08-26 14:01:58 +02:00
|
|
|
// mapAttrs (_: node: {inherit (node) imports;}) nodes
|