Devariable domains

This commit is contained in:
Jimbo 2025-02-25 03:03:43 -05:00
parent 2c4749f2cc
commit 984b12819e
55 changed files with 152 additions and 179 deletions

2
.gitattributes vendored
View file

@ -1 +1 @@
modules/system/secrets/** filter=git-crypt diff=git-crypt modules/system/variables/secrets/** filter=git-crypt diff=git-crypt

View file

@ -1,10 +1,10 @@
{ config, lib, pkgs, ... }: { pkgs, ... }:
{ {
boot = { boot = {
kernelPackages = pkgs.linuxPackages_5_10; kernelPackages = pkgs.linuxPackages_5_10;
swraid = { swraid = {
enable = true; enable = true;
mdadmConf = "MAILADDR contact@${config.domains.p2}"; mdadmConf = "MAILADDR contact@nixfox.ca";
}; };
}; };
} }

View file

@ -5,8 +5,9 @@
./programs ./programs
./services ./services
./settings ./settings
./wms
./user ./user
./variables
./wms
../variables ../variables
# Imports # Imports

View file

@ -1,9 +1,9 @@
{ config, pkgs, ... }: { pkgs, ... }:
{ {
programs.git = { programs.git = {
enable = true; enable = true;
userName = "Jimbo"; userName = "Jimbo";
userEmail = "jimbo@${config.domains.p2}"; userEmail = "jimbo@nixfox.ca";
}; };
programs.lazygit.enable = true; programs.lazygit.enable = true;

View file

@ -98,20 +98,20 @@
file = { file = {
".local/share/ranger/bookmarks".text = '' ".local/share/ranger/bookmarks".text = ''
# Local files # Local files
h:/home/${config.sysusers.main}/ h:/home/${config.home.username}/
k:/home/${config.sysusers.main}/Keepers k:/home/${config.home.username}/Keepers
j:/home/${config.sysusers.main}/Downloads j:/home/${config.home.username}/Downloads
v:/home/${config.sysusers.main}/Videos v:/home/${config.home.username}/Videos
c:/home/${config.sysusers.main}/.config c:/home/${config.home.username}/.config
l:/home/${config.sysusers.main}/.local l:/home/${config.home.username}/.local
d:/mnt d:/mnt
n:/etc/nixos n:/etc/nixos
# Remote files # Remote files
J:/home/${config.sysusers.main}/KittyNFS J:/home/${config.home.username}/KittyNFS
K:/home/${config.sysusers.main}/KittyNFS/Files K:/home/${config.home.username}/KittyNFS/Files
V:/home/${config.sysusers.main}/KittyNFS/Media V:/home/${config.home.username}/KittyNFS/Media
M:/home/${config.sysusers.main}/KittyNFS/Music M:/home/${config.home.username}/KittyNFS/Music
''; '';
}; };
packages = with pkgs; [ packages = with pkgs; [

View file

@ -3,8 +3,8 @@
services.mpd = { services.mpd = {
enable = config.home.desktop.enable; enable = config.home.desktop.enable;
network.startWhenNeeded = true; network.startWhenNeeded = true;
musicDirectory = "/home/${config.sysusers.main}/KittyNFS/Music/JimBops"; musicDirectory = "/home/${config.home.username}/KittyNFS/Music/JimBops";
playlistDirectory = "/home/${config.sysusers.main}/KittyNFS/Music/JimBops/Playlists"; playlistDirectory = "/home/${config.home.username}/KittyNFS/Music/JimBops/Playlists";
extraConfig = '' extraConfig = ''
audio_output { audio_output {
type "pipewire" type "pipewire"

View file

@ -2,7 +2,7 @@
{ {
home = { home = {
username = "${config.sysusers.main}"; username = "${config.sysusers.main}";
homeDirectory = "/home/${config.sysusers.main}"; homeDirectory = "/home/${config.home.username}";
sessionVariables = { sessionVariables = {
EDITOR = "nvim"; EDITOR = "nvim";
MANPAGER = "nvim +Man!"; MANPAGER = "nvim +Man!";

View file

@ -0,0 +1,8 @@
{ ... }:
{
imports = [
./displays
./look
./workspaces
];
}

View file

@ -4,9 +4,9 @@
./accounts ./accounts
./devices ./devices
./programs ./programs
./secrets
./services ./services
./settings ./settings
./variables
../variables ../variables
]; ];

View file

@ -11,7 +11,7 @@
{ # Kitty server { # Kitty server
publicKey = "qnOT/lXOJMaQgDUdXpyfGZB2IEyUouRje2m/bCe9ux8="; publicKey = "qnOT/lXOJMaQgDUdXpyfGZB2IEyUouRje2m/bCe9ux8=";
allowedIPs = [ "10.100.0.0/24" ]; allowedIPs = [ "10.100.0.0/24" ];
endpoint = "sv.${config.domains.p2}:51820"; endpoint = "sv.nixfox.ca:51820";
persistentKeepalive = 25; persistentKeepalive = 25;
} }
]; ];

Binary file not shown.

View file

@ -4,7 +4,7 @@
services.ddclient = { services.ddclient = {
enable = true; enable = true;
protocol = "cloudflare"; protocol = "cloudflare";
zone = "${config.domains.p2}"; zone = "nixfox.ca";
usev6 = ""; usev6 = "";
username = "token"; username = "token";
passwordFile = "${pkgs.writeText "cloudflareapikey" config.secrets.flareApiKey}"; passwordFile = "${pkgs.writeText "cloudflareapikey" config.secrets.flareApiKey}";

View file

@ -1,6 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
services.nginx.virtualHosts."jelly.${config.domains.p2}" = lib.mkIf config.services.forgejo.enable { services.nginx.virtualHosts."jelly.nixfox.ca" = lib.mkIf config.services.forgejo.enable {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {

View file

@ -9,7 +9,7 @@
services.nextcloud = { services.nextcloud = {
enable = true; enable = true;
package = pkgs.nextcloud30; package = pkgs.nextcloud30;
hostName = "cloud.${config.domains.p2}"; hostName = "cloud.nixfox.ca";
https = true; https = true;
config = { config = {
adminuser = config.sysusers.main; adminuser = config.sysusers.main;
@ -17,13 +17,13 @@
}; };
settings = { settings = {
trusted_proxies = [ "127.0.0.1" ]; trusted_proxies = [ "127.0.0.1" ];
trusted_domains = [ "cloud.${config.domains.p2}" ]; trusted_domains = [ "cloud.nixfox.ca" ];
overwriteprotocol = "https"; overwriteprotocol = "https";
mail_smtphost = "mx.${config.domains.p2}"; mail_smtphost = "mx.nixfox.ca";
mail_domain = "${config.domains.p2}"; mail_domain = "nixfox.ca";
mail_from_address = "noreply"; mail_from_address = "noreply";
mail_smtpauth = "true"; mail_smtpauth = "true";
mail_smtpname = "noreply@${config.domains.p2}"; mail_smtpname = "noreply@nixfox.ca";
mail_smtppassword = config.secrets.noreplyPassword; mail_smtppassword = config.secrets.noreplyPassword;
mail_smtpmode = "smtp"; mail_smtpmode = "smtp";
mail_smtpport = 587; mail_smtpport = 587;

View file

@ -1,6 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
services.nginx.virtualHosts."cloud.${config.domains.p2}" = lib.mkIf config.services.nextcloud.enable { services.nginx.virtualHosts."cloud.nixfox.ca" = lib.mkIf config.services.nextcloud.enable {
enableACME = true; enableACME = true;
addSSL = true; addSSL = true;
locations."/" = { locations."/" = {

View file

@ -8,17 +8,17 @@
package = pkgs.forgejo; package = pkgs.forgejo;
settings = { settings = {
server = { server = {
DOMAIN = "git.${config.domains.p2}"; DOMAIN = "git.nixfox.ca";
ROOT_URL = "https://git.${config.domains.p2}:443"; ROOT_URL = "https://git.nixfox.ca:443";
HTTP_PORT = 3110; HTTP_PORT = 3110;
SSH_PORT = 2299; SSH_PORT = 2299;
START_SSH_SERVER = true; START_SSH_SERVER = true;
}; };
mailer = { mailer = {
ENABLED = true; ENABLED = true;
SMTP_ADDR = "mx.${config.domains.p2}"; SMTP_ADDR = "mx.nixfox.ca";
FROM = "NixFox Git <noreply@${config.domains.p2}>"; FROM = "NixFox Git <noreply@nixfox.ca>";
USER = "noreply@${config.domains.p2}"; USER = "noreply@nixfox.ca";
PASSWD = config.secrets.noreplyPassword; PASSWD = config.secrets.noreplyPassword;
PROTOCOL = "smtps"; PROTOCOL = "smtps";
}; };
@ -32,7 +32,7 @@
networking.firewall.allowedTCPPorts = [ 2299 ]; networking.firewall.allowedTCPPorts = [ 2299 ];
services.ddclient.domains = [ "git.${config.domains.p2}" ]; services.ddclient.domains = [ "git.nixfox.ca" ];
environment.persistence."/persist".directories = [ "/var/lib/forgejo" ]; environment.persistence."/persist".directories = [ "/var/lib/forgejo" ];
}; };

View file

@ -1,6 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
services.nginx.virtualHosts."git.${config.domains.p2}" = lib.mkIf config.services.forgejo.enable { services.nginx.virtualHosts."git.nixfox.ca" = lib.mkIf config.services.forgejo.enable {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {

View file

@ -8,7 +8,7 @@
services.icecast = { services.icecast = {
enable = config.system.server.enable; enable = config.system.server.enable;
listen.port = 73; listen.port = 73;
hostname = "radio.${config.domains.p2}"; hostname = "radio.nixfox.ca";
admin = { admin = {
user = "${config.sysusers.main}"; user = "${config.sysusers.main}";
password = "${config.secrets.castAdminPass}"; password = "${config.secrets.castAdminPass}";
@ -19,7 +19,7 @@
</authentication> </authentication>
<location>Canada</location> <location>Canada</location>
<admin>contact@${config.domains.p2}</admin> <admin>contact@nixfox.ca</admin>
''; '';
}; };
} }

View file

@ -1,6 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
services.nginx.virtualHosts."radio.${config.domains.p2}" = lib.mkIf config.services.icecast.enable { services.nginx.virtualHosts."radio.nixfox.ca" = lib.mkIf config.services.icecast.enable {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {

View file

@ -2,9 +2,9 @@
{ {
services.roundcube = { services.roundcube = {
enable = config.system.mailserver.enable; enable = config.system.mailserver.enable;
hostName = "mail.${config.domains.p2}"; hostName = "mail.nixfox.ca";
extraConfig = '' extraConfig = ''
$config['smtp_server'] = "tls://mx.${config.domains.p2}"; $config['smtp_server'] = "tls://mx.nixfox.ca";
$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 = config.system.mailserver.enable; enable = config.system.mailserver.enable;
domains = [ domains = [
"${config.domains.p2}" "nixfox.ca"
"${config.domains.blox}" "bloxelcom.net"
"${config.domains.luna}" "freecorn1854.win"
"${config.domains.corn}" "lunamoonlight.xyz"
]; ];
fqdn = "mx.${config.domains.p2}"; fqdn = "mx.nixfox.ca";
certificateScheme = "acme-nginx"; certificateScheme = "acme-nginx";
localDnsResolver = false; localDnsResolver = false;
redis.port = 1515; redis.port = 1515;
# Passwords made with 'mkpasswd -sm bcrypt' # Passwords made with 'mkpasswd -sm bcrypt'
loginAccounts = { loginAccounts = {
"noreply@${config.domains.p2}" = { "noreply@nixfox.ca" = {
hashedPasswordFile = pkgs.writeText "noreply" config.secrets.noreplyMailHash; hashedPasswordFile = pkgs.writeText "noreply" config.secrets.noreplyMailHash;
sendOnly = true; sendOnly = true;
}; };
"jimbo@${config.domains.p2}" = { "jimbo@nixfox.ca" = {
hashedPasswordFile = pkgs.writeText "jimbo" config.secrets.jimboMailHash; hashedPasswordFile = pkgs.writeText "jimbo" config.secrets.jimboMailHash;
aliases = [ aliases = [
"james@${config.domains.p2}" "james@nixfox.ca"
"jimbo@${config.domains.blox}" "jimbo@bloxelcom.net"
"vice@${config.domains.p2}" "vice@nixfox.ca"
"vice@${config.domains.blox}" "vice@bloxelcom.net"
"yara@${config.domains.p2}" "yara@nixfox.ca"
"contact@${config.domains.p2}" "contact@nixfox.ca"
]; ];
}; };
"luna@${config.domains.luna}" = { "luna@lunamoonlight.xyz" = {
hashedPasswordFile = pkgs.writeText "luna" config.secrets.lunaMailHash; hashedPasswordFile = pkgs.writeText "luna" config.secrets.lunaMailHash;
aliases = [ aliases = [
"luna@${config.domains.blox}" "luna@bloxelcom.net"
"contact@${config.domains.blox}" "contact@bloxelcom.net"
"ibu@${config.domains.blox}" "ibu@bloxelcom.net"
]; ];
}; };
"contact@${config.domains.corn}" = { "contact@freecorn1854.win" = {
hashedPasswordFile = pkgs.writeText "corn" config.secrets.cornMailHash; hashedPasswordFile = pkgs.writeText "corn" config.secrets.cornMailHash;
aliases = [ "freecorn@${config.domains.blox}" ]; aliases = [ "freecorn@bloxelcom.net" ];
}; };
}; };
}; };

View file

@ -1,6 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
services.nginx.virtualHosts."mx.${config.domains.p2}" = lib.mkIf config.mailserver.enable { services.nginx.virtualHosts."mx.nixfox.ca" = lib.mkIf config.mailserver.enable {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {

View file

@ -16,6 +16,6 @@ in {
symlinks = common.paperSymlinks; symlinks = common.paperSymlinks;
files = common.configFiles; files = common.configFiles;
}; };
ddclient.domains = lib.mkIf config.services.minecraft-servers.servers.blockworld.enable [ "bloxel.${config.domains.p2}" ]; ddclient.domains = lib.mkIf config.services.minecraft-servers.servers.blockworld.enable [ "bloxel.nixfox.ca" ];
}; };
} }

View file

@ -15,6 +15,6 @@ in {
symlinks = common.paperSymlinks; symlinks = common.paperSymlinks;
files = common.configFiles; files = common.configFiles;
}; };
ddclient.domains = lib.mkIf config.services.minecraft-servers.servers.dewdemolisher.enable [ "dew.${config.domains.p2}" ]; ddclient.domains = lib.mkIf config.services.minecraft-servers.servers.dewdemolisher.enable [ "dew.nixfox.ca" ];
}; };
} }

View file

@ -28,6 +28,6 @@ in {
}; };
files = common.configFiles; files = common.configFiles;
}; };
ddclient.domains = lib.mkIf config.services.minecraft-servers.servers.johnside.enable [ "john.${config.domains.p2}" ]; ddclient.domains = lib.mkIf config.services.minecraft-servers.servers.johnside.enable [ "john.nixfox.ca" ];
}; };
} }

View file

@ -11,22 +11,22 @@ in {
server-port = 30014; server-port = 30014;
motd = "\\u00A7l\\u00A7bNixFox \\u00A7cRoguecraft \\u00A7bserver."; motd = "\\u00A7l\\u00A7bNixFox \\u00A7cRoguecraft \\u00A7bserver.";
require-resource-pack = true; require-resource-pack = true;
resource-pack = "https://${config.domains.p2}/roguecraftresourcepackredir"; resource-pack = "https://nixfox.ca/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.domains.p2}/roguecraftdatapackredir"; url = "https://nixfox.ca/roguecraftdatapackredir";
sha256 = "04zrkvzvi1i898al45fh9j3k635sf9qhwca7phbv4ynkfl8bz3q3"; sha256 = "04zrkvzvi1i898al45fh9j3k635sf9qhwca7phbv4ynkfl8bz3q3";
}; };
}; };
}; };
ddclient.domains = lib.mkIf config.services.minecraft-servers.servers.roguecraft.enable [ "rogue.${config.domains.p2}" ]; ddclient.domains = lib.mkIf config.services.minecraft-servers.servers.roguecraft.enable [ "rogue.nixfox.ca" ];
nginx.virtualHosts."${config.domains.p2}".locations = lib.mkIf config.services.minecraft-servers.servers.roguecraft.enable { nginx.virtualHosts."nixfox.ca".locations = lib.mkIf config.services.minecraft-servers.servers.roguecraft.enable {
"/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

@ -15,6 +15,6 @@ in {
symlinks = common.paperSymlinks; symlinks = common.paperSymlinks;
files = common.configFiles; files = common.configFiles;
}; };
ddclient.domains = lib.mkIf config.services.minecraft-servers.servers.dewdemolisher.enable [ "skyblock.${config.domains.p2}" ]; ddclient.domains = lib.mkIf config.services.minecraft-servers.servers.dewdemolisher.enable [ "skyblock.nixfox.ca" ];
}; };
} }

View file

@ -19,6 +19,6 @@ in {
server-port = 30005; server-port = 30005;
}; };
}; };
ddclient.domains = lib.mkIf config.services.minecraft-servers.servers.uberbeta.enable [ "beta.${config.domains.p2}" ]; ddclient.domains = lib.mkIf config.services.minecraft-servers.servers.uberbeta.enable [ "beta.nixfox.ca" ];
}; };
} }

View file

@ -1,7 +1,5 @@
{ pkgs, ... }: { pkgs, ... }:
let {
common = import ../../common { inherit pkgs; };
in {
services.minecraft-servers.servers.velocity = { services.minecraft-servers.servers.velocity = {
package = pkgs.velocityServers.velocity; package = pkgs.velocityServers.velocity;
jvmOpts = "-Xmx512M"; jvmOpts = "-Xmx512M";

View file

@ -3,16 +3,16 @@
config = lib.mkIf config.system.socialserver.enable { config = lib.mkIf config.system.socialserver.enable {
services.mastodon = { services.mastodon = {
enable = true; enable = true;
localDomain = "social.${config.domains.p2}"; localDomain = "social.nixfox.ca";
streamingProcesses = 4; streamingProcesses = 4;
configureNginx = true; configureNginx = true;
smtp = { smtp = {
createLocally = false; createLocally = false;
host = "mx.${config.domains.p2}"; host = "mx.nixfox.ca";
port = 587; port = 587;
authenticate = true; authenticate = true;
fromAddress = "NixFox Mastodon <noreply@${config.domains.p2}>"; fromAddress = "NixFox Mastodon <noreply@nixfox.ca>";
user = "noreply@${config.domains.p2}"; user = "noreply@nixfox.ca";
passwordFile = pkgs.writeText "smtp_pass.txt" config.secrets.noreplyPassword; passwordFile = pkgs.writeText "smtp_pass.txt" config.secrets.noreplyPassword;
}; };
}; };

View file

@ -12,23 +12,23 @@
max-port = 50000; max-port = 50000;
use-auth-secret = true; use-auth-secret = true;
static-auth-secret = config.secrets.coturnSecret; static-auth-secret = config.secrets.coturnSecret;
realm = "turn.${config.domains.p1}"; realm = "turn.jimbosfiles.com";
cert = "/var/lib/acme/turn.${config.domains.p1}.com/fullchain.pem"; cert = "/var/lib/acme/turn.jimbosfiles.com/fullchain.pem";
pkey = "/var/lib/acme/turn.${config.domains.p1}.com/key.pem"; pkey = "/var/lib/acme/turn.jimbosfiles.com/key.pem";
}; };
# Enable coturn on Synapse # Enable coturn on Synapse
matrix-synapse.settings = { matrix-synapse.settings = {
turn_uris = [ turn_uris = [
"turn:turn.${config.domains.p1}:3478?transport=udp" "turn:turn.jimbosfiles.com:3478?transport=udp"
"turn:turn.${config.domains.p1}:3478?transport=tcp" "turn:turn.jimbosfiles.com:3478?transport=tcp"
]; ];
turn_shared_secret = config.secrets.coturnSecret; turn_shared_secret = config.secrets.coturnSecret;
turn_user_lifetime = "1h"; turn_user_lifetime = "1h";
}; };
# Sync the IP to Cloudflare # Sync the IP to Cloudflare
ddclient.domains = [ "git.${config.domains.p2}" ]; ddclient.domains = [ "turn.jimbosfiles.com" ];
}; };
# Open coturn ports # Open coturn ports

View file

@ -1,7 +1,7 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
config = lib.mkIf config.services.coturn.enable { config = lib.mkIf config.services.coturn.enable {
services.nginx.virtualHosts."turn.${config.domains.p1}" = { services.nginx.virtualHosts."turn.jimbosfiles.com" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
listen = [{ listen = [{
@ -13,7 +13,7 @@
}; };
security.acme.certs = { security.acme.certs = {
"turn.${config.domains.p1}" = { "turn.jimbosfiles.com" = {
group = "turnserver"; group = "turnserver";
postRun = "systemctl restart coturn.service"; postRun = "systemctl restart coturn.service";
}; };

View file

@ -5,15 +5,15 @@
config = lib.mkIf config.services.matrix-synapse.enable { config = lib.mkIf config.services.matrix-synapse.enable {
nixpkgs.config.element-web.conf = { nixpkgs.config.element-web.conf = {
default_server_config."m.homeserver" = { default_server_config."m.homeserver" = {
base_url = "https://matrix.${config.domains.p1}"; base_url = "https://matrix.jimbosfiles.com";
server_name = "matrix.${config.domains.p1}"; server_name = "matrix.jimbosfiles.com";
}; };
branding = { branding = {
#welcome_background_url = "https://staging.${config.domains.p1}/images/backgrounds/template-background.png"; #welcome_background_url = "https://staging.jimbosfiles.com/images/backgrounds/template-background.png";
#auth_header_logo_url = "https://staging.${config.domains.p1}/images/logos/template-logo.png"; #auth_header_logo_url = "https://staging.jimbosfiles.com/images/logos/template-logo.png";
}; };
embedded_pages = { embedded_pages = {
home_url = "https://www.${config.domains.p1}/"; home_url = "https://www.jimbosfiles.com/";
}; };
disable_custom_urls = true; disable_custom_urls = true;
disable_guests = true; disable_guests = true;

View file

@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
services.nginx.virtualHosts."chat.${config.domains.p2}" = lib.mkIf config.services.matrix-synapse.enable { services.nginx.virtualHosts."chat.nixfox.ca" = lib.mkIf config.services.matrix-synapse.enable {
enableACME = true; enableACME = true;
addSSL = true; addSSL = true;
root = "${pkgs.element-web}"; root = "${pkgs.element-web}";

View file

@ -8,31 +8,32 @@
services.matrix-synapse = { services.matrix-synapse = {
enable = true; enable = true;
settings = { settings = {
server_name = "${config.domains.p1}"; server_name = "jimbosfiles.com";
public_baseurl = "https://matrix.${config.domains.p1}"; public_baseurl = "https://matrix.jimbosfiles.com";
suppress_key_server_warning = true; suppress_key_server_warning = true;
listeners = [ listeners = [{
{ port = 8008;
port = 8008; bind_addresses = [
bind_addresses = [ "::" "0.0.0.0" ]; "::"
resources = [{ "0.0.0.0"
compress = true; ];
names = [ resources = [{
"client" compress = true;
"federation" names = [
]; "client"
}]; "federation"
type = "http"; ];
tls = false; }];
x_forwarded = true; type = "http";
} tls = false;
]; x_forwarded = true;
}];
email = { email = {
notif_from = "NixFox Matrix <noreply@${config.domains.p2}>"; notif_from = "NixFox Matrix <noreply@nixfox.ca>";
smtp_host = "mx.${config.domains.p2}"; smtp_host = "mx.nixfox.ca";
smtp_user = "noreply@${config.domains.p2}"; smtp_user = "noreply@nixfox.ca";
smtp_pass = config.secrets.noreplyPassword; smtp_pass = config.secrets.noreplyPassword;
enable_tls = true; enable_tls = true;
smtp_port = 587; smtp_port = 587;
@ -42,27 +43,11 @@
# Disable registration without email # Disable registration without email
registrations_require_3pid = [ "email" ]; registrations_require_3pid = [ "email" ];
# Allow only this range of emails
allowed_local_3pids = [
{
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";
# Allow account registration # Allow account registration
enable_registration = true; #enable_registration = true;
# General settings # General settings
url_preview_enabled = true; url_preview_enabled = true;
@ -71,8 +56,7 @@
burst_count = 15; burst_count = 15;
}; };
}; };
environment.persistence."/persist".directories = [
"/var/lib/matrix-synapse" environment.persistence."/persist".directories = [ "/var/lib/matrix-synapse" ];
];
}; };
} }

View file

@ -1,6 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
services.nginx.virtualHosts."matrix.${config.domains.p1}" = lib.mkIf config.services.matrix-synapse.enable { services.nginx.virtualHosts."matrix.jimbosfiles.com" = lib.mkIf config.services.matrix-synapse.enable {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations = { locations = {

View file

@ -1,6 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
services.nginx.virtualHosts."live.${config.domains.p2}" = lib.mkIf config.services.owncast.enable { services.nginx.virtualHosts."live.nixfox.ca" = lib.mkIf config.services.owncast.enable {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {

View file

@ -1,6 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
services.nginx.virtualHosts."tor.${config.domains.p2}" = lib.mkIf config.services.transmission.enable { services.nginx.virtualHosts."tor.nixfox.ca" = lib.mkIf config.services.transmission.enable {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {

View file

@ -6,25 +6,24 @@
services.vaultwarden = { services.vaultwarden = {
enable = true; enable = true;
config = { config = {
DOMAIN = "https://pass.${config.domains.p2}"; DOMAIN = "https://pass.nixfox.ca";
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.domains.p2}"; SMTP_HOST = "mx.nixfox.ca";
SMTP_FROM = "noreply@${config.domains.p2}"; SMTP_FROM = "noreply@nixfox.ca";
SMTP_FROM_NAME = "Vaultwarden"; SMTP_FROM_NAME = "Vaultwarden";
SMTP_USERNAME = "noreply@${config.domains.p2}"; SMTP_USERNAME = "noreply@nixfox.ca";
SMTP_PASSWORD = config.secrets.noreplyPassword; SMTP_PASSWORD = config.secrets.noreplyPassword;
SMTP_SECURITY = "starttls"; SMTP_SECURITY = "starttls";
SMTP_PORT = 587; SMTP_PORT = 587;
SMTP_TIMEOUT = 15; SMTP_TIMEOUT = 15;
}; };
}; };
environment.persistence."/persist".directories = [
"/var/lib/bitwarden_rs" environment.persistence."/persist".directories = [ "/var/lib/bitwarden_rs" ];
];
}; };
} }

View file

@ -1,6 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
services.nginx.virtualHosts."pass.${config.domains.p2}" = lib.mkIf config.services.vaultwarden.enable { services.nginx.virtualHosts."pass.nixfox.ca" = lib.mkIf config.services.vaultwarden.enable {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {

View file

@ -3,10 +3,8 @@
config = lib.mkIf config.services.nginx.enable { config = lib.mkIf config.services.nginx.enable {
security.acme = { security.acme = {
acceptTerms = true; acceptTerms = true;
defaults.email = "contact@${config.domains.p2}"; defaults.email = "contact@nixfox.ca";
}; };
environment.persistence."/persist".directories = [ environment.persistence."/persist".directories = [ "/var/lib/acme" ];
"/var/lib/acme"
];
}; };
} }

View file

@ -1,7 +1,7 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
./p1 ./nixfox
./p2 ./jimbosfiles
]; ];
} }

View file

@ -1,16 +1,16 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
services.nginx.virtualHosts."${config.domains.p1}" = lib.mkIf config.system.server.enable { services.nginx.virtualHosts."jimbosfiles.com" = lib.mkIf config.system.server.enable {
enableACME = true; enableACME = true;
addSSL = true; addSSL = true;
globalRedirect = "www.${config.domains.p2}"; globalRedirect = "www.nixfox.ca";
locations = { locations = {
"/.well-known/matrix/client".extraConfig = '' "/.well-known/matrix/client".extraConfig = ''
default_type application/json; default_type application/json;
return 200 ' return 200 '
{ {
"m.homeserver": { "m.homeserver": {
"base_url": "https://matrix.${config.domains.p1}" "base_url": "https://matrix.jimbosfiles.com"
}, },
"m.identity_server": { "m.identity_server": {
"base_url": "https://matrix.org" "base_url": "https://matrix.org"
@ -20,7 +20,7 @@
''; '';
"/.well-known/matrix/server".extraConfig = '' "/.well-known/matrix/server".extraConfig = ''
default_type application/json; default_type application/json;
return 200 '{ "m.server": "matrix.${config.domains.p1}:443" }'; return 200 '{ "m.server": "matrix.jimbosfiles.com:443" }';
''; '';
}; };
}; };

View file

@ -1,16 +1,16 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
services.nginx.virtualHosts = lib.mkIf config.system.server.enable { services.nginx.virtualHosts = lib.mkIf config.system.server.enable {
"www.${config.domains.p2}" = { "www.nixfox.ca" = {
enableACME = true; enableACME = true;
addSSL = true; addSSL = true;
default = true; default = true;
root = "/var/www/landing-page"; root = "/var/www/landing-page";
}; };
"${config.domains.p2}" = { "nixfox.ca" = {
enableACME = true; enableACME = true;
addSSL = true; addSSL = true;
globalRedirect = "www.${config.domains.p2}"; globalRedirect = "www.nixfox.ca";
}; };
}; };
} }

View file

@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./ips
./secrets
];
}

Binary file not shown.

View file

@ -1,11 +1,4 @@
{ ... }: { ... }:
{ {
imports = [ imports = [ ./users ];
./displays
./domains
./ips
./look
./users
./workspaces
];
} }

View file

@ -1,15 +0,0 @@
{ config, lib, ... }:
{
options.domains = lib.mkOption {
type = lib.types.attrs;
default = {};
};
config.domains = {
p1 = "jimbosfiles.com";
p2 = "nixfox.ca";
blox = "bloxelcom.net";
corn = "freecorn1854.win";
luna = "lunamoonlight.xyz";
};
}