Ternaries

pull/19/head
Inex Code 2022-07-13 14:41:47 +03:00
parent ff536aa119
commit 3707937d1e
1 changed files with 25 additions and 25 deletions

View File

@ -4,55 +4,55 @@ let
in in
{ {
services.userdata = { services.userdata = {
hostname = jsonData.hostname; hostname = if jsonData ? "hostname" then jsonData.hostname else null;
domain = jsonData.domain; domain = if jsonData ? "domain" then jsonData.domain else null;
timezone = jsonData.timezone; timezone = if jsonData ? "timezone" then jsonData.timezone else "Europe/Uzhgorod";
autoUpgrade = { autoUpgrade = {
enable = jsonData.autoUpgrade.enable; enable = if jsonData ? "autoUpgrade.enable" then jsonData.autoUpgrade.enable else true;
allowReboot = jsonData.autoUpgrade.allowReboot; allowReboot = if jsonData ? "autoUpgrade.allowReboot" then jsonData.autoUpgrade.allowReboot else true;
}; };
username = jsonData.username; username = if jsonData ? "username" then jsonData.username else null;
hashedMasterPassword = jsonData.hashedMasterPassword; hashedMasterPassword = if jsonData ? "hashedMasterPassword" then jsonData.hashedMasterPassword else null;
sshKeys = jsonData.sshKeys; sshKeys = if jsonData ? "sshKeys" then jsonData.sshKeys else [];
api = { api = {
token = jsonData.api.token; token = jsonData.api.token;
enableSwagger = jsonData.api.enableSwagger; enableSwagger = if jsonData ? "api.enableSwagger" then jsonData.api.enableSwagger else false;
skippedMigrations = jsonData.api.skippedMigrations; skippedMigrations = if jsonData ? "api.skippedMigrations" then jsonData.api.skippedMigrations else [];
}; };
backblaze = { backblaze = {
bucket = jsonData.backblaze.bucket; bucket = if jsonData ? "backblaze.bucket" then jsonData.backblaze.bucket else null;
accountId = jsonData.backblaze.accountId; accountId = if jsonData ? "backblaze.accountId" then jsonData.backblaze.accountId else null;
accountKey = jsonData.backblaze.accountKey; accountKey = if jsonData ? "backblaze.accountKey" then jsonData.backblaze.accountKey else null;
}; };
cloudflare = { cloudflare = {
apiKey = jsonData.cloudflare.apiKey; apiKey = if jsonData ? "cloudflare.apiKey" then jsonData.cloudflare.apiKey else null;
}; };
databasePassword = jsonData.databasePassword; databasePassword = if jsonData ? "databasePassword" then jsonData.databasePassword else null;
bitwarden = { bitwarden = {
enable = jsonData.bitwarden.enable; enable = jsonData ? "bitwarden.enable" then jsonData.bitwarden.enable else false;
}; };
gitea = { gitea = {
enable = jsonData.gitea.enable; enable = jsonData ? "gitea.enable" then jsonData.gitea.enable else false;
}; };
nextcloud = { nextcloud = {
enable = jsonData.nextcloud.enable; enable = jsonData ? "nextcloud.enable" then jsonData.nextcloud.enable else false;
adminPassword = jsonData.nextcloud.adminPassword; adminPassword = jsonData ? "nextcloud.adminPassword" then jsonData.nextcloud.adminPassword else null;
}; };
pleroma = { pleroma = {
enable = jsonData.pleroma.enable; enable = jsonData ? "pleroma.enable" then jsonData.pleroma.enable else false;
}; };
jitsi = { jitsi = {
enable = jsonData.jitsi.enable; enable = jsonData ? "jitsi.enable" then jsonData.jitsi.enable else false;
}; };
ocserv = { ocserv = {
enable = jsonData.ocserv.enable; enable = jsonData ? "ocserv.enable" then jsonData.ocserv.enable else false;
}; };
resticPassword = jsonData.resticPassword; resticPassword = jsonData ? "resticPassword" then jsonData.resticPassword else null;
ssh = { ssh = {
enable = jsonData.ssh.enable; enable = if jsonData ? "ssh.enable" then jsonData.ssh.enable else true;
rootKeys = jsonData.ssh.rootKeys; rootKeys = jsonData.ssh.rootKeys;
passwordAuthentication = jsonData.ssh.passwordAuthentication; passwordAuthentication = jsonData.ssh.passwordAuthentication;
}; };
users = jsonData.users; users = (if jsonData ? "users" then jsonData.users else [ ]);
}; };
} }