hosts/plover: update Wezterm mux server config

It's not fully working but we'll get there.
This commit is contained in:
Gabriel Arazas 2023-10-08 03:29:06 +08:00
parent 97916aaa05
commit a6fcc6eec6
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 8 additions and 5 deletions

View File

@ -1,10 +1,12 @@
return { return {
tls_servers = { tls_servers = {
-- These are expected to be imported through systemd LoadCredentials
-- directive.
{ {
pem_private_key = os.getenv("CREDENTIALS_DIRECTORY") .. "/key.pem", pem_private_key = os.getenv("CREDENTIALS_DIRECTORY") .. "/key.pem",
pem_cert = os.getenv("CREDENTIALS_DIRECTORY") .. "/cert.pem", pem_cert = os.getenv("CREDENTIALS_DIRECTORY") .. "/cert.pem",
pem_ca = os.getenv("CREDENTIALS_DIRECTORY") .. "/fullchain.pem", pem_ca = os.getenv("CREDENTIALS_DIRECTORY") .. "/fullchain.pem",
bind_address = "@domain@:@port@", bind_address = "@listen_address@",
}, },
}, },
} }

View File

@ -3,21 +3,22 @@
# We're setting up Wezterm mux server with TLS domains. # We're setting up Wezterm mux server with TLS domains.
let let
weztermDomain = "mux.${config.networking.domain}"; weztermDomain = "mux.${config.networking.domain}";
port = 9801;
listenAddress = "127.0.0.1:${builtins.toString port}";
configFile = pkgs.substituteAll { configFile = pkgs.substituteAll {
src = ../../config/wezterm/config.lua; src = ../../config/wezterm/config.lua;
domain = weztermDomain; listen_address = listenAddress;
port = 9801;
}; };
in in
{ {
services.wezterm-mux-server = { services.wezterm-mux-server = {
enable = true; enable = true;
inherit configFile; inherit configFile;
user = "plover";
group = "users";
}; };
networking.firewall.allowedTCPPorts = [ port ];
systemd.services.wezterm-mux-server = { systemd.services.wezterm-mux-server = {
requires = [ "acme-finished-${weztermDomain}.target" ]; requires = [ "acme-finished-${weztermDomain}.target" ];
environment.WEZTERM_LOG = "info"; environment.WEZTERM_LOG = "info";