diff --git a/hosts/bomberman/home/default.nix b/hosts/bomberman/home/default.nix index 6afa91a..c6c69e7 100644 --- a/hosts/bomberman/home/default.nix +++ b/hosts/bomberman/home/default.nix @@ -13,6 +13,7 @@ ../../../modules/home/utils/zsh # Misc + ../../../variables/domains ../../../variables/look/colors/purple ]; } diff --git a/hosts/cyberspark/home/default.nix b/hosts/cyberspark/home/default.nix index 6afa91a..c6c69e7 100644 --- a/hosts/cyberspark/home/default.nix +++ b/hosts/cyberspark/home/default.nix @@ -13,6 +13,7 @@ ../../../modules/home/utils/zsh # Misc + ../../../variables/domains ../../../variables/look/colors/purple ]; } diff --git a/modules/home/programs/terminal/git/default.nix b/modules/home/programs/terminal/git/default.nix index fb7e696..20638f0 100644 --- a/modules/home/programs/terminal/git/default.nix +++ b/modules/home/programs/terminal/git/default.nix @@ -1,8 +1,8 @@ -{ pkgs, ... }: +{ config, ... }: { programs.git = { enable = true; userName = "Jimbo"; - userEmail = "jimbo@jimbosfiles.com"; + userEmail = "jimbo@${config.domains.jim2}"; }; } diff --git a/modules/system/services/server/ddclient/default.nix b/modules/system/services/server/ddclient/default.nix index 417a7ad..ab66c91 100644 --- a/modules/system/services/server/ddclient/default.nix +++ b/modules/system/services/server/ddclient/default.nix @@ -4,20 +4,20 @@ enable = true; protocol = "cloudflare"; use = "web, web=https://ipinfo.io/ip"; - zone = "${config.secrets.jimDomain}"; + zone = "${config.domains.jim1}"; username = "token"; passwordFile = "${pkgs.writeText "cloudflareapikey" config.secrets.flareApiKey}"; domains = [ - "${config.secrets.jimDomain}" - "*.${config.secrets.jimDomain}" - "sv.${config.secrets.jimDomain}" - "git.${config.secrets.jimDomain}" - "rtmp.${config.secrets.jimDomain}" - "turn.${config.secrets.jimDomain}" - "dew.${config.secrets.jimDomain}" - "john.${config.secrets.jimDomain}" - "beta.${config.secrets.jimDomain}" - "rogue.${config.secrets.jimDomain}" + "${config.domains.jim1}" + "*.${config.domains.jim1}" + "sv.${config.domains.jim1}" + "git.${config.domains.jim1}" + "rtmp.${config.domains.jim1}" + "turn.${config.domains.jim1}" + "dew.${config.domains.jim1}" + "john.${config.domains.jim1}" + "beta.${config.domains.jim1}" + "rogue.${config.domains.jim1}" ]; }; } diff --git a/modules/system/services/server/fileserver/public/nextcloud/default.nix b/modules/system/services/server/fileserver/public/nextcloud/default.nix index d69370d..7c2129e 100644 --- a/modules/system/services/server/fileserver/public/nextcloud/default.nix +++ b/modules/system/services/server/fileserver/public/nextcloud/default.nix @@ -4,7 +4,7 @@ nextcloud = { enable = true; package = pkgs.nextcloud29; - hostName = "cloud.${config.secrets.jimDomain}"; + hostName = "cloud.${config.domains.jim1}"; datadir = "/mnt/nextcloud"; https = true; config = { @@ -13,20 +13,20 @@ }; settings = { trusted_proxies = [ "127.0.0.1" ]; - trusted_domains = [ "cloud.${config.secrets.jimDomain}" ]; + trusted_domains = [ "cloud.${config.domains.jim1}" ]; overwriteprotocol = "https"; - mail_smtphost = "mx.${config.secrets.jimDomain}"; - mail_domain = "${config.secrets.jimDomain}"; + mail_smtphost = "mx.${config.domains.jim1}"; + mail_domain = "${config.domains.jim1}"; mail_from_address = "noreply"; mail_smtpauth = "true"; - mail_smtpname = "noreply@${config.secrets.jimDomain}"; + mail_smtpname = "noreply@${config.domains.jim1}"; mail_smtppassword = config.secrets.noreplyPassword; mail_smtpmode = "smtp"; mail_smtpport = 587; }; }; - nginx.virtualHosts."cloud.${config.secrets.jimDomain}" = { + nginx.virtualHosts."cloud.${config.domains.jim1}" = { enableACME = true; addSSL = true; locations."/" = { diff --git a/modules/system/services/server/fileserver/public/photoprism/default.nix b/modules/system/services/server/fileserver/public/photoprism/default.nix index 635354c..59b01ef 100644 --- a/modules/system/services/server/fileserver/public/photoprism/default.nix +++ b/modules/system/services/server/fileserver/public/photoprism/default.nix @@ -14,11 +14,11 @@ PHOTOPRISM_DATABASE_NAME = "photoprism"; PHOTOPRISM_DATABASE_SERVER = "/run/mysqld/mysqld.sock"; 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"; }; }; - nginx.virtualHosts."gallery.${config.secrets.jimDomain}" = { + nginx.virtualHosts."gallery.${config.domains.jim1}" = { enableACME = true; forceSSL = true; locations."/" = { diff --git a/modules/system/services/server/forgejo/default.nix b/modules/system/services/server/forgejo/default.nix index 93a5ee0..e03ca36 100644 --- a/modules/system/services/server/forgejo/default.nix +++ b/modules/system/services/server/forgejo/default.nix @@ -9,8 +9,8 @@ enable = true; settings = { server = { - DOMAIN = "git.${config.secrets.jimDomain}"; - ROOT_URL = "https://git.${config.secrets.jimDomain}:443"; + DOMAIN = "git.${config.domains.jim1}"; + ROOT_URL = "https://git.${config.domains.jim1}:443"; HTTP_PORT = 3110; SSH_PORT = 2299; START_SSH_SERVER = true; @@ -20,9 +20,9 @@ }; mailer = { ENABLED = true; - SMTP_ADDR = "mx.${config.secrets.jimDomain}"; - FROM = "Jimbo's Git "; - USER = "noreply@${config.secrets.jimDomain}"; + SMTP_ADDR = "mx.${config.domains.jim1}"; + FROM = "Jimbo's Git "; + USER = "noreply@${config.domains.jim1}"; PASSWD = config.secrets.noreplyPassword; PROTOCOL = "smtps"; }; diff --git a/modules/system/services/server/forgejo/nginx/default.nix b/modules/system/services/server/forgejo/nginx/default.nix index ded93dd..23354d7 100644 --- a/modules/system/services/server/forgejo/nginx/default.nix +++ b/modules/system/services/server/forgejo/nginx/default.nix @@ -1,6 +1,6 @@ { config, ... }: { - services.nginx.virtualHosts."git.${config.secrets.jimDomain}" = { + services.nginx.virtualHosts."git.${config.domains.jim1}" = { enableACME = true; forceSSL = true; locations."/" = { diff --git a/modules/system/services/server/icecast/default.nix b/modules/system/services/server/icecast/default.nix index 3fd4fbe..f2aff00 100644 --- a/modules/system/services/server/icecast/default.nix +++ b/modules/system/services/server/icecast/default.nix @@ -8,7 +8,7 @@ icecast = { enable = true; listen.port = 265; - hostname = "icecast.${config.secrets.jimDomain}"; + hostname = "icecast.${config.domains.jim1}"; admin = { user = "jimbo"; password = "${config.secrets.castAdminPass}"; @@ -19,7 +19,7 @@ Canada - jimbo@jimbosfiles.com + jimbo@${config.domains.jim2} /jimbops.opus diff --git a/modules/system/services/server/icecast/nginx/default.nix b/modules/system/services/server/icecast/nginx/default.nix index 968b4d7..ba97eab 100644 --- a/modules/system/services/server/icecast/nginx/default.nix +++ b/modules/system/services/server/icecast/nginx/default.nix @@ -1,6 +1,6 @@ { config, ... }: { - services.nginx.virtualHosts."icecast.${config.secrets.jimDomain}" = { + services.nginx.virtualHosts."icecast.${config.domains.jim1}" = { enableACME = true; forceSSL = true; locations."/" = { diff --git a/modules/system/services/server/mailserver/roundcube/default.nix b/modules/system/services/server/mailserver/roundcube/default.nix index 5dfeab3..e986536 100644 --- a/modules/system/services/server/mailserver/roundcube/default.nix +++ b/modules/system/services/server/mailserver/roundcube/default.nix @@ -2,9 +2,9 @@ { services.roundcube = { enable = true; - hostName = "mail.${config.secrets.jimDomain}"; + hostName = "mail.${config.domains.jim1}"; extraConfig = '' - $config['smtp_server'] = "tls://mx.${config.secrets.jimDomain}"; + $config['smtp_server'] = "tls://mx.${config.domains.jim1}"; $config['smtp_user'] = "%u"; $config['smtp_pass'] = "%p"; ''; diff --git a/modules/system/services/server/mailserver/simplenix/default.nix b/modules/system/services/server/mailserver/simplenix/default.nix index b36c04c..385ab6d 100644 --- a/modules/system/services/server/mailserver/simplenix/default.nix +++ b/modules/system/services/server/mailserver/simplenix/default.nix @@ -8,46 +8,46 @@ mailserver = rec { enable = true; domains = [ - "${config.secrets.jimDomain}" - "${config.secrets.jimDomain2}" - "${config.secrets.lunaDomain}" - "${config.secrets.cornDomain}" + "${config.domains.jim1}" + "${config.domains.jim2}" + "${config.domains.luna}" + "${config.domains.corn}" ]; - fqdn = "mx.${config.secrets.jimDomain}"; + fqdn = "mx.${config.domains.jim1}"; certificateScheme = "acme-nginx"; localDnsResolver = false; redis.port = 1515; dmarcReporting = { enable = true; - domain = "${config.secrets.jimDomain}"; + domain = "${config.domains.jim1}"; localpart = "noreply"; organizationName = "Jimbo's Files"; }; # A list of accounts, passwords generated with nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' loginAccounts = { - "noreply@${config.secrets.jimDomain}" = { + "noreply@${config.domains.jim1}" = { hashedPasswordFile = pkgs.writeText "noreply" config.secrets.noreplyMailHash; sendOnly = true; }; - "jimbo@${config.secrets.jimDomain2}" = { + "jimbo@${config.domains.jim12}" = { hashedPasswordFile = pkgs.writeText "jimbo" config.secrets.jimboMailHash; aliases = [ - "jimbo@${config.secrets.jimDomain}" - "james@${config.secrets.jimDomain}" - "james@${config.secrets.jimDomain2}" - "contact@${config.secrets.jimDomain}" - "contact@${config.secrets.jimDomain2}" + "jimbo@${config.domains.jim1}" + "james@${config.domains.jim1}" + "james@${config.domains.jim2}" + "contact@${config.domains.jim1}" + "contact@${config.domains.jim2}" ]; }; - "luna@${config.secrets.lunaDomain}" = { + "luna@${config.domains.luna}" = { hashedPasswordFile = pkgs.writeText "luna" config.secrets.lunaMailHash; }; - "corn@${config.secrets.cornDomain}" = { + "corn@${config.domains.corn}" = { hashedPasswordFile = pkgs.writeText "corn" config.secrets.cornMailHash; }; - "tiny@${config.secrets.cornDomain}" = { + "tiny@${config.domains.corn}" = { hashedPasswordFile = pkgs.writeText "tiny" config.secrets.tinyMailHash; }; }; diff --git a/modules/system/services/server/mailserver/simplenix/nginx/default.nix b/modules/system/services/server/mailserver/simplenix/nginx/default.nix index 0bc1749..e0a30d5 100644 --- a/modules/system/services/server/mailserver/simplenix/nginx/default.nix +++ b/modules/system/services/server/mailserver/simplenix/nginx/default.nix @@ -1,6 +1,6 @@ { pkgs, config, ... }: { - services.nginx.virtualHosts."mx.${config.secrets.jimDomain}" = { + services.nginx.virtualHosts."mx.${config.domains.jim1}" = { enableACME = true; forceSSL = true; locations."/" = { diff --git a/modules/system/services/server/minecraft/servers/johnside/default.nix b/modules/system/services/server/minecraft/servers/johnside/default.nix index ea56fd6..4a26847 100644 --- a/modules/system/services/server/minecraft/servers/johnside/default.nix +++ b/modules/system/services/server/minecraft/servers/johnside/default.nix @@ -43,7 +43,7 @@ in { }; # BlueMap webhost - nginx.virtualHosts."john.${config.secrets.jimDomain}" = { + nginx.virtualHosts."john.${config.domains.jim1}" = { enableACME = true; forceSSL = true; 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 - ]; - }; } diff --git a/modules/system/services/server/minecraft/servers/roguecraft/default.nix b/modules/system/services/server/minecraft/servers/roguecraft/default.nix index db23c8a..a3b5537 100644 --- a/modules/system/services/server/minecraft/servers/roguecraft/default.nix +++ b/modules/system/services/server/minecraft/servers/roguecraft/default.nix @@ -12,19 +12,19 @@ in { server-port = 30014; motd = "\\u00A7l\\u00A7bJimbo's \\u00A7cRoguecraft \\u00A7bserver."; require-resource-pack = true; - resource-pack = "https://${config.secrets.jimDomain}/roguecraftresourcepackredir"; + resource-pack = "https://${config.domains.jim1}/roguecraftresourcepackredir"; resource-pack-sha1 = "b540c0562aba90c3ead2356bb9cb74fcf0db36b3"; }; whitelist = common.whitelist; symlinks = common.paperSymlinks; files = common.configFiles // { "world/datapacks/roguecraft.zip" = builtins.fetchurl { - url = "https://${config.secrets.jimDomain}/roguecraftdatapackredir"; + url = "https://${config.domains.jim1}/roguecraftdatapackredir"; sha256 = "04zrkvzvi1i898al45fh9j3k635sf9qhwca7phbv4ynkfl8bz3q3"; }; }; }; - nginx.virtualHosts."${config.secrets.jimDomain}".locations = { + nginx.virtualHosts."${config.domains.jim1}".locations = { "/roguecraftdatapackredir" = { return = "301 https://cdn.modrinth.com/data/HtKjVijx/versions/Rme4c23R/Roguecraft%201.2.6%20-%20Data%20Pack.zip"; }; diff --git a/modules/system/services/server/minecraft/servers/velocity/default.nix b/modules/system/services/server/minecraft/servers/velocity/default.nix index 27fe34a..48a3ca7 100644 --- a/modules/system/services/server/minecraft/servers/velocity/default.nix +++ b/modules/system/services/server/minecraft/servers/velocity/default.nix @@ -40,11 +40,18 @@ in { # Open ports for proxy networking.firewall = { + # Server and info allowedTCPPorts = [ - 25565 19132 30013 5657 # Minecraft server info + 25565 + 19132 + 30013 + 5657 ]; + # Server, VC, and Bedrock allowedUDPPorts = [ - 25565 19132 30013 # Minecraft server, VC, and Bedrock + 25565 + 19132 + 30013 ]; }; } diff --git a/modules/system/services/server/social/lemmy/default.nix b/modules/system/services/server/social/lemmy/default.nix index 3de0d9a..1704165 100644 --- a/modules/system/services/server/social/lemmy/default.nix +++ b/modules/system/services/server/social/lemmy/default.nix @@ -9,11 +9,11 @@ nginx.enable = true; database.createLocally = true; settings = { - hostname = "lemmy.${config.secrets.jimDomain}"; + hostname = "lemmy.${config.domains.jim1}"; email = { - smtp_server = "mx.${config.secrets.jimDomain}:587"; - smtp_login = "noreply@${config.secrets.jimDomain}"; - smtp_from_address = "Jimbo's Lemmy "; + smtp_server = "mx.${config.domains.jim1}:587"; + smtp_login = "noreply@${config.domains.jim1}"; + smtp_from_address = "Jimbo's Lemmy "; smtp_password = config.secrets.noreplyPassword; tls_type = "starttls"; }; diff --git a/modules/system/services/server/social/lemmy/nginx/default.nix b/modules/system/services/server/social/lemmy/nginx/default.nix index 95aaa98..60d6c03 100644 --- a/modules/system/services/server/social/lemmy/nginx/default.nix +++ b/modules/system/services/server/social/lemmy/nginx/default.nix @@ -1,6 +1,6 @@ { config, ... }: { - services.nginx.virtualHosts."lemmy.${config.secrets.jimDomain}" = { + services.nginx.virtualHosts."lemmy.${config.domains.jim1}" = { enableACME = true; forceSSL = true; }; diff --git a/modules/system/services/server/social/mastodon/default.nix b/modules/system/services/server/social/mastodon/default.nix index e9205f2..eedc290 100644 --- a/modules/system/services/server/social/mastodon/default.nix +++ b/modules/system/services/server/social/mastodon/default.nix @@ -2,16 +2,16 @@ { services.mastodon = { enable = true; - localDomain = "social.${config.secrets.jimDomain}"; + localDomain = "social.${config.domains.jim1}"; streamingProcesses = 4; configureNginx = true; smtp = { createLocally = false; - host = "mx.${config.secrets.jimDomain}"; + host = "mx.${config.domains.jim1}"; port = 587; authenticate = true; - fromAddress = "Jimbo's Mastodon "; - user = "noreply@${config.secrets.jimDomain}"; + fromAddress = "Jimbo's Mastodon "; + user = "noreply@${config.domains.jim1}"; passwordFile = pkgs.writeText "smtp_pass.txt" config.secrets.noreplyPassword; }; }; diff --git a/modules/system/services/server/social/matrix/element/default.nix b/modules/system/services/server/social/matrix/element/default.nix index 908a09c..3018816 100644 --- a/modules/system/services/server/social/matrix/element/default.nix +++ b/modules/system/services/server/social/matrix/element/default.nix @@ -7,16 +7,16 @@ nixpkgs.config.element-web.conf = { default_server_config = { "m.homeserver" = { - base_url = "https://matrix.${config.secrets.jimDomain}"; - server_name = "matrix.${config.secrets.jimDomain}"; + base_url = "https://matrix.${config.domains.jim1}"; + server_name = "matrix.${config.domains.jim1}"; }; }; branding = { - #welcome_background_url = "https://staging.${config.secrets.jimDomain}/images/backgrounds/bloxelcom-sunset.jpg"; - #auth_header_logo_url = "https://staging.${config.secrets.jimDomain}/images/logos/bloxelcom.png"; + #welcome_background_url = "https://staging.${config.domains.jim1}/images/backgrounds/template-background.png"; + #auth_header_logo_url = "https://staging.${config.domains.jim1}/images/logos/template-logo.png"; }; embedded_pages = { - home_url = "https://www.${config.secrets.jimDomain}/"; + home_url = "https://www.${config.domains.jim1}/"; }; disable_custom_urls = true; disable_guests = true; diff --git a/modules/system/services/server/social/matrix/element/nginx/default.nix b/modules/system/services/server/social/matrix/element/nginx/default.nix index 693f716..4308c4c 100644 --- a/modules/system/services/server/social/matrix/element/nginx/default.nix +++ b/modules/system/services/server/social/matrix/element/nginx/default.nix @@ -1,6 +1,6 @@ { pkgs, config, ... }: { - services.nginx.virtualHosts."chat.${config.secrets.jimDomain}" = { + services.nginx.virtualHosts."chat.${config.domains.jim1}" = { enableACME = true; addSSL = true; root = "${pkgs.element-web}"; diff --git a/modules/system/services/server/social/matrix/synapse/coturn/default.nix b/modules/system/services/server/social/matrix/synapse/coturn/default.nix index a3e0a33..01c1913 100644 --- a/modules/system/services/server/social/matrix/synapse/coturn/default.nix +++ b/modules/system/services/server/social/matrix/synapse/coturn/default.nix @@ -13,16 +13,16 @@ max-port = 50000; use-auth-secret = true; static-auth-secret = "will be world readable for local users :("; - realm = "turn.${config.secrets.jimDomain}"; - cert = "/var/lib/acme/turn.${config.secrets.jimDomain}.com/fullchain.pem"; - pkey = "/var/lib/acme/turn.${config.secrets.jimDomain}.com/key.pem"; + realm = "turn.${config.domains.jim1}"; + cert = "/var/lib/acme/turn.${config.domains.jim1}.com/fullchain.pem"; + pkey = "/var/lib/acme/turn.${config.domains.jim1}.com/key.pem"; }; # Enable coturn on Synapse matrix-synapse.settings = { turn_uris = [ - "turn:turn.${config.secrets.jimDomain}:3478?transport=udp" - "turn:turn.${config.secrets.jimDomain}:3478?transport=tcp" + "turn:turn.${config.domains.jim1}:3478?transport=udp" + "turn:turn.${config.domains.jim1}:3478?transport=tcp" ]; turn_shared_secret = config.services.coturn.static-auth-secret; turn_user_lifetime = "1h"; diff --git a/modules/system/services/server/social/matrix/synapse/coturn/nginx/default.nix b/modules/system/services/server/social/matrix/synapse/coturn/nginx/default.nix index 2b9cdac..ffb9884 100644 --- a/modules/system/services/server/social/matrix/synapse/coturn/nginx/default.nix +++ b/modules/system/services/server/social/matrix/synapse/coturn/nginx/default.nix @@ -1,6 +1,6 @@ { config, ... }: { - services.nginx.virtualHosts."turn.${config.secrets.jimDomain}" = { + services.nginx.virtualHosts."turn.${config.domains.jim1}" = { enableACME = true; forceSSL = true; listen = [{ @@ -12,7 +12,7 @@ }; security.acme.certs = { - "turn.${config.secrets.jimDomain}" = { + "turn.${config.domains.jim1}" = { group = "turnserver"; postRun = "systemctl restart coturn.service"; }; diff --git a/modules/system/services/server/social/matrix/synapse/default.nix b/modules/system/services/server/social/matrix/synapse/default.nix index 8c2588e..d889c86 100644 --- a/modules/system/services/server/social/matrix/synapse/default.nix +++ b/modules/system/services/server/social/matrix/synapse/default.nix @@ -9,8 +9,8 @@ services.matrix-synapse = { enable = true; settings = { - server_name = "${config.secrets.jimDomain}"; - public_baseurl = "https://matrix.${config.secrets.jimDomain}"; + server_name = "${config.domains.jim1}"; + public_baseurl = "https://matrix.${config.domains.jim1}"; suppress_key_server_warning = true; listeners = [{ @@ -23,9 +23,9 @@ }]; email = { - notif_from = "Jimbo's Matrix "; - smtp_host = "mx.${config.secrets.jimDomain}"; - smtp_user = "noreply@${config.secrets.jimDomain}"; + notif_from = "Jimbo's Matrix "; + smtp_host = "mx.${config.domains.jim1}"; + smtp_user = "noreply@${config.domains.jim1}"; smtp_pass = config.secrets.noreplyPassword; enable_tls = true; smtp_port = 587; @@ -36,10 +36,24 @@ registrations_require_3pid = [ "email" ]; # Allow only this range of emails - allowed_local_3pids = [{ - medium = "email"; - pattern = "^[^@]+@jimbosfiles\\.com$"; - }]; + allowed_local_3pids = [ + { + 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 database.name = "sqlite3"; diff --git a/modules/system/services/server/social/matrix/synapse/nginx/default.nix b/modules/system/services/server/social/matrix/synapse/nginx/default.nix index 80a784a..74ebb8d 100644 --- a/modules/system/services/server/social/matrix/synapse/nginx/default.nix +++ b/modules/system/services/server/social/matrix/synapse/nginx/default.nix @@ -1,6 +1,6 @@ { config, ... }: { - services.nginx.virtualHosts."matrix.${config.secrets.jimDomain}" = { + services.nginx.virtualHosts."matrix.${config.domains.jim1}" = { enableACME = true; forceSSL = true; locations = { diff --git a/modules/system/services/server/social/matrix/synapse/slidingsync/default.nix b/modules/system/services/server/social/matrix/synapse/slidingsync/default.nix index 31a82c8..bad4f59 100644 --- a/modules/system/services/server/social/matrix/synapse/slidingsync/default.nix +++ b/modules/system/services/server/social/matrix/synapse/slidingsync/default.nix @@ -3,7 +3,7 @@ services.matrix-sliding-sync = { enable = true; settings = { - SYNCV3_SERVER = "https://matrix.${config.secrets.jimDomain}"; + SYNCV3_SERVER = "https://matrix.${config.domains.jim1}"; SYNCV3_BINDADDR = "0.0.0.0:8009"; }; environmentFile = "${pkgs.writeText "matrixsecret" '' diff --git a/modules/system/services/server/social/owncast/nginx/default.nix b/modules/system/services/server/social/owncast/nginx/default.nix index 97eebc0..01b6e59 100644 --- a/modules/system/services/server/social/owncast/nginx/default.nix +++ b/modules/system/services/server/social/owncast/nginx/default.nix @@ -1,6 +1,6 @@ { config, ... }: { - services.nginx.virtualHosts."live.${config.secrets.jimDomain}" = { + services.nginx.virtualHosts."live.${config.domains.jim1}" = { enableACME = true; forceSSL = true; locations."/" = { diff --git a/modules/system/services/server/social/pixelfed/default.nix b/modules/system/services/server/social/pixelfed/default.nix index 39925e2..62fdfe6 100644 --- a/modules/system/services/server/social/pixelfed/default.nix +++ b/modules/system/services/server/social/pixelfed/default.nix @@ -2,12 +2,12 @@ { services.pixelfed = { enable = true; - domain = "pics.${config.secrets.jimDomain}"; + domain = "pics.${config.domains.jim1}"; secretFile = pkgs.writeText "appkey" config.secrets.pixelfedKey; settings = { APP_NAME = ''"Jimbo's Pixelfed"''; INSTANCE_DESCRIPTION = ''"The Jimbosfiles Pixelfed Instance"''; - INSTANCE_CONTACT_EMAIL = "jimbo@${config.secrets.jimDomain}"; + INSTANCE_CONTACT_EMAIL = "jimbo@${config.domains.jim1}"; OPEN_REGISTRATION = true; APP_LOCALE = "en"; INSTANCE_DISCOVER_PUBLIC = false; @@ -15,13 +15,13 @@ # Mail config ENFORCE_EMAIL_VERIFICATION = true; - MAIL_FROM_ADDRESS = "noreply@${config.secrets.jimDomain}"; - MAIL_FROM_NAME = ''"Jimbo's Pixelfed "''; + MAIL_FROM_ADDRESS = "noreply@${config.domains.jim1}"; + MAIL_FROM_NAME = ''"Jimbo's Pixelfed "''; MAIL_ENCRYPTION = "tls"; MAIL_DRIVER = "smtp"; - MAIL_HOST = "mx.${config.secrets.jimDomain}"; + MAIL_HOST = "mx.${config.domains.jim1}"; MAIL_PORT = 587; - MAIL_USERNAME = "noreply@${config.secrets.jimDomain}"; + MAIL_USERNAME = "noreply@${config.domains.jim1}"; MAIL_PASSWORD = "${config.secrets.noreplyPassword}"; }; nginx = { diff --git a/modules/system/services/server/transmission/nginx/default.nix b/modules/system/services/server/transmission/nginx/default.nix index 8b2103b..a980c61 100644 --- a/modules/system/services/server/transmission/nginx/default.nix +++ b/modules/system/services/server/transmission/nginx/default.nix @@ -1,6 +1,6 @@ { config, ... }: { - services.nginx.virtualHosts."torrent.${config.secrets.jimDomain}" = { + services.nginx.virtualHosts."torrent.${config.domains.jim1}" = { enableACME = true; forceSSL = true; locations."/" = { diff --git a/modules/system/services/server/vaultwarden/default.nix b/modules/system/services/server/vaultwarden/default.nix index 1bd8625..af70c23 100644 --- a/modules/system/services/server/vaultwarden/default.nix +++ b/modules/system/services/server/vaultwarden/default.nix @@ -7,17 +7,17 @@ services.vaultwarden = { enable = true; config = { - DOMAIN = "https://warden.${config.secrets.jimDomain}"; + DOMAIN = "https://warden.${config.domains.jim1}"; SIGNUPS_ALLOWED = false; ROCKET_ADDRESS = "127.0.0.1"; ROCKET_PORT = 8222; ROCKET_LOG = "critical"; # Smtp email - SMTP_HOST = "mx.${config.secrets.jimDomain}"; - SMTP_FROM = "Jimbo's Vaultwarden "; + SMTP_HOST = "mx.${config.domains.jim1}"; + SMTP_FROM = "noreply@${config.domains.jim1}"; SMTP_FROM_NAME = "Vaultwarden"; - SMTP_USERNAME = "noreply@${config.secrets.jimDomain}"; + SMTP_USERNAME = "noreply@${config.domains.jim1}"; SMTP_PASSWORD = config.secrets.noreplyPassword; SMTP_SECURITY = "starttls"; SMTP_PORT = 587; diff --git a/modules/system/services/server/vaultwarden/nginx/default.nix b/modules/system/services/server/vaultwarden/nginx/default.nix index 7f4f33c..cec70c5 100644 --- a/modules/system/services/server/vaultwarden/nginx/default.nix +++ b/modules/system/services/server/vaultwarden/nginx/default.nix @@ -1,6 +1,6 @@ { config, ... }: { - services.nginx.virtualHosts."warden.${config.secrets.jimDomain}" = { + services.nginx.virtualHosts."warden.${config.domains.jim1}" = { enableACME = true; forceSSL = true; locations."/" = { diff --git a/modules/system/services/server/webhost/virtualhosts/jimDomain/default.nix b/modules/system/services/server/webhost/virtualhosts/jimDomain/default.nix index 0d36d87..be8e6e5 100644 --- a/modules/system/services/server/webhost/virtualhosts/jimDomain/default.nix +++ b/modules/system/services/server/webhost/virtualhosts/jimDomain/default.nix @@ -1,7 +1,7 @@ { pkgs, config, ... }: { services.nginx.virtualHosts = { - "${config.secrets.jimDomain}" = { + "${config.domains.jim1}" = { enableACME = true; addSSL = true; root = "/var/www/Jimbo-Landing-Page"; @@ -12,13 +12,13 @@ return 200 ' { "m.homeserver": { - "base_url": "https://matrix.${config.secrets.jimDomain}" + "base_url": "https://matrix.${config.domains.jim1}" }, "m.identity_server": { "base_url": "https://matrix.org" }, "org.matrix.msc3575.proxy": { - "url": "https://matrix.${config.secrets.jimDomain}" + "url": "https://matrix.${config.domains.jim1}" } }'; ''; @@ -26,7 +26,7 @@ "/.well-known/matrix/server" = { extraConfig = '' default_type application/json; - return 200 '{"m.server": "matrix.${config.secrets.jimDomain}:443"}'; + return 200 '{"m.server": "matrix.${config.domains.jim1}:443"}'; ''; }; }; diff --git a/variables/default.nix b/variables/default.nix index 2d9ca9a..0c75a33 100644 --- a/variables/default.nix +++ b/variables/default.nix @@ -2,6 +2,7 @@ { imports = [ ./displays + ./domains ./ips ./look ./secrets diff --git a/variables/domains/default.nix b/variables/domains/default.nix new file mode 100644 index 0000000..966bf5b --- /dev/null +++ b/variables/domains/default.nix @@ -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"; + }; +}