mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git
synced 2024-11-23 12:01:27 +00:00
Change the way we read values from userdata
This commit is contained in:
parent
41187bb18f
commit
ff536aa119
|
@ -11,10 +11,6 @@ let
|
|||
in
|
||||
{
|
||||
options.services.userdata = {
|
||||
enable = mkOption {
|
||||
default = true;
|
||||
type = types.nullOr types.bool;
|
||||
};
|
||||
# General server options
|
||||
hostname = mkOption {
|
||||
description = "The hostname of the server.";
|
||||
|
|
|
@ -1,6 +1,58 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
jsonData = builtins.fromJSON (builtins.readFile ./userdata/userdata.json);
|
||||
in
|
||||
{
|
||||
services = {
|
||||
userdata = builtins.fromJSON (builtins.readFile ./userdata/userdata.json);
|
||||
services.userdata = {
|
||||
hostname = jsonData.hostname;
|
||||
domain = jsonData.domain;
|
||||
timezone = jsonData.timezone;
|
||||
autoUpgrade = {
|
||||
enable = jsonData.autoUpgrade.enable;
|
||||
allowReboot = jsonData.autoUpgrade.allowReboot;
|
||||
};
|
||||
username = jsonData.username;
|
||||
hashedMasterPassword = jsonData.hashedMasterPassword;
|
||||
sshKeys = jsonData.sshKeys;
|
||||
api = {
|
||||
token = jsonData.api.token;
|
||||
enableSwagger = jsonData.api.enableSwagger;
|
||||
skippedMigrations = jsonData.api.skippedMigrations;
|
||||
};
|
||||
backblaze = {
|
||||
bucket = jsonData.backblaze.bucket;
|
||||
accountId = jsonData.backblaze.accountId;
|
||||
accountKey = jsonData.backblaze.accountKey;
|
||||
};
|
||||
cloudflare = {
|
||||
apiKey = jsonData.cloudflare.apiKey;
|
||||
};
|
||||
databasePassword = jsonData.databasePassword;
|
||||
bitwarden = {
|
||||
enable = jsonData.bitwarden.enable;
|
||||
};
|
||||
gitea = {
|
||||
enable = jsonData.gitea.enable;
|
||||
};
|
||||
nextcloud = {
|
||||
enable = jsonData.nextcloud.enable;
|
||||
adminPassword = jsonData.nextcloud.adminPassword;
|
||||
};
|
||||
pleroma = {
|
||||
enable = jsonData.pleroma.enable;
|
||||
};
|
||||
jitsi = {
|
||||
enable = jsonData.jitsi.enable;
|
||||
};
|
||||
ocserv = {
|
||||
enable = jsonData.ocserv.enable;
|
||||
};
|
||||
resticPassword = jsonData.resticPassword;
|
||||
ssh = {
|
||||
enable = jsonData.ssh.enable;
|
||||
rootKeys = jsonData.ssh.rootKeys;
|
||||
passwordAuthentication = jsonData.ssh.passwordAuthentication;
|
||||
};
|
||||
users = jsonData.users;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue