liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

default.nix (661B)


      1 ## Round Robin
      2 ##
      3 ## Given a list of services, run each in turn until it exits, then
      4 ## runs the next.
      5 
      6 {
      7   lib,
      8   pkgs,
      9   config,
     10   ...
     11 }:
     12 let
     13   inherit (lib) mkOption types;
     14   inherit (pkgs) liminix;
     15   inherit (pkgs.liminix.services) longrun;
     16 in
     17 {
     18   options = {
     19     system.service.round-robin = mkOption {
     20       description = "run services one at a time and failover to next";
     21       type = liminix.lib.types.serviceDefn;
     22     };
     23   };
     24   config.system.service.round-robin = config.system.callService ./service.nix {
     25     services = mkOption {
     26       type = types.listOf liminix.lib.types.service;
     27     };
     28     name = mkOption {
     29       type = types.str;
     30     };
     31   };
     32 }