selfprivacy-nixos-config/variables.nix

50 lines
2 KiB
Nix
Raw Normal View History

2022-07-13 12:57:03 +00:00
{ pkgs, lib, ... }:
let
jsonData = builtins.fromJSON (builtins.readFile ./userdata/userdata.json);
in
2021-11-15 10:02:05 +00:00
{
services.userdata = {
2022-07-13 12:57:03 +00:00
hostname = lib.attrsets.attrByPath [ "hostname" ] null jsonData;
domain = lib.attrsets.attrByPath [ "domain" ] null jsonData;
timezone = lib.attrsets.attrByPath [ "timezone" ] "Europe/Uzhgorod" jsonData;
autoUpgrade = {
2022-07-13 12:57:03 +00:00
enable = lib.attrsets.attrByPath [ "autoUpgrade" "enable" ] true jsonData;
allowReboot = lib.attrsets.attrByPath [ "autoUpgrade" "allowReboot" ] true jsonData;
};
2022-07-13 12:57:03 +00:00
username = lib.attrsets.attrByPath [ "username" ] null jsonData;
hashedMasterPassword = lib.attrsets.attrByPath [ "hashedMasterPassword" ] null jsonData;
2022-07-15 12:27:32 +00:00
sshKeys = lib.attrsets.attrByPath [ "sshKeys" ] [ ] jsonData;
api = {
2022-07-13 12:57:03 +00:00
enableSwagger = lib.attrsets.attrByPath [ "api" "enableSwagger" ] false jsonData;
2022-07-15 12:27:32 +00:00
skippedMigrations = lib.attrsets.attrByPath [ "api" "skippedMigrations" ] [ ] jsonData;
};
backblaze = {
2022-07-13 12:57:03 +00:00
bucket = lib.attrsets.attrByPath [ "backblaze" "bucket" ] "" jsonData;
};
bitwarden = {
2022-07-13 12:57:03 +00:00
enable = lib.attrsets.attrByPath [ "bitwarden" "enable" ] false jsonData;
};
gitea = {
2022-07-13 12:57:03 +00:00
enable = lib.attrsets.attrByPath [ "gitea" "enable" ] false jsonData;
};
nextcloud = {
2022-07-13 12:57:03 +00:00
enable = lib.attrsets.attrByPath [ "nextcloud" "enable" ] false jsonData;
};
pleroma = {
2022-07-13 12:57:03 +00:00
enable = lib.attrsets.attrByPath [ "pleroma" "enable" ] false jsonData;
};
jitsi = {
2022-07-13 12:57:03 +00:00
enable = lib.attrsets.attrByPath [ "jitsi" "enable" ] false jsonData;
};
ocserv = {
2022-07-13 12:57:03 +00:00
enable = lib.attrsets.attrByPath [ "ocserv" "enable" ] false jsonData;
};
ssh = {
2022-07-13 12:57:03 +00:00
enable = lib.attrsets.attrByPath [ "ssh" "enable" ] true jsonData;
rootKeys = lib.attrsets.attrByPath [ "ssh" "rootKeys" ] [ "" ] jsonData;
passwordAuthentication = lib.attrsets.attrByPath [ "ssh" "passwordAuthentication" ] true jsonData;
};
2022-07-15 12:27:32 +00:00
users = lib.attrsets.attrByPath [ "users" ] [ ] jsonData;
2021-11-15 10:02:05 +00:00
};
}