1
0
Fork 0

Define host groups

This commit is contained in:
clerie 2023-04-21 23:03:11 +02:00
parent dcd8c37014
commit 7d13fb29d1
2 changed files with 17 additions and 3 deletions

View File

@ -15,9 +15,15 @@
helper = (import ./lib/flake-helper.nix) inputs;
in {
clerie.hosts = {
aluminium = { name = "aluminium"; };
aluminium = {
name = "aluminium";
group = "event";
};
backup-4 = { name = "backup-4"; };
beryllium = { name = "beryllium"; };
beryllium = {
name = "beryllium";
group = "event";
};
carbon = { name = "carbon"; };
clerie-backup = { name = "clerie-backup"; };
dn42-il-gw1 = { name = "dn42-il-gw1"; };
@ -37,7 +43,10 @@
storage-2 = { name = "storage-2"; };
web-2 = { name = "web-2"; };
dn42-ildix-service = { name = "dn42-ildix-service"; };
astatine = { name = "astatine"; };
astatine = {
name = "astatine";
group = "event";
};
_iso = { name = "_iso"; };
};

View File

@ -4,6 +4,7 @@ rec {
generateNixosSystem = {
name,
system ? "x86_64-linux",
group ? null,
}: let
localNixpkgs = nixpkgs.lib.attrByPath [ "nixpkgs-${name}" ] nixpkgs inputs;
in localNixpkgs.lib.nixosSystem {
@ -25,6 +26,7 @@ rec {
nixos-exporter;
})
];
clerie.monitoring = nixpkgs.lib.attrsets.optionalAttrs (group != null) { serviceLevel = group; };
})
solid-xmpp-alarm.nixosModules.solid-xmpp-alarm
(../hosts + "/${name}/configuration.nix")
@ -37,6 +39,9 @@ rec {
deployment = {
targetHost = "${name}.net.clerie.de";
targetUser = null;
tags = let
group = nixpkgs.lib.attrByPath [ "clerie" "monitoring" "serviceLevel" ] null hostSystem.config;
in nixpkgs.lib.lists.optional (group != null) group;
};
nixpkgs.system = hostSystem.config.nixpkgs.system;
imports = hostSystem._module.args.modules;