mod: added sable web to yshtola config
added formatter
This commit is contained in:
@@ -50,6 +50,10 @@
|
|||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
meta = import ./meta;
|
meta = import ./meta;
|
||||||
|
formatter = nixpkgs.lib.genAttrs [
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-darwin"
|
||||||
|
] (system: nixpkgs.legacyPackages.${system}.nixfmt);
|
||||||
|
|
||||||
common = {
|
common = {
|
||||||
overlays = import ./modules/common/overlays.nix;
|
overlays = import ./modules/common/overlays.nix;
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
{
|
{
|
||||||
|
nur,
|
||||||
pkgs,
|
pkgs,
|
||||||
userName,
|
userName,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
# INFO: set these to your liking
|
# INFO: set these to your liking
|
||||||
matrixFqdn = "chat.wyattjmiller.com";
|
matrixFqdn = "chat.wyattjmiller.com";
|
||||||
rtcFqdn = "rtc.wyattjmiller.com";
|
rtcFqdn = "rtc.wyattjmiller.com";
|
||||||
@@ -10,13 +12,47 @@
|
|||||||
supportEmail = "wyatt@wyattjmiller.com";
|
supportEmail = "wyatt@wyattjmiller.com";
|
||||||
livekitKeyFile = "/var/lib/livekit/livekit.key";
|
livekitKeyFile = "/var/lib/livekit/livekit.key";
|
||||||
matrixRegistrationTokenFile = "/var/lib/matrix.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 = [
|
imports = [
|
||||||
../../pwrMgmt
|
../../pwrMgmt
|
||||||
];
|
];
|
||||||
|
|
||||||
# Enable flakes for NixOS
|
# Enable flakes for NixOS
|
||||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
nix.settings.experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
];
|
||||||
|
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
download-buffer-size = 134217728; # 128 MiB in bytes
|
download-buffer-size = 134217728; # 128 MiB in bytes
|
||||||
@@ -99,7 +135,11 @@ in {
|
|||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFV9eSc9L+aJLoKoexq2f/jb5rpyZnhuGiyhS8YQAbaS wyatt@wyattjmiller.com"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFV9eSc9L+aJLoKoexq2f/jb5rpyZnhuGiyhS8YQAbaS wyatt@wyattjmiller.com"
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO4WKvKnnYpTbzZHFEslOKyfiiMqWxhW3AfX6E7ACmYU wyatt@wyattjmiller.com"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO4WKvKnnYpTbzZHFEslOKyfiiMqWxhW3AfX6E7ACmYU wyatt@wyattjmiller.com"
|
||||||
];
|
];
|
||||||
extraGroups = ["wheel" "video" "network"];
|
extraGroups = [
|
||||||
|
"wheel"
|
||||||
|
"video"
|
||||||
|
"network"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# fail2ban
|
# fail2ban
|
||||||
@@ -145,10 +185,12 @@ in {
|
|||||||
support_email = supportEmail;
|
support_email = supportEmail;
|
||||||
support_mxid = "@wymiller:${matrixFqdn}";
|
support_mxid = "@wymiller:${matrixFqdn}";
|
||||||
|
|
||||||
rtc_transports = [{
|
rtc_transports = [
|
||||||
|
{
|
||||||
type = "livekit";
|
type = "livekit";
|
||||||
livekit_service_url = "https://${rtcFqdn}";
|
livekit_service_url = "https://${rtcFqdn}";
|
||||||
}];
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -176,8 +218,37 @@ in {
|
|||||||
virtualHosts = {
|
virtualHosts = {
|
||||||
"${matrixFqdn}" = {
|
"${matrixFqdn}" = {
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
@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
|
encode zstd gzip
|
||||||
reverse_proxy localhost:8008
|
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" = {
|
"${matrixFqdn}:8448" = {
|
||||||
@@ -220,7 +291,10 @@ in {
|
|||||||
matrix-registration-token-gen = {
|
matrix-registration-token-gen = {
|
||||||
before = [ "tuwunel.service" ];
|
before = [ "tuwunel.service" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
path = with pkgs; [ coreutils openssl ];
|
path = with pkgs; [
|
||||||
|
coreutils
|
||||||
|
openssl
|
||||||
|
];
|
||||||
script = ''
|
script = ''
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
@@ -242,9 +316,15 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
livekit-key-gen = {
|
livekit-key-gen = {
|
||||||
before = [ "lk-jwt-service.service" "livekit.service" ];
|
before = [
|
||||||
|
"lk-jwt-service.service"
|
||||||
|
"livekit.service"
|
||||||
|
];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
path = with pkgs; [ coreutils openssl ];
|
path = with pkgs; [
|
||||||
|
coreutils
|
||||||
|
openssl
|
||||||
|
];
|
||||||
script = ''
|
script = ''
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user