forked from Fediversity/Fediversity
Share options that can be shared
This commit is contained in:
parent
b547912794
commit
8c5bf79ba2
4 changed files with 71 additions and 92 deletions
|
@ -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}";
|
||||
};
|
||||
{
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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 = ''
|
||||
|
|
|
@ -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}";
|
||||
};
|
||||
{
|
||||
};
|
||||
}
|
||||
|
|
38
services/fediversity/sharedOptions.nix
Normal file
38
services/fediversity/sharedOptions.nix
Normal 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}";
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue