nix-infra/helper.nix

27 lines
669 B
Nix
Raw Normal View History

2023-07-30 01:38:31 +02:00
{ nixpkgs, ... }:
{
generateColmenaHost = name: {
site,
modules,
...
}: {
deployment = {
targetHost = "${name}.${site}.grzb.de";
targetUser = "colmena-deploy";
};
2023-07-27 21:59:24 +02:00
2023-07-30 01:38:31 +02:00
# Set imports and optionally import colmena secrets configuration
imports = modules ++ nixpkgs.lib.optional (builtins.pathExists ./hosts/${name}/secrets.nix) ./hosts/${name}/secrets.nix;
};
2023-07-27 21:59:24 +02:00
2023-07-30 01:38:31 +02:00
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;
2023-07-27 21:59:24 +02:00
}