From 84c7cc16355590d7fdb9d8a6b7a882393d520222 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 23 Jul 2024 20:05:21 +0200 Subject: [PATCH] cluster/simulacrum: expose checks --- cluster/part.nix | 1 + cluster/simulacrum/checks.nix | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 cluster/simulacrum/checks.nix diff --git a/cluster/part.nix b/cluster/part.nix index eae3222..58e93b3 100644 --- a/cluster/part.nix +++ b/cluster/part.nix @@ -3,6 +3,7 @@ { imports = [ ./catalog + ./simulacrum/checks.nix ]; options.cluster = lib.mkOption { diff --git a/cluster/simulacrum/checks.nix b/cluster/simulacrum/checks.nix new file mode 100644 index 0000000..bf3e918 --- /dev/null +++ b/cluster/simulacrum/checks.nix @@ -0,0 +1,16 @@ +{ config, extendModules, lib, ... }: + +{ + perSystem = { pkgs, system, ... }: { + checks = lib.mkIf (system == "x86_64-linux") (lib.mapAttrs' (name: svc: let + runSimulacrum = pkgs.callPackage ./. { + inherit config extendModules; + }; + in { + name = "simulacrum-${name}"; + value = runSimulacrum { + service = name; + }; + }) (lib.filterAttrs (_: svc: svc.simulacrum.enable) config.cluster.config.services)); + }; +}