This commit is contained in:
4DBug
2026-02-22 22:25:44 -06:00
parent 22df37a203
commit 2fb9359a67
12 changed files with 181 additions and 88 deletions

View File

@@ -23,9 +23,9 @@
passwordFile = "/home/bug/mailserver/bug.passwd";
};
sang = {
passwordFile = "/home/bug/nix/sang.passwd";
};
#sang = {
#passwordFile = "/home/bug/nix/sang.passwd";
#};
};
groups = {
@@ -48,7 +48,7 @@
};
"/music" = {
path = "/home/bug/Music";
path = "/home/bug/Music/TidalScrape/Downloads/";
access = {
r = "*";
@@ -61,18 +61,18 @@
};
};
"/sang" = {
/* "/sang" = {
path = "/srv/sang";
access = {
rw = [ "bug" "sang" ];
rw = [ "bug" ]; #"sang" ];
};
flags = {
fk = 4;
scan = 60;
};
};
}; */
};
openFilesLimit = 8192;

View File

@@ -1,6 +1,6 @@
{
{ den, lib, ... }: {
den.aspects.invidious = {
nixos = { pkgs, lib, ... }: let
nixos = { pkgs, ... }: let
companionPort = 8282;
companionPath = "/companion";
companionKey = "kKg3RKeZjE7frmvw";
@@ -9,56 +9,48 @@
virtualisation.oci-containers.backend = lib.mkDefault "podman";
virtualisation.oci-containers.containers.invidious-companion = {
image = "quay.io/invidious/invidious-companion:latest";
extraOptions = [ "--network=host" "--pull=always" ];
image = "quay.io/invidious/invidious-companion:latest";
extraOptions = [ "--network=host" "--pull=always" ];
environment = {
SERVER_SECRET_KEY = companionKey;
HOST = "127.0.0.1";
PORT = toString companionPort;
SERVER_BASE_URL = "http://127.0.0.1:${toString companionPort}";
environment = {
SERVER_SECRET_KEY = companionKey;
HOST = "127.0.0.1";
PORT = toString companionPort;
SERVER_BASE_URL = "http://127.0.0.1:${toString companionPort}";
# HTTP_PROXY = "http://proxy.example:3128";
# HTTPS_PROXY = "http://proxy.example:3128";
# NO_PROXY = "127.0.0.1,localhost";
};
# HTTP_PROXY = "http://proxy.example:3128";
# HTTPS_PROXY = "http://proxy.example:3128";
# NO_PROXY = "127.0.0.1,localhost";
};
};
services.invidious = {
enable = true;
package = pkgs.invidious;
enable = true;
package = pkgs.invidious;
address = "127.0.0.1";
port = 3030;
address = "127.0.0.1";
port = 3030;
nginx.enable = false;
sig-helper.enable = false;
nginx.enable = false;
sig-helper.enable = false;
settings = {
domain = "tube.bug.tools";
https_only = true;
external_port = 443;
settings = {
domain = "tube.bug.tools";
https_only = false;
external_port = 3030;
use_pubsub_feeds = true;
use_innertube_for_captions = true;
invidious_companion = [
{ private_url = "http://127.0.0.1:${toString companionPort}${companionPath}"; }
];
visitor_data = "Cgt6ZmQ4UEtOUkJJNCjwtcPMBjIKCgJVUxIEGgAgXA%3D%3D";
po_token = "Mni77CY6tviRIrvQXWaz6OfDryNNzAlKeIj4m0N1SHIITM94AZ8R0fK2dfuYke5tjZJjD33c4jB94p1Wy_XKCJPNbSkE2dgzRPdP502Q8ufofOe6fd4hV-fZFitud_tZO_BcNa18nKgfnupVYgV8huPgaFu-RKyGPIU=";
invidious_companion = [
{ private_url = "http://127.0.0.1:${toString companionPort}${companionPath}"; }
];
popular_enabled = true;
invidious_companion_key = companionKey;
};
invidious_companion_key = companionKey;
};
};
systemd.services.invidious = let dep = "podman-invidious-companion.service"; in {
wants = [ dep ];
after = [ dep ];
requires = [ dep ];
wants = [ dep ];
after = [ dep ];
requires = [ dep ];
};
};
};

View File

@@ -39,6 +39,8 @@
"discord@bug.tools"
"github@bug.tools"
"matrix@bug.tools"
"fluxer@bug.tools"
"git@bug.tools"
];
};

View File

@@ -1,7 +1,103 @@
{
den.aspects.matrix = {
nixos = {
config,
pkgs,
lib,
...
}: let
domain = "bug.tools";
matrixDomain = "matrix.${domain}";
clientConfig = {
"m.homeserver".base_url = "https://${matrixDomain}";
"m.identity_server" = {};
};
serverConfig = {
"m.server" = "${matrixDomain}:443";
};
mkWellKnown = data: ''
default_type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '${builtins.toJSON data}';
'';
in {
services.matrix-synapse = {
enable = true;
settings = {
server_name = domain;
public_baseurl = "https://${matrixDomain}";
listeners = [
{
port = 8008;
bind_addresses = ["127.0.0.1"];
type = "http";
tls = false;
x_forwarded = true;
resources = [
{
names = ["client" "federation"];
compress = true;
}
];
}
];
database = {
name = "psycopg2";
allow_unsafe_locale = true;
args = {
user = "matrix-synapse";
database = "matrix-synapse";
host = "/run/postgresql";
};
};
max_upload_size_mib = 100;
url_preview_enabled = true;
enable_registration = false;
enable_metrics = false;
registration_shared_secret_path = "/var/lib/matrix-synapse/registration_secret";
trusted_key_servers = [
{
server_name = "matrix.org";
}
];
};
};
services.postgresql = {
enable = true;
ensureDatabases = ["matrix-synapse"];
ensureUsers = [
{
name = "matrix-synapse";
ensureDBOwnership = true;
}
];
};
services.nginx.virtualHosts.${domain} = {
enableACME = true;
forceSSL = true;
locations."= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig;
locations."= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig;
};
services.nginx.virtualHosts.${matrixDomain} = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:8008";
extraConfig = ''
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
client_max_body_size 100M;
'';
};
};
};
};
}