27 lines
669 B
Nix
27 lines
669 B
Nix
{ nixpkgs, ... }:
|
|
{
|
|
generateColmenaHost = name: {
|
|
site,
|
|
modules,
|
|
...
|
|
}: {
|
|
deployment = {
|
|
targetHost = "${name}.${site}.grzb.de";
|
|
targetUser = "colmena-deploy";
|
|
};
|
|
|
|
# Set imports and optionally import colmena secrets configuration
|
|
imports = modules ++ nixpkgs.lib.optional (builtins.pathExists ./hosts/${name}/secrets.nix) ./hosts/${name}/secrets.nix;
|
|
};
|
|
|
|
generateNixConfiguration = name: {
|
|
hostNixpkgs,
|
|
system,
|
|
modules,
|
|
...
|
|
}:
|
|
(nixpkgs.lib.filterAttrs (name: host: (builtins.substring 0 1 name) != "_") (hostNixpkgs.lib.nixosSystem {
|
|
inherit system modules;
|
|
})).config.system.build.toplevel;
|
|
}
|