1{ lib }:
2
3with lib;
4with lib.types;
5{
6 options = {
7
8 script = mkOption {
9 type = str;
10 example = literalExpression ''"''${pkgs.curl} -f http://localhost:80"'';
11 description = "(Path of) Script command to execute followed by args, i.e. cmd [args]...";
12 };
13
14 interval = mkOption {
15 type = int;
16 default = 1;
17 description = "Seconds between script invocations.";
18 };
19
20 timeout = mkOption {
21 type = int;
22 default = 5;
23 description = "Seconds after which script is considered to have failed.";
24 };
25
26 weight = mkOption {
27 type = int;
28 default = 0;
29 description = "Following a failure, adjust the priority by this weight.";
30 };
31
32 rise = mkOption {
33 type = int;
34 default = 5;
35 description = "Required number of successes for OK transition.";
36 };
37
38 fall = mkOption {
39 type = int;
40 default = 3;
41 description = "Required number of failures for KO transition.";
42 };
43
44 user = mkOption {
45 type = str;
46 default = "keepalived_script";
47 description = "Name of user to run the script under.";
48 };
49
50 group = mkOption {
51 type = nullOr str;
52 default = null;
53 description = "Name of group to run the script under. Defaults to user group.";
54 };
55
56 extraConfig = mkOption {
57 type = lines;
58 default = "";
59 description = "Extra lines to be added verbatim to the vrrp_script section.";
60 };
61
62 };
63
64}