2021-11-15 10:02:05 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.userdata;
|
|
|
|
directionArg =
|
|
|
|
if cfg.direction == ""
|
|
|
|
then ""
|
|
|
|
else "--direction=${cfg.direction}";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.services.userdata = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = true;
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
};
|
|
|
|
hostname = mkOption {
|
|
|
|
description = "The hostname of the server.";
|
2021-11-16 10:30:11 +00:00
|
|
|
type = types.nullOr types.str;
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
|
|
|
domain = mkOption {
|
|
|
|
description = ''
|
|
|
|
Domain used by the server
|
|
|
|
'';
|
2021-11-16 10:30:11 +00:00
|
|
|
type = types.nullOr types.str;
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
|
|
|
username = mkOption {
|
|
|
|
description = ''
|
|
|
|
Username that was defined at the initial setup process
|
|
|
|
'';
|
2021-11-16 10:30:11 +00:00
|
|
|
type = types.nullOr types.str;
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
|
|
|
hashedMasterPassword = mkOption {
|
|
|
|
description = ''
|
|
|
|
Hash of the password that was defined at the initial setup process
|
|
|
|
'';
|
2021-11-16 10:30:11 +00:00
|
|
|
type = types.nullOr types.str;
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
2021-11-16 10:28:16 +00:00
|
|
|
api = {
|
|
|
|
token = mkOption {
|
|
|
|
description = ''
|
|
|
|
API token used to authenticate with the server
|
|
|
|
'';
|
2021-11-16 10:30:11 +00:00
|
|
|
type = types.nullOr types.str;
|
2021-11-16 10:28:16 +00:00
|
|
|
};
|
2021-11-16 14:08:58 +00:00
|
|
|
enableSwagger = mkOption {
|
|
|
|
default = true;
|
|
|
|
description = ''
|
|
|
|
Enable Swagger UI
|
|
|
|
'';
|
|
|
|
type = types.bool;
|
|
|
|
};
|
2021-11-16 10:28:16 +00:00
|
|
|
};
|
2021-11-15 10:02:05 +00:00
|
|
|
backblaze = {
|
|
|
|
bucket = mkOption {
|
|
|
|
description = "Bucket name used for userdata backups";
|
2021-11-16 10:30:11 +00:00
|
|
|
type = types.nullOr types.str;
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
|
|
|
accountId = mkOption {
|
|
|
|
description = "Backblaze B2 Account ID";
|
2021-11-16 10:30:11 +00:00
|
|
|
type = types.nullOr types.str;
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
|
|
|
accountKey = mkOption {
|
|
|
|
description = "Backblaze B2 Account Key.";
|
2021-11-16 10:30:11 +00:00
|
|
|
type = types.nullOr types.str;
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
cloudflare = {
|
|
|
|
apiKey = mkOption {
|
|
|
|
description = "Cloudflare API Key.";
|
2021-11-16 10:30:11 +00:00
|
|
|
type = types.nullOr types.str;
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
databasePassword = mkOption {
|
|
|
|
description = ''
|
|
|
|
Password for the database
|
|
|
|
'';
|
2021-11-16 10:30:11 +00:00
|
|
|
type = types.nullOr types.str;
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
|
|
|
bitwarden = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
gitea = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
nextcloud = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = true;
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
};
|
|
|
|
databasePassword = mkOption {
|
|
|
|
description = ''
|
|
|
|
Password for the nextcloud database
|
|
|
|
'';
|
2021-11-16 10:30:11 +00:00
|
|
|
type = types.nullOr types.str;
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
|
|
|
adminPassword = mkOption {
|
|
|
|
description = ''
|
|
|
|
Password for the nextcloud admin user
|
|
|
|
'';
|
2021-11-16 10:30:11 +00:00
|
|
|
type = types.nullOr types.str;
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
pleroma = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
jitsi = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
ocserv = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = true;
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
resticPassword = mkOption {
|
|
|
|
description = ''
|
|
|
|
Password for the restic
|
|
|
|
'';
|
2021-11-16 10:30:11 +00:00
|
|
|
type = types.nullOr types.str;
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
2021-11-15 13:35:04 +00:00
|
|
|
ssh = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = true;
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
};
|
|
|
|
rootKeys = mkOption {
|
|
|
|
description = ''
|
2021-11-16 14:08:58 +00:00
|
|
|
Root SSH Keys
|
2021-11-15 13:35:04 +00:00
|
|
|
'';
|
2021-11-16 10:30:11 +00:00
|
|
|
type = types.nullOr (types.listOf types.str);
|
2021-11-15 13:35:04 +00:00
|
|
|
};
|
|
|
|
passwordAuthentication = mkOption {
|
|
|
|
description = ''
|
|
|
|
Password authentication for SSH
|
|
|
|
'';
|
|
|
|
default = true;
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
};
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
|
|
|
timezone = mkOption {
|
|
|
|
description = ''
|
|
|
|
Timezone used by the server
|
|
|
|
'';
|
2021-11-16 10:30:11 +00:00
|
|
|
type = types.nullOr types.str;
|
2021-11-15 10:02:05 +00:00
|
|
|
default = "Europe/Uzhgorod";
|
|
|
|
};
|
|
|
|
users = mkOption {
|
|
|
|
description = ''
|
|
|
|
Users that will be created on the server
|
|
|
|
'';
|
2021-11-15 10:29:20 +00:00
|
|
|
type = types.nullOr (types.listOf (types.attrsOf types.anything));
|
2021-11-15 10:02:05 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|