diff --git a/flake.nix b/flake.nix index 3346f51..606af6a 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; }; }; diff --git a/lib/flake-helper.nix b/lib/flake-helper.nix index 7392887..ae08c4c 100644 --- a/lib/flake-helper.nix +++ b/lib/flake-helper.nix @@ -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;