nix-config/nix/colmena.nix

35 lines
960 B
Nix
Raw Normal View History

{
self,
nixpkgs,
...
} @ inputs: let
inherit
(nixpkgs.lib)
filterAttrs
mapAttrs
2023-08-26 14:01:58 +02:00
flip
;
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;}
];
});
in
{
meta = {
2023-08-26 14:01:58 +02:00
description = "Patrick's colmena configuration(Eigenhändig geklaut von oddlama)";
# 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