Push to see what I still have to remove lol

This commit is contained in:
Jimbo 2025-02-28 14:12:07 -05:00
parent 8c30ba9fea
commit 8d1a992bb2
27 changed files with 25 additions and 337 deletions

View file

@ -2,11 +2,8 @@
{
imports = [
./extlinux
./services
./root-reset
];
boot.kernel.sysctl = {
"vm.max_map_count" = 2147483642;
"kernel.sysrq" = 1;
};
boot.initrd.systemd.enable = true;
}

View file

@ -1,6 +0,0 @@
{ ... }:
{
imports = [ ./root-reset ];
boot.initrd.systemd.enable = true;
}

View file

@ -5,7 +5,7 @@
directories = [
"/etc/nixos"
"/etc/secureboot"
"/var/lib/nixos"
"/var"
];
files = [
"/etc/machine-id"

View file

@ -5,7 +5,7 @@
./fileserver
./forgejo
./mysql
./socialserver
./owncast
./transmission
./vaultwarden
./webserver

View file

@ -1,4 +0,0 @@
{ config, lib, ... }:
{
services.collabora-online.enable = config.services.nextcloud.enable;
}

View file

@ -1,9 +1,6 @@
{ config, lib, pkgs, ... }:
{
imports = [
./collabora
./nginx
];
imports = [ ./nginx ];
config = lib.mkIf config.system.fileserver.enable {
services.nextcloud = {
@ -29,6 +26,5 @@
mail_smtpport = 587;
};
};
environment.persistence."/persist".directories = [ "/var/lib/nextcloud" ];
};
}

View file

@ -32,8 +32,6 @@
networking.firewall.allowedTCPPorts = [ 2299 ];
services.cloudflare-dyndns.domains = [ "git.nixfox.ca" ];
environment.persistence."/persist".directories = [ "/var/lib/forgejo" ];
services.cloudflare-dyndns.domains = [ "git.example.com" ];
};
}

View file

@ -1,7 +1,6 @@
{ config, lib, pkgs, ... }:
{
config = lib.mkIf config.system.server.enable {
services.mysql = {
services.mysql = lib.mkIf config.system.server.enable {
enable = true;
package = pkgs.mariadb;
ensureDatabases = [
@ -16,8 +15,4 @@
}
];
};
environment.persistence."/persist".directories = [
"/var/lib/mysql"
];
};
}

View file

@ -2,15 +2,12 @@
{
imports = [ ./nginx ];
config = lib.mkIf config.system.socialserver.enable {
config = lib.mkIf config.system.server.enable {
services.owncast = {
enable = true;
port = 8060;
rtmp-port = 1945;
listen = "0.0.0.0";
};
environment.persistence."/persist".directories = [
"/var/lib/owncast"
];
};
}

View file

@ -1,10 +0,0 @@
{ lib, ... }:
{
options.system.socialserver.enable = lib.mkEnableOption "Enable social media like services";
imports = [
./mastodon
./matrix
./owncast
];
}

View file

@ -1,23 +0,0 @@
{ config, lib, pkgs, ... }:
{
config = lib.mkIf config.system.socialserver.enable {
services.mastodon = {
enable = true;
localDomain = "social.nixfox.ca";
streamingProcesses = 4;
configureNginx = true;
smtp = {
createLocally = false;
host = "mx.nixfox.ca";
port = 587;
authenticate = true;
fromAddress = "NixFox Mastodon <noreply@nixfox.ca>";
user = "noreply@nixfox.ca";
passwordFile = pkgs.writeText "smtp_pass.txt" config.secrets.noreplyPassword;
};
};
environment.persistence."/persist".directories = [
"/var/lib/mastodon"
];
};
}

View file

@ -1,46 +0,0 @@
{ config, lib, ... }:
{
imports = [ ./nginx ];
config = lib.mkIf config.services.matrix-synapse.enable {
services = {
coturn = {
enable = true;
no-cli = true;
no-tcp-relay = true;
min-port = 49000;
max-port = 50000;
use-auth-secret = true;
static-auth-secret = config.secrets.coturnSecret;
realm = "turn.jimbosfiles.com";
cert = "/var/lib/acme/turn.jimbosfiles.com/fullchain.pem";
pkey = "/var/lib/acme/turn.jimbosfiles.com/key.pem";
};
# Enable coturn on Synapse
matrix-synapse.settings = {
turn_uris = [
"turn:turn.jimbosfiles.com:3478?transport=udp"
"turn:turn.jimbosfiles.com:3478?transport=tcp"
];
turn_shared_secret = config.secrets.coturnSecret;
turn_user_lifetime = "1h";
};
# Sync the IP to Cloudflare
cloudflare-dyndns.domains = [ "turn.jimbosfiles.com" ];
};
# Open coturn ports
networking.firewall = {
allowedUDPPorts = [
3478
5349
];
allowedUDPPortRanges = [{
from = config.services.coturn.min-port;
to = config.services.coturn.max-port;
}];
};
};
}

View file

@ -1,22 +0,0 @@
{ config, lib, ... }:
{
config = lib.mkIf config.services.coturn.enable {
services.nginx.virtualHosts."turn.jimbosfiles.com" = {
enableACME = true;
forceSSL = true;
listen = [{
addr = "0.0.0.0";
port = 80;
ssl = false;
}];
locations."/".proxyPass = "http://127.0.0.1:1380";
};
security.acme.certs = {
"turn.jimbosfiles.com" = {
group = "turnserver";
postRun = "systemctl restart coturn.service";
};
};
};
}

View file

@ -1,8 +0,0 @@
{ ... }:
{
imports = [
./coturn
./element
./synapse
];
}

View file

@ -1,23 +0,0 @@
{ config, lib, ... }:
{
imports = [ ./nginx ];
config = lib.mkIf config.services.matrix-synapse.enable {
nixpkgs.config.element-web.conf = {
default_server_config."m.homeserver" = {
base_url = "https://matrix.jimbosfiles.com";
server_name = "matrix.jimbosfiles.com";
};
branding = {
#welcome_background_url = "https://staging.jimbosfiles.com/images/backgrounds/template-background.png";
#auth_header_logo_url = "https://staging.jimbosfiles.com/images/logos/template-logo.png";
};
embedded_pages = {
home_url = "https://www.jimbosfiles.com/";
};
disable_custom_urls = true;
disable_guests = true;
default_theme = "dark";
};
};
}

View file

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

View file

@ -1,62 +0,0 @@
{ config, lib, pkgs, ... }:
{
imports = [
./nginx
];
config = lib.mkIf config.system.socialserver.enable {
services.matrix-synapse = {
enable = true;
settings = {
server_name = "jimbosfiles.com";
public_baseurl = "https://matrix.jimbosfiles.com";
suppress_key_server_warning = true;
listeners = [{
port = 8008;
bind_addresses = [
"::"
"0.0.0.0"
];
resources = [{
compress = true;
names = [
"client"
"federation"
];
}];
type = "http";
tls = false;
x_forwarded = true;
}];
email = {
notif_from = "NixFox Matrix <noreply@nixfox.ca>";
smtp_host = "mx.nixfox.ca";
smtp_user = "noreply@nixfox.ca";
smtp_pass = config.secrets.noreplyPassword;
enable_tls = true;
smtp_port = 587;
require_transport_security = true;
};
# Disable registration without email
registrations_require_3pid = [ "email" ];
# Set the type of database
database.name = "sqlite3";
# Allow account registration
#enable_registration = true;
# General settings
url_preview_enabled = true;
max_upload_size = "50M";
report_stats = false;
burst_count = 15;
};
};
environment.persistence."/persist".directories = [ "/var/lib/matrix-synapse" ];
};
}

View file

@ -1,13 +0,0 @@
{ config, lib, ... }:
{
services.nginx.virtualHosts."matrix.jimbosfiles.com" = lib.mkIf config.services.matrix-synapse.enable {
enableACME = true;
forceSSL = true;
locations = {
"/".extraConfig = ''return 403;'';
"/client".proxyPass = "http://127.0.0.1:8008";
"/_matrix".proxyPass = "http://127.0.0.1:8008";
"/_synapse/client".proxyPass = "http://127.0.0.1:8008";
};
};
}

View file

@ -9,8 +9,5 @@
openPeerPorts = true;
settings.rpc-authentication-required = true;
};
environment.persistence."/persist".directories = [
"/var/lib/transmission"
];
};
}

View file

@ -23,7 +23,5 @@
SMTP_TIMEOUT = 15;
};
};
environment.persistence."/persist".directories = [ "/var/lib/bitwarden_rs" ];
};
}

View file

@ -1,9 +1,6 @@
{ config, lib, ... }:
{
imports = [
./rtmp
./virtualhosts
];
imports = [ ./virtualhosts ];
config = lib.mkIf config.system.server.enable {
services.nginx = {
@ -14,8 +11,6 @@
recommendedProxySettings = true;
};
environment.persistence."/persist".directories = [ "/var/www" ];
networking.firewall.allowedTCPPorts = [
80
443

View file

@ -1,32 +0,0 @@
{ config, lib, pkgs, ... }:
{
options.services.nginx.rtmp.enable = lib.mkEnableOption "Enable an RTMP server using Nginx";
config = lib.mkIf config.services.nginx.rtmp.enable {
services.nginx = {
package = (pkgs.nginx.override {
modules = 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;
}
}
}
'';
};
systemd.services.nginx.serviceConfig.ReadWritePaths = [ "/var/www/landing-page/streams/hls/" ];
};
}

View file

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

View file

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

View file

@ -1,27 +0,0 @@
{ config, lib, ... }:
{
services.nginx.virtualHosts."jimbosfiles.com" = lib.mkIf config.system.server.enable {
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.jimbosfiles.com"
},
"m.identity_server": {
"base_url": "https://matrix.org"
}
}
';
'';
"/.well-known/matrix/server".extraConfig = ''
default_type application/json;
return 200 '{ "m.server": "matrix.jimbosfiles.com:443" }';
'';
};
};
}