Update a lot of options, simplify variables, replace options with tags
This commit is contained in:
parent
dbc0ab6dd3
commit
7667ef9a1b
147 changed files with 663 additions and 928 deletions
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
config = lib.mkIf config.services.cloudflare-dyndns.enable {
|
||||
services.cloudflare-dyndns.apiTokenFile = "/var/lib/private/cloudflare-dyndns/key";
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
./forgejo
|
||||
./icecast
|
||||
./jellyfin
|
||||
./lemmy
|
||||
./mailserver
|
||||
./mastodon
|
||||
./matrix
|
||||
|
|
|
@ -8,17 +8,17 @@
|
|||
lfs.enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
DOMAIN = "git.nixfox.ca";
|
||||
ROOT_URL = "https://git.nixfox.ca:443";
|
||||
DOMAIN = "git.${config.vars.mainDomain}";
|
||||
ROOT_URL = "https://git.${config.vars.mainDomain}:443";
|
||||
HTTP_PORT = 3110;
|
||||
SSH_PORT = 2299;
|
||||
START_SSH_SERVER = true;
|
||||
};
|
||||
mailer = {
|
||||
ENABLED = true;
|
||||
SMTP_ADDR = "mx.nixfox.ca";
|
||||
FROM = "NixFox Git <noreply@nixfox.ca>";
|
||||
USER = "noreply@nixfox.ca";
|
||||
SMTP_ADDR = "mx.${config.vars.mainDomain}";
|
||||
FROM = "NixFox Git <noreply@${config.vars.mainDomain}>";
|
||||
USER = "noreply@${config.vars.mainDomain}";
|
||||
PASSWD = config.secrets.mailPass.nixfoxNoReply;
|
||||
PROTOCOL = "smtps";
|
||||
};
|
||||
|
@ -32,7 +32,7 @@
|
|||
|
||||
networking.firewall.allowedTCPPorts = [ 2299 ];
|
||||
|
||||
services.cloudflare-dyndns.domains = [ "git.nixfox.ca" ];
|
||||
services.cloudflare-dyndns.domains = [ "git.${config.vars.mainDomain}" ];
|
||||
|
||||
environment.persistence."/persist".directories = [ "/var/lib/forgejo" ];
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."git.nixfox.ca" = lib.mkIf config.services.forgejo.enable {
|
||||
services.nginx.virtualHosts."git.${config.vars.mainDomain}" = lib.mkIf config.services.forgejo.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
|
||||
services.icecast = {
|
||||
listen.port = 73;
|
||||
hostname = "radio.nixfox.ca";
|
||||
hostname = "radio.${config.vars.mainDomain}";
|
||||
admin = {
|
||||
user = config.sysusers.main;
|
||||
user = "admin";
|
||||
password = config.secrets.cast.adminPass;
|
||||
};
|
||||
extraConf = ''
|
||||
|
@ -17,7 +17,7 @@
|
|||
<source-password>${config.secrets.cast.sourcePass}</source-password>
|
||||
</authentication>
|
||||
<location>Canada</location>
|
||||
<admin>contact@nixfox.ca</admin>
|
||||
<admin>contact@${config.vars.mainDomain}</admin>
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."radio.nixfox.ca" = lib.mkIf config.services.icecast.enable {
|
||||
services.nginx.virtualHosts."radio.${config.vars.mainDomain}" = lib.mkIf config.services.icecast.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."jelly.nixfox.ca" = lib.mkIf config.services.jellyfin.enable {
|
||||
services.nginx.virtualHosts."jelly.${config.vars.mainDomain}" = lib.mkIf config.services.jellyfin.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [ ./nginx ];
|
||||
|
||||
config = lib.mkIf config.services.lemmy.enable {
|
||||
services.lemmy = lib.mkIf config.services.lemmy.enable {
|
||||
nginx.enable = true;
|
||||
database.createLocally = true;
|
||||
settings = {
|
||||
hostname = "lemmy.nixfox.ca";
|
||||
email = {
|
||||
smtp_server = "mx.nixfox.ca:587";
|
||||
smtp_login = "noreply@nixfox.ca";
|
||||
smtp_from_address = "NixFox Lemmy <noreply@nixfox.ca>";
|
||||
smtp_password = config.secrets.mailPass.nixfoxNoReply;
|
||||
tls_type = "starttls";
|
||||
};
|
||||
};
|
||||
};
|
||||
environment.persistence."/persist".directories = [ "/var/lib/postgresql" ];
|
||||
};
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."lemmy.nixfox.ca" = lib.mkIf config.services.lemmy.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
};
|
||||
}
|
|
@ -1,11 +1,75 @@
|
|||
{ lib, ... }:
|
||||
{ config, lib, pkgs, mailserver, ... }:
|
||||
{
|
||||
imports = [
|
||||
./go-autoconfig
|
||||
./radicale
|
||||
./roundcube
|
||||
./simplenix
|
||||
mailserver.nixosModule
|
||||
];
|
||||
|
||||
options.services.mailserver.enable = lib.mkEnableOption "Simple NixOS Mailserver";
|
||||
config = lib.mkIf config.mailserver.enable {
|
||||
mailserver = {
|
||||
fqdn = "mx.${config.vars.mainDomain}";
|
||||
domains = [
|
||||
"nixfox.ca"
|
||||
"bloxelcom.net"
|
||||
"freecorn1854.win"
|
||||
"lunamoonlight.xyz"
|
||||
];
|
||||
certificateScheme = "acme-nginx";
|
||||
localDnsResolver = false;
|
||||
redis.port = 1515;
|
||||
|
||||
# Passwords made with 'mkpasswd -sm bcrypt'
|
||||
loginAccounts = {
|
||||
"jimbo@nixfox.ca" = {
|
||||
hashedPassword = config.secrets.mailHash.bun;
|
||||
aliases = [
|
||||
"james@nixfox.ca"
|
||||
|
||||
"bun@nixfox.ca"
|
||||
"bun@bloxelcom.net"
|
||||
|
||||
"contact@nixfox.ca"
|
||||
];
|
||||
};
|
||||
|
||||
"luna@lunamoonlight.xyz" = {
|
||||
hashedPassword = config.secrets.mailHash.luna;
|
||||
aliases = [
|
||||
"luna@bloxelcom.net"
|
||||
"contact@bloxelcom.net"
|
||||
"ibu@bloxelcom.net"
|
||||
];
|
||||
};
|
||||
|
||||
"contact@freecorn1854.win" = {
|
||||
hashedPassword = config.secrets.mailHash.corn;
|
||||
aliases = [ "freecorn@bloxelcom.net" ];
|
||||
};
|
||||
|
||||
# Noreply emails
|
||||
"noreply@nixfox.ca" = {
|
||||
hashedPassword = config.secrets.mailHash.nixfoxNoReply;
|
||||
sendOnly = true;
|
||||
};
|
||||
"noreply@bloxelcom.net" = {
|
||||
hashedPassword = config.secrets.mailHash.bloxelNoReply;
|
||||
sendOnly = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
redis.servers.rspamd.port = config.mailserver.redis.port;
|
||||
cloudflare-dyndns.domains = [ config.mailserver.fqdn ];
|
||||
};
|
||||
|
||||
environment.persistence."/persist".directories = [
|
||||
"/var/vmail"
|
||||
"/var/lib/dovecot"
|
||||
"/var/lib/postfix"
|
||||
"/var/lib/redis-rspamd"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
imports = [ ./nginx ];
|
||||
|
||||
services = lib.mkIf config.services.mailserver.enable {
|
||||
services = lib.mkIf config.mailserver.enable {
|
||||
go-autoconfig = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."autoconfig.nixfox.ca" = lib.mkIf config.services.go-autoconfig.enable {
|
||||
services.nginx.virtualHosts."autoconfig.${config.vars.mainDomain}" = lib.mkIf config.services.go-autoconfig.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
imports = [ ./nginx ];
|
||||
|
||||
config = lib.mkIf config.services.mailserver.enable {
|
||||
config = lib.mkIf config.mailserver.enable {
|
||||
services = {
|
||||
radicale = {
|
||||
enable = true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."cal.nixfox.ca" = lib.mkIf config.services.go-autoconfig.enable {
|
||||
services.nginx.virtualHosts."cal.${config.vars.mainDomain}" = lib.mkIf config.services.radicale.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config = lib.mkIf config.services.mailserver.enable {
|
||||
config = lib.mkIf config.mailserver.enable {
|
||||
services.roundcube = {
|
||||
enable = true;
|
||||
hostName = "mail.nixfox.ca";
|
||||
hostName = "mail.${config.vars.mainDomain}";
|
||||
extraConfig = ''
|
||||
$config['smtp_server'] = "tls://mx.nixfox.ca";
|
||||
$config['smtp_server'] = "tls://mx.${config.vars.mainDomain}";
|
||||
$config['smtp_user'] = "%u";
|
||||
$config['smtp_pass'] = "%p";
|
||||
'';
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
{ config, lib, pkgs, mailserver, ... }:
|
||||
{
|
||||
imports = [ mailserver.nixosModule ];
|
||||
|
||||
config = lib.mkIf config.services.mailserver.enable {
|
||||
mailserver = {
|
||||
enable = true;
|
||||
fqdn = "mx.nixfox.ca";
|
||||
domains = [
|
||||
"nixfox.ca"
|
||||
"bloxelcom.net"
|
||||
"freecorn1854.win"
|
||||
"lunamoonlight.xyz"
|
||||
];
|
||||
certificateScheme = "acme-nginx";
|
||||
localDnsResolver = false;
|
||||
redis.port = 1515;
|
||||
|
||||
# Passwords made with 'mkpasswd -sm bcrypt'
|
||||
loginAccounts = {
|
||||
"jimbo@nixfox.ca" = {
|
||||
hashedPassword = config.secrets.mailHash.bun;
|
||||
aliases = [
|
||||
"james@nixfox.ca"
|
||||
"jimbo@bloxelcom.net"
|
||||
|
||||
"bun@nixfox.ca"
|
||||
"bun@bloxelcom.net"
|
||||
|
||||
"contact@nixfox.ca"
|
||||
];
|
||||
};
|
||||
|
||||
"luna@lunamoonlight.xyz" = {
|
||||
hashedPassword = config.secrets.mailHash.luna;
|
||||
aliases = [
|
||||
"luna@bloxelcom.net"
|
||||
"contact@bloxelcom.net"
|
||||
"ibu@bloxelcom.net"
|
||||
];
|
||||
};
|
||||
|
||||
"contact@freecorn1854.win" = {
|
||||
hashedPassword = config.secrets.mailHash.corn;
|
||||
aliases = [ "freecorn@bloxelcom.net" ];
|
||||
};
|
||||
|
||||
# Noreply emails
|
||||
"noreply@nixfox.ca" = {
|
||||
hashedPassword = config.secrets.mailHash.nixfoxNoReply;
|
||||
sendOnly = true;
|
||||
};
|
||||
"noreply@bloxelcom.net" = {
|
||||
hashedPassword = config.secrets.mailHash.bloxelNoReply;
|
||||
sendOnly = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
redis.servers.rspamd.port = config.mailserver.redis.port;
|
||||
cloudflare-dyndns.domains = [ config.mailserver.fqdn ];
|
||||
};
|
||||
|
||||
environment.persistence."/persist".directories = [
|
||||
"/var/vmail"
|
||||
"/var/lib/dovecot"
|
||||
"/var/lib/postfix"
|
||||
"/var/lib/redis-rspamd"
|
||||
];
|
||||
};
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
max-port = 50000;
|
||||
use-auth-secret = true;
|
||||
static-auth-secret = config.secrets.coturnSecret;
|
||||
realm = "turn.nixfox.ca";
|
||||
realm = "turn.${config.vars.mainDomain}";
|
||||
cert = "/var/lib/acme/${config.services.coturn.realm}/fullchain.pem";
|
||||
pkey = "/var/lib/acme/${config.services.coturn.realm}/key.pem";
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config = lib.mkIf config.services.coturn.enable {
|
||||
services.nginx.virtualHosts."turn.nixfox.ca" = {
|
||||
services.nginx.virtualHosts."turn.${config.vars.mainDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
listen = [{
|
||||
|
@ -12,11 +12,9 @@
|
|||
locations."/".proxyPass = "http://127.0.0.1:1380";
|
||||
};
|
||||
|
||||
security.acme.certs = {
|
||||
"turn.nixfox.ca" = {
|
||||
group = "turnserver";
|
||||
postRun = "systemctl restart coturn.service";
|
||||
};
|
||||
security.acme.certs."turn.${config.vars.mainDomain}" = {
|
||||
group = "turnserver";
|
||||
postRun = "systemctl restart coturn.service";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
nixpkgs.config.element-web.conf = {
|
||||
default_server_config."m.homeserver" = {
|
||||
base_url = "https://matrix.nixfox.ca";
|
||||
server_name = "matrix.nixfox.ca";
|
||||
base_url = "https://matrix.${config.vars.mainDomain}";
|
||||
server_name = "matrix.${config.vars.mainDomain}";
|
||||
};
|
||||
branding = {
|
||||
auth_header_logo_url = "https://www.nixfox.ca/images/copyright/profile.png";
|
||||
#welcome_background_url = "https://www.nixfox.ca/images/backgrounds/template-background.png";
|
||||
auth_header_logo_url = "https://www.${config.vars.mainDomain}/images/copyright/profile.png";
|
||||
#welcome_background_url = "https://www.${config.vars.mainDomain}/images/backgrounds/template-background.png";
|
||||
};
|
||||
embedded_pages.home_url = "https://www.nixfox.ca/";
|
||||
embedded_pages.home_url = "https://www.${config.vars.mainDomain}/";
|
||||
disable_custom_urls = true;
|
||||
disable_guests = true;
|
||||
default_theme = "dark";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."chat.nixfox.ca" = lib.mkIf config.services.matrix-synapse.enable {
|
||||
services.nginx.virtualHosts."chat.${config.vars.mainDomain}" = lib.mkIf config.services.matrix-synapse.enable {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
root = "${pkgs.element-web}";
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
config = lib.mkIf config.services.matrix-synapse.enable {
|
||||
services.matrix-synapse = {
|
||||
settings = {
|
||||
server_name = "nixfox.ca";
|
||||
public_baseurl = "https://matrix.nixfox.ca";
|
||||
server_name = "${config.vars.mainDomain}";
|
||||
public_baseurl = "https://matrix.${config.vars.mainDomain}";
|
||||
suppress_key_server_warning = true;
|
||||
|
||||
# Email notifications about account status
|
||||
email = {
|
||||
notif_from = "NixFox Matrix <noreply@nixfox.ca>";
|
||||
smtp_host = "mx.nixfox.ca";
|
||||
smtp_user = "noreply@nixfox.ca";
|
||||
notif_from = "NixFox Matrix <noreply@${config.vars.mainDomain}>";
|
||||
smtp_host = "mx.${config.vars.mainDomain}";
|
||||
smtp_user = "noreply@${config.vars.mainDomain}";
|
||||
smtp_pass = config.secrets.mailPass.nixfoxNoReply;
|
||||
enable_tls = true;
|
||||
smtp_port = 587;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."matrix.nixfox.ca" = lib.mkIf config.services.matrix-synapse.enable {
|
||||
services.nginx.virtualHosts."matrix.${config.vars.mainDomain}" = lib.mkIf config.services.matrix-synapse.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations = {
|
||||
|
|
|
@ -14,6 +14,6 @@
|
|||
symlinks = config.services.minecraft-servers.common.paperSymlinks;
|
||||
files = config.services.minecraft-servers.common.configFiles;
|
||||
};
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.blockworld.enable [ "bloxel.nixfox.ca" ];
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.blockworld.enable [ "bloxel.${config.vars.mainDomain}" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
symlinks = config.services.minecraft-servers.common.paperSymlinks;
|
||||
files = config.services.minecraft-servers.common.configFiles;
|
||||
};
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.cornworld.enable [ "corn.nixfox.ca" ];
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.cornworld.enable [ "corn.${config.vars.mainDomain}" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
./dewdemolisher
|
||||
./johnside
|
||||
./marsh
|
||||
./roguecraft
|
||||
./skyblock
|
||||
./uberbeta
|
||||
./velocity
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
symlinks = config.services.minecraft-servers.common.paperSymlinks;
|
||||
files = config.services.minecraft-servers.common.configFiles;
|
||||
};
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.dewdemolisher.enable [ "dew.nixfox.ca" ];
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.dewdemolisher.enable [ "dew.${config.vars.mainDomain}" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -26,6 +26,6 @@
|
|||
};
|
||||
files = config.services.minecraft-servers.common.configFiles;
|
||||
};
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.johnside.enable [ "john.nixfox.ca" ];
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.johnside.enable [ "john.${config.vars.mainDomain}" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
symlinks = config.services.minecraft-servers.common.paperSymlinks;
|
||||
files = config.services.minecraft-servers.common.configFiles;
|
||||
};
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.marsh.enable [ "marsh.nixfox.ca" ];
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.marsh.enable [ "marsh.${config.vars.mainDomain}" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
services = {
|
||||
minecraft-servers.servers.roguecraft = {
|
||||
package = pkgs.paperServers.paper-1_21_1;
|
||||
jvmOpts = "-Xmx3000M";
|
||||
serverProperties = config.services.minecraft-servers.common.serverProperties // {
|
||||
difficulty = 3;
|
||||
server-port = 30014;
|
||||
motd = "\\u00A7l\\u00A7bNixFox \\u00A7cRoguecraft \\u00A7bserver.";
|
||||
require-resource-pack = true;
|
||||
resource-pack = "https://nixfox.ca/roguecraftresourcepackredir";
|
||||
resource-pack-sha1 = "b540c0562aba90c3ead2356bb9cb74fcf0db36b3";
|
||||
};
|
||||
whitelist = config.services.minecraft-servers.common.whitelist;
|
||||
symlinks = config.services.minecraft-servers.common.paperSymlinks;
|
||||
files = config.services.minecraft-servers.common.configFiles // {
|
||||
"world/datapacks/roguecraft.zip" = builtins.fetchurl {
|
||||
url = "https://nixfox.ca/roguecraftdatapackredir";
|
||||
sha256 = "04zrkvzvi1i898al45fh9j3k635sf9qhwca7phbv4ynkfl8bz3q3";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.roguecraft.enable [ "rogue.nixfox.ca" ];
|
||||
|
||||
nginx.virtualHosts."nixfox.ca".locations = lib.mkIf config.services.minecraft-servers.servers.roguecraft.enable {
|
||||
"/roguecraftdatapackredir" = {
|
||||
return = "301 https://cdn.modrinth.com/data/HtKjVijx/versions/Rme4c23R/Roguecraft%201.2.6%20-%20Data%20Pack.zip";
|
||||
};
|
||||
"/roguecraftresourcepackredir" = {
|
||||
return = "301 https://cdn.modrinth.com/data/HtKjVijx/versions/C6bITJnq/Roguecraft%201.2.5.4%20-%20Resource%20Pack.zip";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -13,6 +13,6 @@
|
|||
symlinks = config.services.minecraft-servers.common.paperSymlinks;
|
||||
files = config.services.minecraft-servers.common.configFiles;
|
||||
};
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.skyblock.enable [ "skyblock.nixfox.ca" ];
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.skyblock.enable [ "skyblock.${config.vars.mainDomain}" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -18,6 +18,6 @@ in {
|
|||
server-port = 30005;
|
||||
};
|
||||
};
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.uberbeta.enable [ "beta.nixfox.ca" ];
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.uberbeta.enable [ "beta.${config.vars.mainDomain}" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
config = lib.mkIf config.services.nextcloud.enable {
|
||||
services.nextcloud = {
|
||||
package = pkgs.nextcloud31;
|
||||
hostName = "files.nixfox.ca";
|
||||
hostName = "files.${config.vars.mainDomain}";
|
||||
https = true;
|
||||
config = {
|
||||
adminuser = config.sysusers.main;
|
||||
adminuser = "admin";
|
||||
adminpassFile = "${pkgs.writeText "initial" config.secrets.initialPass}";
|
||||
dbtype = "sqlite";
|
||||
};
|
||||
|
@ -19,11 +19,11 @@
|
|||
trusted_proxies = [ "127.0.0.1" ];
|
||||
trusted_domains = [ config.services.nextcloud.hostName ];
|
||||
overwriteprotocol = "https";
|
||||
mail_smtphost = "mx.nixfox.ca";
|
||||
mail_domain = "nixfox.ca";
|
||||
mail_smtphost = "mx.${config.vars.mainDomain}";
|
||||
mail_domain = "${config.vars.mainDomain}";
|
||||
mail_from_address = "noreply";
|
||||
mail_smtpauth = "true";
|
||||
mail_smtpname = "noreply@nixfox.ca";
|
||||
mail_smtpname = "noreply@${config.vars.mainDomain}";
|
||||
mail_smtppassword = config.secrets.mailPass.nixfoxNoReply;
|
||||
mail_smtpmode = "smtp";
|
||||
mail_smtpport = 587;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."files.nixfox.ca" = lib.mkIf config.services.nextcloud.enable {
|
||||
services.nginx.virtualHosts."files.${config.vars.mainDomain}" = lib.mkIf config.services.nextcloud.enable {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
config = lib.mkIf config.services.nginx.enable {
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "contact@nixfox.ca";
|
||||
defaults.email = "contact@${config.vars.mainDomain}";
|
||||
};
|
||||
environment.persistence."/persist".directories = [ "/var/lib/acme" ];
|
||||
};
|
||||
|
|
|
@ -2,23 +2,21 @@
|
|||
{
|
||||
imports = [
|
||||
./acme
|
||||
./hosts
|
||||
./rtmp
|
||||
./user
|
||||
];
|
||||
|
||||
options.services.webserver.enable = lib.mkEnableOption "Nginx webpages";
|
||||
|
||||
config = lib.mkIf config.services.nginx.enable {
|
||||
services.nginx = {
|
||||
recommendedTlsSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedBrotliSettings = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
config.services.nginx.defaultHTTPListenPort
|
||||
config.services.nginx.defaultSSLListenPort
|
||||
];
|
||||
environment.persistence."/persist".directories = [ "/var/www" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
./files
|
||||
./nixfox
|
||||
];
|
||||
|
||||
environment.persistence."/persist".directories = lib.mkIf config.services.webserver.enable [ "/var/www" ];
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."jimbosfiles.com" = lib.mkIf config.services.webserver.enable {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
globalRedirect = "www.nixfox.ca";
|
||||
};
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts = lib.mkIf config.services.webserver.enable {
|
||||
"www.nixfox.ca" = {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
default = true;
|
||||
root = "/var/www/landing-page";
|
||||
};
|
||||
"nixfox.ca" = {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
globalRedirect = "www.nixfox.ca";
|
||||
locations = {
|
||||
"/.well-known/matrix/client".extraConfig = ''
|
||||
default_type application/json;
|
||||
return 200 '{
|
||||
"m.homeserver": { "base_url": "https://matrix.nixfox.ca" },
|
||||
"m.identity_server": { "base_url": "https://matrix.org" }
|
||||
}';
|
||||
'';
|
||||
"/.well-known/matrix/server".extraConfig = ''
|
||||
default_type application/json;
|
||||
return 200 '{ "m.server": "matrix.nixfox.ca:443" }';
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
{ config, lib, pkgs, nodes, ... }:
|
||||
{
|
||||
config = lib.mkIf config.services.webserver.enable {
|
||||
services.nginx = {
|
||||
additionalModules = with pkgs.nginxModules; [ rtmp ];
|
||||
appendConfig = ''
|
||||
rtmp {
|
||||
server {
|
||||
listen 1935;
|
||||
chunk_size 4096;
|
||||
allow publish all;
|
||||
application stream {
|
||||
record off;
|
||||
live on;
|
||||
allow play all;
|
||||
hls on;
|
||||
hls_path /var/www/landing-page/streams/hls/;
|
||||
hls_fragment_naming system;
|
||||
hls_fragment 3;
|
||||
hls_playlist_length 40;
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
networking.firewall.extraInputRules = let
|
||||
targetHosts = lib.attrValues (lib.mapAttrs (_: node: node.config.deployment.targetHost) nodes);
|
||||
in ''
|
||||
ip6 saddr { ${lib.concatStringsSep ", " targetHosts} } tcp dport 1935 accept
|
||||
ip saddr { ${config.secrets.ips.luna}, ${config.secrets.ips.corn} } tcp dport 1935 accept
|
||||
'';
|
||||
systemd.services.nginx.serviceConfig.ReadWritePaths = [ "/var/www/landing-page/streams/hls/" ];
|
||||
};
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."live.nixfox.ca" = lib.mkIf config.services.owncast.enable {
|
||||
services.nginx.virtualHosts."live.${config.vars.mainDomain}" = lib.mkIf config.services.owncast.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
config = lib.mkIf config.services.transmission.enable {
|
||||
services.transmission = {
|
||||
package = pkgs.transmission_4;
|
||||
credentialsFile = pkgs.writeText "credentials" config.secrets.transmissionCredFile;
|
||||
openPeerPorts = true;
|
||||
settings = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."tor.nixfox.ca" = lib.mkIf config.services.transmission.enable {
|
||||
services.nginx.virtualHosts."tor.${config.vars.mainDomain}" = lib.mkIf config.services.transmission.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
|
||||
config = lib.mkIf config.services.vaultwarden.enable {
|
||||
services.vaultwarden.config = {
|
||||
domain = "https://pass.nixfox.ca";
|
||||
domain = "https://pass.${config.vars.mainDomain}";
|
||||
signupsAllowed = false;
|
||||
rocketAddress = "127.0.0.1";
|
||||
rocketPort = 8222;
|
||||
|
||||
# Smtp email
|
||||
smtpHost = "mx.nixfox.ca";
|
||||
smtpFrom = "noreply@nixfox.ca";
|
||||
smtpHost = "mx.${config.vars.mainDomain}";
|
||||
smtpFrom = "noreply@${config.vars.mainDomain}";
|
||||
smtpFromName = "Vaultwarden";
|
||||
smtpUsername = "noreply@nixfox.ca";
|
||||
smtpUsername = "noreply@${config.vars.mainDomain}";
|
||||
smtpPassword = config.secrets.mailPass.nixfoxNoReply;
|
||||
smtpSecurity = "starttls";
|
||||
smtpPort = 587;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."pass.nixfox.ca" = lib.mkIf config.services.vaultwarden.enable {
|
||||
services.nginx.virtualHosts."pass.${config.vars.mainDomain}" = lib.mkIf config.services.vaultwarden.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue