The Blue Update #1

Merged
Jimbo merged 101 commits from Refactor into main 2024-10-25 21:26:22 -04:00
34 changed files with 143 additions and 117 deletions
Showing only changes of commit fe73fa0d1f - Show all commits

View file

@ -13,6 +13,7 @@
../../../modules/home/utils/zsh ../../../modules/home/utils/zsh
# Misc # Misc
../../../variables/domains
../../../variables/look/colors/purple ../../../variables/look/colors/purple
]; ];
} }

View file

@ -13,6 +13,7 @@
../../../modules/home/utils/zsh ../../../modules/home/utils/zsh
# Misc # Misc
../../../variables/domains
../../../variables/look/colors/purple ../../../variables/look/colors/purple
]; ];
} }

View file

@ -1,8 +1,8 @@
{ pkgs, ... }: { config, ... }:
{ {
programs.git = { programs.git = {
enable = true; enable = true;
userName = "Jimbo"; userName = "Jimbo";
userEmail = "jimbo@jimbosfiles.com"; userEmail = "jimbo@${config.domains.jim2}";
}; };
} }

View file

@ -4,20 +4,20 @@
enable = true; enable = true;
protocol = "cloudflare"; protocol = "cloudflare";
use = "web, web=https://ipinfo.io/ip"; use = "web, web=https://ipinfo.io/ip";
zone = "${config.secrets.jimDomain}"; zone = "${config.domains.jim1}";
username = "token"; username = "token";
passwordFile = "${pkgs.writeText "cloudflareapikey" config.secrets.flareApiKey}"; passwordFile = "${pkgs.writeText "cloudflareapikey" config.secrets.flareApiKey}";
domains = [ domains = [
"${config.secrets.jimDomain}" "${config.domains.jim1}"
"*.${config.secrets.jimDomain}" "*.${config.domains.jim1}"
"sv.${config.secrets.jimDomain}" "sv.${config.domains.jim1}"
"git.${config.secrets.jimDomain}" "git.${config.domains.jim1}"
"rtmp.${config.secrets.jimDomain}" "rtmp.${config.domains.jim1}"
"turn.${config.secrets.jimDomain}" "turn.${config.domains.jim1}"
"dew.${config.secrets.jimDomain}" "dew.${config.domains.jim1}"
"john.${config.secrets.jimDomain}" "john.${config.domains.jim1}"
"beta.${config.secrets.jimDomain}" "beta.${config.domains.jim1}"
"rogue.${config.secrets.jimDomain}" "rogue.${config.domains.jim1}"
]; ];
}; };
} }

View file

@ -4,7 +4,7 @@
nextcloud = { nextcloud = {
enable = true; enable = true;
package = pkgs.nextcloud29; package = pkgs.nextcloud29;
hostName = "cloud.${config.secrets.jimDomain}"; hostName = "cloud.${config.domains.jim1}";
datadir = "/mnt/nextcloud"; datadir = "/mnt/nextcloud";
https = true; https = true;
config = { config = {
@ -13,20 +13,20 @@
}; };
settings = { settings = {
trusted_proxies = [ "127.0.0.1" ]; trusted_proxies = [ "127.0.0.1" ];
trusted_domains = [ "cloud.${config.secrets.jimDomain}" ]; trusted_domains = [ "cloud.${config.domains.jim1}" ];
overwriteprotocol = "https"; overwriteprotocol = "https";
mail_smtphost = "mx.${config.secrets.jimDomain}"; mail_smtphost = "mx.${config.domains.jim1}";
mail_domain = "${config.secrets.jimDomain}"; mail_domain = "${config.domains.jim1}";
mail_from_address = "noreply"; mail_from_address = "noreply";
mail_smtpauth = "true"; mail_smtpauth = "true";
mail_smtpname = "noreply@${config.secrets.jimDomain}"; mail_smtpname = "noreply@${config.domains.jim1}";
mail_smtppassword = config.secrets.noreplyPassword; mail_smtppassword = config.secrets.noreplyPassword;
mail_smtpmode = "smtp"; mail_smtpmode = "smtp";
mail_smtpport = 587; mail_smtpport = 587;
}; };
}; };
nginx.virtualHosts."cloud.${config.secrets.jimDomain}" = { nginx.virtualHosts."cloud.${config.domains.jim1}" = {
enableACME = true; enableACME = true;
addSSL = true; addSSL = true;
locations."/" = { locations."/" = {

View file

@ -14,11 +14,11 @@
PHOTOPRISM_DATABASE_NAME = "photoprism"; PHOTOPRISM_DATABASE_NAME = "photoprism";
PHOTOPRISM_DATABASE_SERVER = "/run/mysqld/mysqld.sock"; PHOTOPRISM_DATABASE_SERVER = "/run/mysqld/mysqld.sock";
PHOTOPRISM_DATABASE_USER = "photoprism"; PHOTOPRISM_DATABASE_USER = "photoprism";
PHOTOPRISM_SITE_URL = "https://gallery.${config.secrets.jimDomain}"; PHOTOPRISM_SITE_URL = "https://gallery.${config.domains.jim1}";
PHOTOPRISM_SITE_TITLE = "Jimbo's PhotoPrism"; PHOTOPRISM_SITE_TITLE = "Jimbo's PhotoPrism";
}; };
}; };
nginx.virtualHosts."gallery.${config.secrets.jimDomain}" = { nginx.virtualHosts."gallery.${config.domains.jim1}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {

View file

@ -9,8 +9,8 @@
enable = true; enable = true;
settings = { settings = {
server = { server = {
DOMAIN = "git.${config.secrets.jimDomain}"; DOMAIN = "git.${config.domains.jim1}";
ROOT_URL = "https://git.${config.secrets.jimDomain}:443"; ROOT_URL = "https://git.${config.domains.jim1}:443";
HTTP_PORT = 3110; HTTP_PORT = 3110;
SSH_PORT = 2299; SSH_PORT = 2299;
START_SSH_SERVER = true; START_SSH_SERVER = true;
@ -20,9 +20,9 @@
}; };
mailer = { mailer = {
ENABLED = true; ENABLED = true;
SMTP_ADDR = "mx.${config.secrets.jimDomain}"; SMTP_ADDR = "mx.${config.domains.jim1}";
FROM = "Jimbo's Git <noreply@${config.secrets.jimDomain}>"; FROM = "Jimbo's Git <noreply@${config.domains.jim1}>";
USER = "noreply@${config.secrets.jimDomain}"; USER = "noreply@${config.domains.jim1}";
PASSWD = config.secrets.noreplyPassword; PASSWD = config.secrets.noreplyPassword;
PROTOCOL = "smtps"; PROTOCOL = "smtps";
}; };

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
{ {
services.nginx.virtualHosts."git.${config.secrets.jimDomain}" = { services.nginx.virtualHosts."git.${config.domains.jim1}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {

View file

@ -8,7 +8,7 @@
icecast = { icecast = {
enable = true; enable = true;
listen.port = 265; listen.port = 265;
hostname = "icecast.${config.secrets.jimDomain}"; hostname = "icecast.${config.domains.jim1}";
admin = { admin = {
user = "jimbo"; user = "jimbo";
password = "${config.secrets.castAdminPass}"; password = "${config.secrets.castAdminPass}";
@ -19,7 +19,7 @@
</authentication> </authentication>
<location>Canada</location> <location>Canada</location>
<admin>jimbo@jimbosfiles.com</admin> <admin>jimbo@${config.domains.jim2}</admin>
<mount type="normal"> <mount type="normal">
<mount-name>/jimbops.opus</mount-name> <mount-name>/jimbops.opus</mount-name>

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
{ {
services.nginx.virtualHosts."icecast.${config.secrets.jimDomain}" = { services.nginx.virtualHosts."icecast.${config.domains.jim1}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {

View file

@ -2,9 +2,9 @@
{ {
services.roundcube = { services.roundcube = {
enable = true; enable = true;
hostName = "mail.${config.secrets.jimDomain}"; hostName = "mail.${config.domains.jim1}";
extraConfig = '' extraConfig = ''
$config['smtp_server'] = "tls://mx.${config.secrets.jimDomain}"; $config['smtp_server'] = "tls://mx.${config.domains.jim1}";
$config['smtp_user'] = "%u"; $config['smtp_user'] = "%u";
$config['smtp_pass'] = "%p"; $config['smtp_pass'] = "%p";
''; '';

View file

@ -8,46 +8,46 @@
mailserver = rec { mailserver = rec {
enable = true; enable = true;
domains = [ domains = [
"${config.secrets.jimDomain}" "${config.domains.jim1}"
"${config.secrets.jimDomain2}" "${config.domains.jim2}"
"${config.secrets.lunaDomain}" "${config.domains.luna}"
"${config.secrets.cornDomain}" "${config.domains.corn}"
]; ];
fqdn = "mx.${config.secrets.jimDomain}"; fqdn = "mx.${config.domains.jim1}";
certificateScheme = "acme-nginx"; certificateScheme = "acme-nginx";
localDnsResolver = false; localDnsResolver = false;
redis.port = 1515; redis.port = 1515;
dmarcReporting = { dmarcReporting = {
enable = true; enable = true;
domain = "${config.secrets.jimDomain}"; domain = "${config.domains.jim1}";
localpart = "noreply"; localpart = "noreply";
organizationName = "Jimbo's Files"; organizationName = "Jimbo's Files";
}; };
# A list of accounts, passwords generated with nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' # A list of accounts, passwords generated with nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt'
loginAccounts = { loginAccounts = {
"noreply@${config.secrets.jimDomain}" = { "noreply@${config.domains.jim1}" = {
hashedPasswordFile = pkgs.writeText "noreply" config.secrets.noreplyMailHash; hashedPasswordFile = pkgs.writeText "noreply" config.secrets.noreplyMailHash;
sendOnly = true; sendOnly = true;
}; };
"jimbo@${config.secrets.jimDomain2}" = { "jimbo@${config.domains.jim12}" = {
hashedPasswordFile = pkgs.writeText "jimbo" config.secrets.jimboMailHash; hashedPasswordFile = pkgs.writeText "jimbo" config.secrets.jimboMailHash;
aliases = [ aliases = [
"jimbo@${config.secrets.jimDomain}" "jimbo@${config.domains.jim1}"
"james@${config.secrets.jimDomain}" "james@${config.domains.jim1}"
"james@${config.secrets.jimDomain2}" "james@${config.domains.jim2}"
"contact@${config.secrets.jimDomain}" "contact@${config.domains.jim1}"
"contact@${config.secrets.jimDomain2}" "contact@${config.domains.jim2}"
]; ];
}; };
"luna@${config.secrets.lunaDomain}" = { "luna@${config.domains.luna}" = {
hashedPasswordFile = pkgs.writeText "luna" config.secrets.lunaMailHash; hashedPasswordFile = pkgs.writeText "luna" config.secrets.lunaMailHash;
}; };
"corn@${config.secrets.cornDomain}" = { "corn@${config.domains.corn}" = {
hashedPasswordFile = pkgs.writeText "corn" config.secrets.cornMailHash; hashedPasswordFile = pkgs.writeText "corn" config.secrets.cornMailHash;
}; };
"tiny@${config.secrets.cornDomain}" = { "tiny@${config.domains.corn}" = {
hashedPasswordFile = pkgs.writeText "tiny" config.secrets.tinyMailHash; hashedPasswordFile = pkgs.writeText "tiny" config.secrets.tinyMailHash;
}; };
}; };

View file

@ -1,6 +1,6 @@
{ pkgs, config, ... }: { pkgs, config, ... }:
{ {
services.nginx.virtualHosts."mx.${config.secrets.jimDomain}" = { services.nginx.virtualHosts."mx.${config.domains.jim1}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {

View file

@ -43,7 +43,7 @@ in {
}; };
# BlueMap webhost # BlueMap webhost
nginx.virtualHosts."john.${config.secrets.jimDomain}" = { nginx.virtualHosts."john.${config.domains.jim1}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {
@ -52,16 +52,4 @@ in {
}; };
}; };
}; };
# Allow Nginx to read and write to paths
systemd.services.nginx.serviceConfig = {
ReadWritePaths = [ "/var/www/Jimbo-Landing-Page/streams/hls/" ];
};
# Open HTTP and HTTPs ports
networking.firewall = {
allowedTCPPorts = [
80 443 # Nginx
];
};
} }

View file

@ -12,19 +12,19 @@ in {
server-port = 30014; server-port = 30014;
motd = "\\u00A7l\\u00A7bJimbo's \\u00A7cRoguecraft \\u00A7bserver."; motd = "\\u00A7l\\u00A7bJimbo's \\u00A7cRoguecraft \\u00A7bserver.";
require-resource-pack = true; require-resource-pack = true;
resource-pack = "https://${config.secrets.jimDomain}/roguecraftresourcepackredir"; resource-pack = "https://${config.domains.jim1}/roguecraftresourcepackredir";
resource-pack-sha1 = "b540c0562aba90c3ead2356bb9cb74fcf0db36b3"; resource-pack-sha1 = "b540c0562aba90c3ead2356bb9cb74fcf0db36b3";
}; };
whitelist = common.whitelist; whitelist = common.whitelist;
symlinks = common.paperSymlinks; symlinks = common.paperSymlinks;
files = common.configFiles // { files = common.configFiles // {
"world/datapacks/roguecraft.zip" = builtins.fetchurl { "world/datapacks/roguecraft.zip" = builtins.fetchurl {
url = "https://${config.secrets.jimDomain}/roguecraftdatapackredir"; url = "https://${config.domains.jim1}/roguecraftdatapackredir";
sha256 = "04zrkvzvi1i898al45fh9j3k635sf9qhwca7phbv4ynkfl8bz3q3"; sha256 = "04zrkvzvi1i898al45fh9j3k635sf9qhwca7phbv4ynkfl8bz3q3";
}; };
}; };
}; };
nginx.virtualHosts."${config.secrets.jimDomain}".locations = { nginx.virtualHosts."${config.domains.jim1}".locations = {
"/roguecraftdatapackredir" = { "/roguecraftdatapackredir" = {
return = "301 https://cdn.modrinth.com/data/HtKjVijx/versions/Rme4c23R/Roguecraft%201.2.6%20-%20Data%20Pack.zip"; return = "301 https://cdn.modrinth.com/data/HtKjVijx/versions/Rme4c23R/Roguecraft%201.2.6%20-%20Data%20Pack.zip";
}; };

View file

@ -40,11 +40,18 @@ in {
# Open ports for proxy # Open ports for proxy
networking.firewall = { networking.firewall = {
# Server and info
allowedTCPPorts = [ allowedTCPPorts = [
25565 19132 30013 5657 # Minecraft server info 25565
19132
30013
5657
]; ];
# Server, VC, and Bedrock
allowedUDPPorts = [ allowedUDPPorts = [
25565 19132 30013 # Minecraft server, VC, and Bedrock 25565
19132
30013
]; ];
}; };
} }

View file

@ -9,11 +9,11 @@
nginx.enable = true; nginx.enable = true;
database.createLocally = true; database.createLocally = true;
settings = { settings = {
hostname = "lemmy.${config.secrets.jimDomain}"; hostname = "lemmy.${config.domains.jim1}";
email = { email = {
smtp_server = "mx.${config.secrets.jimDomain}:587"; smtp_server = "mx.${config.domains.jim1}:587";
smtp_login = "noreply@${config.secrets.jimDomain}"; smtp_login = "noreply@${config.domains.jim1}";
smtp_from_address = "Jimbo's Lemmy <noreply@${config.secrets.jimDomain}>"; smtp_from_address = "Jimbo's Lemmy <noreply@${config.domains.jim1}>";
smtp_password = config.secrets.noreplyPassword; smtp_password = config.secrets.noreplyPassword;
tls_type = "starttls"; tls_type = "starttls";
}; };

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
{ {
services.nginx.virtualHosts."lemmy.${config.secrets.jimDomain}" = { services.nginx.virtualHosts."lemmy.${config.domains.jim1}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
}; };

View file

@ -2,16 +2,16 @@
{ {
services.mastodon = { services.mastodon = {
enable = true; enable = true;
localDomain = "social.${config.secrets.jimDomain}"; localDomain = "social.${config.domains.jim1}";
streamingProcesses = 4; streamingProcesses = 4;
configureNginx = true; configureNginx = true;
smtp = { smtp = {
createLocally = false; createLocally = false;
host = "mx.${config.secrets.jimDomain}"; host = "mx.${config.domains.jim1}";
port = 587; port = 587;
authenticate = true; authenticate = true;
fromAddress = "Jimbo's Mastodon <noreply@${config.secrets.jimDomain}>"; fromAddress = "Jimbo's Mastodon <noreply@${config.domains.jim1}>";
user = "noreply@${config.secrets.jimDomain}"; user = "noreply@${config.domains.jim1}";
passwordFile = pkgs.writeText "smtp_pass.txt" config.secrets.noreplyPassword; passwordFile = pkgs.writeText "smtp_pass.txt" config.secrets.noreplyPassword;
}; };
}; };

View file

@ -7,16 +7,16 @@
nixpkgs.config.element-web.conf = { nixpkgs.config.element-web.conf = {
default_server_config = { default_server_config = {
"m.homeserver" = { "m.homeserver" = {
base_url = "https://matrix.${config.secrets.jimDomain}"; base_url = "https://matrix.${config.domains.jim1}";
server_name = "matrix.${config.secrets.jimDomain}"; server_name = "matrix.${config.domains.jim1}";
}; };
}; };
branding = { branding = {
#welcome_background_url = "https://staging.${config.secrets.jimDomain}/images/backgrounds/bloxelcom-sunset.jpg"; #welcome_background_url = "https://staging.${config.domains.jim1}/images/backgrounds/template-background.png";
#auth_header_logo_url = "https://staging.${config.secrets.jimDomain}/images/logos/bloxelcom.png"; #auth_header_logo_url = "https://staging.${config.domains.jim1}/images/logos/template-logo.png";
}; };
embedded_pages = { embedded_pages = {
home_url = "https://www.${config.secrets.jimDomain}/"; home_url = "https://www.${config.domains.jim1}/";
}; };
disable_custom_urls = true; disable_custom_urls = true;
disable_guests = true; disable_guests = true;

View file

@ -1,6 +1,6 @@
{ pkgs, config, ... }: { pkgs, config, ... }:
{ {
services.nginx.virtualHosts."chat.${config.secrets.jimDomain}" = { services.nginx.virtualHosts."chat.${config.domains.jim1}" = {
enableACME = true; enableACME = true;
addSSL = true; addSSL = true;
root = "${pkgs.element-web}"; root = "${pkgs.element-web}";

View file

@ -13,16 +13,16 @@
max-port = 50000; max-port = 50000;
use-auth-secret = true; use-auth-secret = true;
static-auth-secret = "will be world readable for local users :("; static-auth-secret = "will be world readable for local users :(";
realm = "turn.${config.secrets.jimDomain}"; realm = "turn.${config.domains.jim1}";
cert = "/var/lib/acme/turn.${config.secrets.jimDomain}.com/fullchain.pem"; cert = "/var/lib/acme/turn.${config.domains.jim1}.com/fullchain.pem";
pkey = "/var/lib/acme/turn.${config.secrets.jimDomain}.com/key.pem"; pkey = "/var/lib/acme/turn.${config.domains.jim1}.com/key.pem";
}; };
# Enable coturn on Synapse # Enable coturn on Synapse
matrix-synapse.settings = { matrix-synapse.settings = {
turn_uris = [ turn_uris = [
"turn:turn.${config.secrets.jimDomain}:3478?transport=udp" "turn:turn.${config.domains.jim1}:3478?transport=udp"
"turn:turn.${config.secrets.jimDomain}:3478?transport=tcp" "turn:turn.${config.domains.jim1}:3478?transport=tcp"
]; ];
turn_shared_secret = config.services.coturn.static-auth-secret; turn_shared_secret = config.services.coturn.static-auth-secret;
turn_user_lifetime = "1h"; turn_user_lifetime = "1h";

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
{ {
services.nginx.virtualHosts."turn.${config.secrets.jimDomain}" = { services.nginx.virtualHosts."turn.${config.domains.jim1}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
listen = [{ listen = [{
@ -12,7 +12,7 @@
}; };
security.acme.certs = { security.acme.certs = {
"turn.${config.secrets.jimDomain}" = { "turn.${config.domains.jim1}" = {
group = "turnserver"; group = "turnserver";
postRun = "systemctl restart coturn.service"; postRun = "systemctl restart coturn.service";
}; };

View file

@ -9,8 +9,8 @@
services.matrix-synapse = { services.matrix-synapse = {
enable = true; enable = true;
settings = { settings = {
server_name = "${config.secrets.jimDomain}"; server_name = "${config.domains.jim1}";
public_baseurl = "https://matrix.${config.secrets.jimDomain}"; public_baseurl = "https://matrix.${config.domains.jim1}";
suppress_key_server_warning = true; suppress_key_server_warning = true;
listeners = [{ listeners = [{
@ -23,9 +23,9 @@
}]; }];
email = { email = {
notif_from = "Jimbo's Matrix <noreply@${config.secrets.jimDomain}>"; notif_from = "Jimbo's Matrix <noreply@${config.domains.jim1}>";
smtp_host = "mx.${config.secrets.jimDomain}"; smtp_host = "mx.${config.domains.jim1}";
smtp_user = "noreply@${config.secrets.jimDomain}"; smtp_user = "noreply@${config.domains.jim1}";
smtp_pass = config.secrets.noreplyPassword; smtp_pass = config.secrets.noreplyPassword;
enable_tls = true; enable_tls = true;
smtp_port = 587; smtp_port = 587;
@ -36,10 +36,24 @@
registrations_require_3pid = [ "email" ]; registrations_require_3pid = [ "email" ];
# Allow only this range of emails # Allow only this range of emails
allowed_local_3pids = [{ allowed_local_3pids = [
medium = "email"; {
pattern = "^[^@]+@jimbosfiles\\.com$"; medium = "email";
}]; pattern = ''^[^@]+@jimbosfiles\.com$'';
}
{
medium = "email";
pattern = ''^[^@]+@nixfox\.ca$'';
}
{
medium = "email";
pattern = ''^[^@]+@freecorn1854\.win$'';
}
{
medium = "email";
pattern = ''^[^@]+@lunamoonlight\.xyz$'';
}
];
# Set the type of database # Set the type of database
database.name = "sqlite3"; database.name = "sqlite3";

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
{ {
services.nginx.virtualHosts."matrix.${config.secrets.jimDomain}" = { services.nginx.virtualHosts."matrix.${config.domains.jim1}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations = { locations = {

View file

@ -3,7 +3,7 @@
services.matrix-sliding-sync = { services.matrix-sliding-sync = {
enable = true; enable = true;
settings = { settings = {
SYNCV3_SERVER = "https://matrix.${config.secrets.jimDomain}"; SYNCV3_SERVER = "https://matrix.${config.domains.jim1}";
SYNCV3_BINDADDR = "0.0.0.0:8009"; SYNCV3_BINDADDR = "0.0.0.0:8009";
}; };
environmentFile = "${pkgs.writeText "matrixsecret" '' environmentFile = "${pkgs.writeText "matrixsecret" ''

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
{ {
services.nginx.virtualHosts."live.${config.secrets.jimDomain}" = { services.nginx.virtualHosts."live.${config.domains.jim1}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {

View file

@ -2,12 +2,12 @@
{ {
services.pixelfed = { services.pixelfed = {
enable = true; enable = true;
domain = "pics.${config.secrets.jimDomain}"; domain = "pics.${config.domains.jim1}";
secretFile = pkgs.writeText "appkey" config.secrets.pixelfedKey; secretFile = pkgs.writeText "appkey" config.secrets.pixelfedKey;
settings = { settings = {
APP_NAME = ''"Jimbo's Pixelfed"''; APP_NAME = ''"Jimbo's Pixelfed"'';
INSTANCE_DESCRIPTION = ''"The Jimbosfiles Pixelfed Instance"''; INSTANCE_DESCRIPTION = ''"The Jimbosfiles Pixelfed Instance"'';
INSTANCE_CONTACT_EMAIL = "jimbo@${config.secrets.jimDomain}"; INSTANCE_CONTACT_EMAIL = "jimbo@${config.domains.jim1}";
OPEN_REGISTRATION = true; OPEN_REGISTRATION = true;
APP_LOCALE = "en"; APP_LOCALE = "en";
INSTANCE_DISCOVER_PUBLIC = false; INSTANCE_DISCOVER_PUBLIC = false;
@ -15,13 +15,13 @@
# Mail config # Mail config
ENFORCE_EMAIL_VERIFICATION = true; ENFORCE_EMAIL_VERIFICATION = true;
MAIL_FROM_ADDRESS = "noreply@${config.secrets.jimDomain}"; MAIL_FROM_ADDRESS = "noreply@${config.domains.jim1}";
MAIL_FROM_NAME = ''"Jimbo's Pixelfed <noreply@${config.secrets.jimDomain}>"''; MAIL_FROM_NAME = ''"Jimbo's Pixelfed <noreply@${config.domains.jim1}>"'';
MAIL_ENCRYPTION = "tls"; MAIL_ENCRYPTION = "tls";
MAIL_DRIVER = "smtp"; MAIL_DRIVER = "smtp";
MAIL_HOST = "mx.${config.secrets.jimDomain}"; MAIL_HOST = "mx.${config.domains.jim1}";
MAIL_PORT = 587; MAIL_PORT = 587;
MAIL_USERNAME = "noreply@${config.secrets.jimDomain}"; MAIL_USERNAME = "noreply@${config.domains.jim1}";
MAIL_PASSWORD = "${config.secrets.noreplyPassword}"; MAIL_PASSWORD = "${config.secrets.noreplyPassword}";
}; };
nginx = { nginx = {

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
{ {
services.nginx.virtualHosts."torrent.${config.secrets.jimDomain}" = { services.nginx.virtualHosts."torrent.${config.domains.jim1}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {

View file

@ -7,17 +7,17 @@
services.vaultwarden = { services.vaultwarden = {
enable = true; enable = true;
config = { config = {
DOMAIN = "https://warden.${config.secrets.jimDomain}"; DOMAIN = "https://warden.${config.domains.jim1}";
SIGNUPS_ALLOWED = false; SIGNUPS_ALLOWED = false;
ROCKET_ADDRESS = "127.0.0.1"; ROCKET_ADDRESS = "127.0.0.1";
ROCKET_PORT = 8222; ROCKET_PORT = 8222;
ROCKET_LOG = "critical"; ROCKET_LOG = "critical";
# Smtp email # Smtp email
SMTP_HOST = "mx.${config.secrets.jimDomain}"; SMTP_HOST = "mx.${config.domains.jim1}";
SMTP_FROM = "Jimbo's Vaultwarden <noreply@${config.secrets.jimDomain}>"; SMTP_FROM = "noreply@${config.domains.jim1}";
SMTP_FROM_NAME = "Vaultwarden"; SMTP_FROM_NAME = "Vaultwarden";
SMTP_USERNAME = "noreply@${config.secrets.jimDomain}"; SMTP_USERNAME = "noreply@${config.domains.jim1}";
SMTP_PASSWORD = config.secrets.noreplyPassword; SMTP_PASSWORD = config.secrets.noreplyPassword;
SMTP_SECURITY = "starttls"; SMTP_SECURITY = "starttls";
SMTP_PORT = 587; SMTP_PORT = 587;

View file

@ -1,6 +1,6 @@
{ config, ... }: { config, ... }:
{ {
services.nginx.virtualHosts."warden.${config.secrets.jimDomain}" = { services.nginx.virtualHosts."warden.${config.domains.jim1}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {

View file

@ -1,7 +1,7 @@
{ pkgs, config, ... }: { pkgs, config, ... }:
{ {
services.nginx.virtualHosts = { services.nginx.virtualHosts = {
"${config.secrets.jimDomain}" = { "${config.domains.jim1}" = {
enableACME = true; enableACME = true;
addSSL = true; addSSL = true;
root = "/var/www/Jimbo-Landing-Page"; root = "/var/www/Jimbo-Landing-Page";
@ -12,13 +12,13 @@
return 200 ' return 200 '
{ {
"m.homeserver": { "m.homeserver": {
"base_url": "https://matrix.${config.secrets.jimDomain}" "base_url": "https://matrix.${config.domains.jim1}"
}, },
"m.identity_server": { "m.identity_server": {
"base_url": "https://matrix.org" "base_url": "https://matrix.org"
}, },
"org.matrix.msc3575.proxy": { "org.matrix.msc3575.proxy": {
"url": "https://matrix.${config.secrets.jimDomain}" "url": "https://matrix.${config.domains.jim1}"
} }
}'; }';
''; '';
@ -26,7 +26,7 @@
"/.well-known/matrix/server" = { "/.well-known/matrix/server" = {
extraConfig = '' extraConfig = ''
default_type application/json; default_type application/json;
return 200 '{"m.server": "matrix.${config.secrets.jimDomain}:443"}'; return 200 '{"m.server": "matrix.${config.domains.jim1}:443"}';
''; '';
}; };
}; };

View file

@ -2,6 +2,7 @@
{ {
imports = [ imports = [
./displays ./displays
./domains
./ips ./ips
./look ./look
./secrets ./secrets

View file

@ -0,0 +1,14 @@
{ lib, config, ... }:
{
options.domains = lib.mkOption {
type = lib.types.attrs;
default = {};
};
config.domains = {
jim1 = "jimbosfiles.com";
jim2 = "nixfox.ca";
corn = "freecorn1854.win";
luna = "lunamoonlight.xyz";
};
}