Share options that can be shared

This commit is contained in:
Nicolas Jeannerod 2025-02-14 19:21:31 +01:00
parent b547912794
commit 8c5bf79ba2
Signed by untrusted user: Niols
GPG key ID: 35DB9EC8886E1CB8
4 changed files with 71 additions and 92 deletions

View file

@ -1,35 +1,14 @@
{ config, lib, ... }:
let
inherit (lib) mkOption mkEnableOption;
inherit (lib.types) types;
in
{
options.fediversity.mastodon = {
enable = mkEnableOption "Enable a Mastodon server on the machine";
options.fediversity.mastodon =
(import ../sharedOptions.nix {
inherit config lib;
serviceName = "mastodon";
serviceDocName = "Mastodon";
})
//
s3AccessKey = mkOption {
type = types.str;
description = ''
S3 access key
In AWS CLI, this would be AWS_ACCESS_KEY_ID.
'';
};
s3SecretKey = mkOption {
description = ''
S3 secret key
In AWS CLI, this would be AWS_SECRET_ACCESS_KEY.
'';
};
domain = mkOption {
type = types.str;
description = "Internal option change at your own risk";
default = "mastodon.${config.fediversity.domain}";
};
{
};
}

View file

@ -1,37 +1,20 @@
{ config, lib, ... }:
let
inherit (lib) mkOption mkEnableOption;
inherit (lib) mkOption;
inherit (lib.types) types;
in
{
options.fediversity.peertube = {
enable = mkEnableOption "Enable a PeerTube server on the machine";
s3AccessKey = mkOption {
type = types.str;
description = ''
S3 access key
In AWS CLI, this would be AWS_ACCESS_KEY_ID.
'';
};
s3SecretKey = mkOption {
description = ''
S3 secret key
In AWS CLI, this would be AWS_SECRET_ACCESS_KEY.
'';
};
domain = mkOption {
type = types.str;
description = "Internal option change at your own risk";
default = "peertube.${config.fediversity.domain}";
};
options.fediversity.peertube =
(import ../sharedOptions.nix {
inherit config lib;
serviceName = "peertube";
serviceDocName = "PeerTube";
})
//
{
secretsFile = mkOption {
type = types.path;
description = ''

View file

@ -1,35 +1,14 @@
{ config, lib, ... }:
let
inherit (lib) mkOption mkEnableOption;
inherit (lib.types) types;
in
{
options.fediversity.pixelfed = {
enable = mkEnableOption "Enable a Pixelfed server on the machine";
options.fediversity.pixelfed =
(import ../sharedOptions.nix {
inherit config lib;
serviceName = "pixelfed";
serviceDocName = "Pixelfed";
})
//
s3AccessKey = mkOption {
type = types.str;
description = ''
S3 access key
In AWS CLI, this would be AWS_ACCESS_KEY_ID.
'';
};
s3SecretKey = mkOption {
description = ''
S3 secret key
In AWS CLI, this would be AWS_SECRET_ACCESS_KEY.
'';
};
domain = mkOption {
type = types.str;
description = "Internal option change at your own risk";
default = "pixelfed.${config.fediversity.domain}";
};
{
};
}

View file

@ -0,0 +1,38 @@
{
config,
lib,
serviceName,
serviceDocName,
}:
let
inherit (lib) mkOption mkEnableOption;
inherit (lib.types) types;
in
{
enable = mkEnableOption "Enable a ${serviceDocName} server on the machine";
s3AccessKey = mkOption {
type = types.str;
description = ''
S3 access key for ${serviceDocName}'s bucket/s
In AWS CLI, this would be AWS_ACCESS_KEY_ID.
'';
};
s3SecretKey = mkOption {
description = ''
S3 secret key for ${serviceDocName}'s bucket/s
In AWS CLI, this would be AWS_SECRET_ACCESS_KEY.
'';
};
domain = mkOption {
type = types.str;
description = "Internal option change at your own risk";
default = "${serviceName}.${config.fediversity.domain}";
};
}