modules/systemd-extras: introduce distributed service interface
This commit is contained in:
parent
514f5c9001
commit
e81345d4a0
2 changed files with 24 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./strict-mounts.nix
|
||||
./distributed.nix
|
||||
];
|
||||
}
|
||||
|
|
23
modules/systemd-extras/distributed.nix
Normal file
23
modules/systemd-extras/distributed.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}));
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue