mod: added sable web to yshtola config
added formatter
This commit is contained in:
@@ -50,6 +50,10 @@
|
||||
};
|
||||
in {
|
||||
meta = import ./meta;
|
||||
formatter = nixpkgs.lib.genAttrs [
|
||||
"x86_64-linux"
|
||||
"aarch64-darwin"
|
||||
] (system: nixpkgs.legacyPackages.${system}.nixfmt);
|
||||
|
||||
common = {
|
||||
overlays = import ./modules/common/overlays.nix;
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
{
|
||||
nur,
|
||||
pkgs,
|
||||
userName,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
# INFO: set these to your liking
|
||||
matrixFqdn = "chat.wyattjmiller.com";
|
||||
rtcFqdn = "rtc.wyattjmiller.com";
|
||||
@@ -10,16 +12,50 @@
|
||||
supportEmail = "wyatt@wyattjmiller.com";
|
||||
livekitKeyFile = "/var/lib/livekit/livekit.key";
|
||||
matrixRegistrationTokenFile = "/var/lib/matrix.key";
|
||||
in {
|
||||
|
||||
sableWeb = nur.packages.${pkgs.stdenv.hostPlatform.system}.sable-web;
|
||||
|
||||
sableConfig = pkgs.writeTextDir "config.json" (
|
||||
builtins.toJSON {
|
||||
defaultHomeserver = 0;
|
||||
homeserverList = [ matrixFqdn ];
|
||||
allowCustomHomeservers = false;
|
||||
|
||||
disableAccountSwitcher = false;
|
||||
hideUsernamePasswordFields = false;
|
||||
|
||||
hashRouter = {
|
||||
enabled = false;
|
||||
basename = "/";
|
||||
};
|
||||
|
||||
featuredCommunities = {
|
||||
spaces = [
|
||||
"#seventhdawn:chat.wyattjmiller.com"
|
||||
];
|
||||
rooms = [
|
||||
"#general:chat.wyattjmiller.com"
|
||||
"#gposeglams:chat.wyattjmiller.com"
|
||||
"#lobby-vc:chat.wyattjmiller.com"
|
||||
"#annoucements:chat.wyattjmiller.com"
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../../pwrMgmt
|
||||
];
|
||||
|
||||
# Enable flakes for NixOS
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
nix.settings = {
|
||||
download-buffer-size = 134217728; # 128 MiB in bytes
|
||||
download-buffer-size = 134217728; # 128 MiB in bytes
|
||||
};
|
||||
|
||||
# Custom kernel/boot stuff
|
||||
@@ -79,7 +115,7 @@ in {
|
||||
8448
|
||||
];
|
||||
|
||||
allowedUDPPortRanges =[
|
||||
allowedUDPPortRanges = [
|
||||
# TURN UDP relays
|
||||
{
|
||||
from = 49000;
|
||||
@@ -99,7 +135,11 @@ in {
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFV9eSc9L+aJLoKoexq2f/jb5rpyZnhuGiyhS8YQAbaS wyatt@wyattjmiller.com"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO4WKvKnnYpTbzZHFEslOKyfiiMqWxhW3AfX6E7ACmYU wyatt@wyattjmiller.com"
|
||||
];
|
||||
extraGroups = ["wheel" "video" "network"];
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"video"
|
||||
"network"
|
||||
];
|
||||
};
|
||||
|
||||
# fail2ban
|
||||
@@ -145,10 +185,12 @@ in {
|
||||
support_email = supportEmail;
|
||||
support_mxid = "@wymiller:${matrixFqdn}";
|
||||
|
||||
rtc_transports = [{
|
||||
type = "livekit";
|
||||
livekit_service_url = "https://${rtcFqdn}";
|
||||
}];
|
||||
rtc_transports = [
|
||||
{
|
||||
type = "livekit";
|
||||
livekit_service_url = "https://${rtcFqdn}";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -176,8 +218,37 @@ in {
|
||||
virtualHosts = {
|
||||
"${matrixFqdn}" = {
|
||||
extraConfig = ''
|
||||
encode zstd gzip
|
||||
reverse_proxy localhost:8008
|
||||
@matrixEndpoints path \
|
||||
/_matrix/* \
|
||||
/_tuwunel/* \
|
||||
/.well-known/matrix/*
|
||||
|
||||
handle @matrixEndpoints {
|
||||
reverse_proxy 127.0.0.1:8008
|
||||
}
|
||||
|
||||
@sableConfig path /config.json
|
||||
handle @sableConfig {
|
||||
root * ${sableConfig}
|
||||
header Cache-Control "no-store"
|
||||
file_server
|
||||
}
|
||||
|
||||
handle {
|
||||
root * ${sableWeb}
|
||||
|
||||
encode zstd gzip
|
||||
try_files {path} /index.html
|
||||
|
||||
file_server {
|
||||
precompressed br
|
||||
}
|
||||
|
||||
header /assets/* Cache-Control "public, max-age=31536000, immutable"
|
||||
header /sw.js Cache-Control "no-cache"
|
||||
header /index.html Cache-Control "no-cache"
|
||||
header Document-Policy "js-profiling"
|
||||
}
|
||||
'';
|
||||
};
|
||||
"${matrixFqdn}:8448" = {
|
||||
@@ -220,7 +291,10 @@ in {
|
||||
matrix-registration-token-gen = {
|
||||
before = [ "tuwunel.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
path = with pkgs; [ coreutils openssl ];
|
||||
path = with pkgs; [
|
||||
coreutils
|
||||
openssl
|
||||
];
|
||||
script = ''
|
||||
set -eu
|
||||
|
||||
@@ -242,9 +316,15 @@ in {
|
||||
};
|
||||
|
||||
livekit-key-gen = {
|
||||
before = [ "lk-jwt-service.service" "livekit.service" ];
|
||||
before = [
|
||||
"lk-jwt-service.service"
|
||||
"livekit.service"
|
||||
];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
path = with pkgs; [ coreutils openssl ];
|
||||
path = with pkgs; [
|
||||
coreutils
|
||||
openssl
|
||||
];
|
||||
script = ''
|
||||
set -eu
|
||||
|
||||
|
||||
Reference in New Issue
Block a user