fix module option defaults
This commit is contained in:
parent
ccbfeb097b
commit
ee7b81d07a
2 changed files with 12 additions and 11 deletions
|
|
@ -50,8 +50,8 @@ EINTOPF_AUTHORIZATION_TOKEN=foobar23
|
||||||
services.mail-quota-warning = {
|
services.mail-quota-warning = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
EINTOPF_URL = "https://karlsunruh.eintopf.info";
|
CHECK_INTERVAL_DAYS = 7;
|
||||||
RADAR_GROUP_ID = "436012";
|
QUOTA_WARNING_THRESHOLD_PERCENT = 80;
|
||||||
};
|
};
|
||||||
secrets = [ /etc/mail-quota-warning-secrets.yml ];
|
secrets = [ /etc/mail-quota-warning-secrets.yml ];
|
||||||
};
|
};
|
||||||
|
|
@ -64,8 +64,7 @@ Replace setting variables according to your setup.
|
||||||
```
|
```
|
||||||
cd mail-quota-warning
|
cd mail-quota-warning
|
||||||
nix develop
|
nix develop
|
||||||
export EINTOPF_URL = "https://karlsunruh.eintopf.info"
|
export CHECK_INTERVAL_DAYS=7
|
||||||
export EINTOPF_AUTHORIZATION_TOKEN = "secret key"
|
export QUOTA_WARNING_THRESHOLD_PERCENT=80
|
||||||
export RADAR_GROUP_ID = "436012"
|
|
||||||
nix run
|
nix run
|
||||||
```
|
```
|
||||||
|
|
|
||||||
14
module.nix
14
module.nix
|
|
@ -19,32 +19,34 @@ in
|
||||||
|
|
||||||
settings = lib.mkOption {
|
settings = lib.mkOption {
|
||||||
type = lib.types.submodule {
|
type = lib.types.submodule {
|
||||||
freeformType = with lib.types; attrsOf types.str;
|
freeformType = with lib.types; attrsOf types.str types.int;
|
||||||
options = {
|
options = {
|
||||||
CHECK_INTERVAL_DAYS = lib.mkOption {
|
CHECK_INTERVAL_DAYS = lib.mkOption {
|
||||||
default = 7;
|
default = 7;
|
||||||
type = lib.types.int;
|
type = lib.types.int;
|
||||||
description = ''
|
description = ''
|
||||||
Base URL of the target Eintopf host.
|
Interval of days in which a warning message will be
|
||||||
|
delivered.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
QUOTA_WARNING_THRESHOLD_PERCENT = lib.mkOption {
|
QUOTA_WARNING_THRESHOLD_PERCENT = lib.mkOption {
|
||||||
default = 80;
|
default = 80;
|
||||||
type = lib.types.int;
|
type = lib.types.int;
|
||||||
description = ''
|
description = ''
|
||||||
Radar group ID which events to sync.
|
Threshold of used mailbox space in percent after which
|
||||||
|
a warning message will be delivered.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
default = {};
|
default = {};
|
||||||
description = ''
|
description = ''
|
||||||
Extra options which should be used by the Radar sync script.
|
Extra options which should be used by the mailbox quota warning script.
|
||||||
'';
|
'';
|
||||||
example = lib.literalExpression ''
|
example = lib.literalExpression ''
|
||||||
{
|
{
|
||||||
EINTOPF_URL = "eintopf.info";
|
CHECK_INTERVAL_DAYS = 7;
|
||||||
QUOTA_WARNING_RADAR_GROUP_ID = "436012";
|
QUOTA_WARNING_THRESHOLD_PERCENT = 80;
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue