create a module for round-robin

This commit is contained in:
Daniel Barlow
2024-07-15 22:37:37 +01:00
parent b17f623d03
commit 3899daee56
4 changed files with 69 additions and 28 deletions

View File

@@ -0,0 +1,27 @@
## Round Robin
##
## Given a list of services, run each in turn until it exits, then
## runs the next.
{ lib, pkgs, config, ...}:
let
inherit (lib) mkOption types;
inherit (pkgs) liminix;
inherit (pkgs.liminix.services) longrun;
in {
options = {
system.service.round-robin = mkOption {
description = "run services one at a time and failover to next";
type = liminix.lib.types.serviceDefn;
};
};
config.system.service.round-robin = config.system.callService ./service.nix {
services = mkOption {
type = types.listOf liminix.lib.types.service;
};
name = mkOption {
type = types.str;
};
};
}