factor(teslamate.nix): update domain, ports, and service configuration
- Updated domain to `tesla.giugl.io` - Added separate ports for TeslaMate (`11234`) and Grafana (`11334`) - Configured proxy settings for websockets in `/` and `/live/websocket` locations - Added `/grafana` location with appropriate configuration - Updated `services.teslamate` to include port, listen address, secrets file, virtual host, PostgreSQL server, and Grafana settings
This commit is contained in:
parent
23ee309b8f
commit
2dc8e1b1a3
@ -1,28 +1,35 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
domain = "media.giugl.io";
|
||||
port = 8096;
|
||||
domain = "tesla.giugl.io";
|
||||
teslamatePort = 11234;
|
||||
grafanaPort = 11334;
|
||||
allowLan = true;
|
||||
allowWAN = false;
|
||||
in
|
||||
{
|
||||
# needed since StateDirectory does not accept symlinks
|
||||
systemd.services.jellyfin.serviceConfig.StateDirectory = lib.mkForce "";
|
||||
|
||||
architect.vhost.${domain} = with config.architect.networks; {
|
||||
dnsInterfaces = [ "lan" "tailscale" ];
|
||||
locations = {
|
||||
"/" = {
|
||||
inherit port allowLan;
|
||||
|
||||
inherit allowLan allowWAN;
|
||||
port = teslamatePort;
|
||||
proxyWebsockets = true;
|
||||
allow = [
|
||||
tailscale.net
|
||||
];
|
||||
};
|
||||
|
||||
"/socket" = {
|
||||
inherit port allowLan;
|
||||
|
||||
"/live/websocket" = {
|
||||
inherit allowLan allowWAN;
|
||||
port = teslamatePort;
|
||||
proxyWebsockets = true;
|
||||
allow = [
|
||||
tailscale.net
|
||||
];
|
||||
};
|
||||
"/grafana" = {
|
||||
inherit allowLan allowWAN;
|
||||
port = grafanaPort;
|
||||
proxyWebsockets = true;
|
||||
allow = [
|
||||
tailscale.net
|
||||
@ -33,6 +40,12 @@ in
|
||||
|
||||
services.teslamate = {
|
||||
enable = true;
|
||||
package = pkgs.teslamatePkgs.teslamate;
|
||||
port = teslamatePort;
|
||||
|
||||
listenAddress = "127.0.0.1";
|
||||
secretsFile = "/secrets/teslamate/teslamate.env";
|
||||
virtualHost = domain;
|
||||
postgres.enable_server = true;
|
||||
grafana = { enable = true; port = grafanaPort; listenAddress = "127.0.0.1"; urlPath = "/grafana"; };
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user