From 71f4de2804824f988315e61cb141ac5174db8af2 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Sat, 16 Nov 2024 13:19:23 +0000 Subject: [PATCH] feat: teslamate --- hosts/architect/postgres.nix | 8 ++++++++ hosts/architect/teslamate.nix | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 hosts/architect/postgres.nix create mode 100644 hosts/architect/teslamate.nix diff --git a/hosts/architect/postgres.nix b/hosts/architect/postgres.nix new file mode 100644 index 0000000..0ebd896 --- /dev/null +++ b/hosts/architect/postgres.nix @@ -0,0 +1,8 @@ +{ pkgs, lib, ... }: + +{ + postgresql = { + enable = true; + package = lib.mkForce pkgs.postgresql; + }; +} diff --git a/hosts/architect/teslamate.nix b/hosts/architect/teslamate.nix new file mode 100644 index 0000000..03e924a --- /dev/null +++ b/hosts/architect/teslamate.nix @@ -0,0 +1,38 @@ +{ config, pkgs, lib, ... }: + +let + domain = "media.giugl.io"; + port = 8096; + allowLan = true; +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; + + allow = [ + tailscale.net + ]; + }; + + "/socket" = { + inherit port allowLan; + + proxyWebsockets = true; + allow = [ + tailscale.net + ]; + }; + }; + }; + + services.teslamate = { + enable = true; + package = pkgs.teslamatePkgs.teslamate; + }; +}