modules/systemd-extras: introduce distributed service interface

This commit is contained in:
Max Headroom 2023-08-27 16:25:29 +02:00
parent 514f5c9001
commit e81345d4a0
2 changed files with 24 additions and 0 deletions

View file

@ -1,5 +1,6 @@
{
imports = [
./strict-mounts.nix
./distributed.nix
];
}

View file

@ -0,0 +1,23 @@
{ lib, ... }:
with lib;
{
options.systemd.services = mkOption {
type = with types; attrsOf (submodule ({ config, ... }: {
options.distributed = {
enable = mkEnableOption "distributed mode";
replicas = mkOption {
description = "Maximum number of replicas to run at once.";
type = types.int;
default = 1;
};
registerService = mkOption {
description = "Consul service to register when this service gets started.";
type = with types; nullOr str;
default = null;
};
};
}));
};
}