2025-02-14 19:46:12 +01:00
|
|
|
## NOTE: Not a module, but a helper function to create options for Fediversity
|
|
|
|
## services, as they tend to require the same ones.
|
|
|
|
|
2025-02-14 19:21:31 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
serviceName,
|
|
|
|
serviceDocName,
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib) mkOption mkEnableOption;
|
|
|
|
inherit (lib.types) types;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
enable = mkEnableOption "Enable a ${serviceDocName} server on the machine";
|
|
|
|
|
2025-02-14 19:46:12 +01:00
|
|
|
s3AccessKeyFile = mkOption {
|
2025-02-15 11:19:10 +01:00
|
|
|
type = types.nullOr types.path;
|
2025-02-14 19:21:31 +01:00
|
|
|
description = ''
|
|
|
|
S3 access key for ${serviceDocName}'s bucket/s
|
|
|
|
|
2025-02-15 11:19:10 +01:00
|
|
|
In AWS CLI, this would be AWS_ACCESS_KEY_ID. The S3 bucket is only created
|
|
|
|
when non-`null`.
|
2025-02-14 19:21:31 +01:00
|
|
|
'';
|
2025-02-15 11:19:10 +01:00
|
|
|
default = null;
|
2025-02-14 19:21:31 +01:00
|
|
|
};
|
|
|
|
|
2025-02-14 19:46:12 +01:00
|
|
|
s3SecretKeyFile = mkOption {
|
2025-02-15 11:19:10 +01:00
|
|
|
type = types.nullOr types.path;
|
2025-02-14 19:21:31 +01:00
|
|
|
description = ''
|
|
|
|
S3 secret key for ${serviceDocName}'s bucket/s
|
|
|
|
|
2025-02-15 11:19:10 +01:00
|
|
|
In AWS CLI, this would be AWS_SECRET_ACCESS_KEY. The S3 bucket is only
|
|
|
|
created when non-`null`.
|
2025-02-14 19:21:31 +01:00
|
|
|
'';
|
2025-02-15 11:19:10 +01:00
|
|
|
default = null;
|
2025-02-14 19:21:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
domain = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
description = "Internal option — change at your own risk";
|
|
|
|
default = "${serviceName}.${config.fediversity.domain}";
|
|
|
|
};
|
|
|
|
}
|